接口和线缆识别
  
  
 认识、配置IOS
  
 IOS , 网络设备的操作系统;
    Internet operating system ,因特网操作系统;
    
 www.cisco.com -> 思科官网, 下载IOS;
  
  
 交换机组成:
     软件 - 系统文件 - IOS
            配置文件 -  
                   running-config , 正在运行的配置文件(内存-RAM)
                        
                   startup-config ,  
                   启动配置文件(非易失性内存-NVRAM)                       
     硬件 -CPU  
           硬盘 -> Flash ,存储操作系统
           内存
           电源
           ROM ->只读存储器
  
 备注:
 POTS -> 加电自检;
 BIOS --> 固化的引导程序;
  
  
 ---------------------------------------------------
 IOS配置
  
 模式 -  
     用户模式,权限有限;
     特权模式,拥有全部权限;
  
 Switch >  
      前面的 switch 是设备的名字;
      > 是 设备的“模式提示符;表示的是用户模式;
      # ,代表的是”特权模式”
       
 配置命令:
    switch > enable
    switch #
    switch # disable -->返回到用户模式;
    switch # exit ---> 退出;
     
 命令帮助系统:
    ?,可以罗列出当前模式所支持的所有命令;
    e? ,可以罗列出当前模式下所有以 e 开头的命令;
    tab , 可以将不完整的命令单词,自动补全。
     
 配置 特权密码:
      即通过用户模式进入到特权模式时,所需要的密码;      
      命令:
       SW3#configure terminal  
       SW3(config)#enable password Cisco123
       SW3(config)#enable secret  111
 注意:
     可以通过上述两种方式配置 enable 密码;
     enable password 配置的密码是以明文的方式存在于配置文件中;
     enable secret
     配置的密码是以密文的方式存在于配置文件中;
     两者同时存在时, secret 优先级高;
  
 良好的配置习惯:
     配置完相应的功能之后,进行验证,确保无误;
     及时保存 , 命令如下:
          SW3#write
               将 running-config中的内容,直接保存到
               startup-config 文件中;
  
  
 调试命令超时时间:
      - console 0 :
         SW1(config)#line console 0  
         SW1(config-line)#exec-timeout 0 0 ->永不超时;
         SW1(config-line)#password  abc123 ->密码设置;
         SW1(config-line)#login ->启用认证功能;
  
 注意:
     console 下的默认超时时间为 10分钟;
     console 下默认没有启用认证;
     工作环境中,不建议配置“永不超时”;
                
 查看设备当前的登录用户:
     show users                
                
 -----------------------------------------------------
  
 配置IP地址:
  
 SW1#configure terminal  
 SW1(config)#interface vlan 1 -> 进入虚拟端口;
 SW1(config-if)#ip address 192.168.1.1 255.255.255.0
                                  --->配置IP地址;
 SW1(config-if)#no shutdown -> 打开端口;
  
 验证命令:
    SW1#show running-config
    SW1#show ip interface brief
  
 注意:
     查看接口的状态,必须是 up / up  ;  
 ----------------------------------------------------
 接口:
    Ethernet 0/1  ------ 10Mbps
    FastEthernet 0/1  ------ 100Mbps
    GigabitEthernet 0/1 ------ 1000Mbps
    XGigabitEthernet 0/1 ------ 10000Mbps   
       0/1 分解:
           0 - 模块号;
           1 - 端口号;
     
       X/Y/Z分解:
           X - 表示的槽位号;
            
 ------------------------------------------------------
                                设置 vty 密码;
 IP地址:192.168.1.X0             line vty 0 4
         255.255.255.0               password cisco
         
 远程访问密码:cisco
  
 特权密码:设备名字;
 --------------------------------------------------
 远程访问协议:
        telnet   x.x.x.x.  
           例如 : telnet 192.168.1.20  
                         password : cisco
                      SW2>enable
                         password :SW2
                      SW2#
 -----------------------------------------------
  
 远程访问配置思路:
 1、配置主机IP地址;
 2、配置设备IP地址;
 3、测试主机与设备的连通性;--- ping x.x.x.x  
 4、配置设备的 VTY 密码;-line vty 0 4 -> password xxxx
 5、配置设备的 enable 密码;-- enable password xxxxx
 6、在主机上远程访问设备;PC- telnet x.x.x.x  
  
 ----------------------------------------------------
 注意:
      远程访问协议 - telnet  
      默认情况下,远程访问使用的都是设备的虚拟端口-vty  
      默认情况下,远程访问都是需要密码的(默认有login)
      默认情况下,远程访问时必须配置“特权密码”;
  
 路由器接口IP配置:
   R1(config)#interface fastethernet 0/1 R1(config-if)#no shutdown
   R1(config-if)#ip address 192.168.1.100
                                         255.255.255.0  
 验证:
     R1#show running-config ;
     R1#show ip interface brief ---> up / up ;  
  
 -----------------------------------------------------------
  
 设备恢复出厂配置:
       原理: 删除启动配置文件;
       实现:       R1# erase startup-config  
                            or
                    R1# delete nvram:startup-config  
              
 查看文件存储路径:
        R1# dir
        R1# dir /all        
 注意:
   erase相当于“格式化”命令,会删除指定存储介质上的所有文件;
   一定不可以 erase flash:  
  
 -------------------------------------------------------------
 重启设备:
      R1# reload
  
 -------------------------------------------------------------
  
 查看本地设备有哪些用户登录:
 R2#show users
  
 查看本地设备主动发起的会话:
 R1#show session  
  
 在不同会话之间快速切换:
 R1#resume { id }
  
 断开/恢复指定会话:
 R1#disconnect / resume { id }  
  
 跳转回本地设备:
    ctrl + shift +6 , X  
  
                
                
                
 -------------------------------------------------
 switch>
 switch>enable  -->进入到特权模式;
 switch#
 switch#configure terminal ->进入“全局配置模式”;
 switch(config)#
 switch(config)#hostname SW3 ->更改主机名;
 SW3(config)#
 SW3(config)#no ip domain lookup ->关闭域名查询功能;
 SW3(config)#exit
 SW3#ab
    translating "ab"
       unknown command ....    
 SW3(config)#enable password  Cisco123
    PK
 SW3(config)#enable secret 111 (配置的密码优先使用)
 SW3(config)#no enable password / se                         
 验证命令:
     show running-config
     SW3#disable
     SW3>enable  
       password : 111
     SW3#       
                
 保存配置:
     SW3#write  
            将内存中的配置文件内容保存到启动配置文件;    
本文出自 “13416941” 博客,请务必保留此出处http://13426941.blog.51cto.com/13416941/1975989
原文地址:http://13426941.blog.51cto.com/13416941/1975989