基本配置: 
 Switch>en                        //进入特权模式
 Switch#conf t                     //进入全局配置模式
 Enter configuration commands, one per line.  End with CNTL/Z.
 Switch(config)#line co 0                    //进入console接口配置模式
 Switch(config-line)#logging synchronous       //开启自动换行
 Switch(config-line)#exec-t 0 0                //关闭时间超时退出
 Switch(config-line)#password cisco            //密码“cisco”
 Switch(config-line)#login                    //允许登陆
 Switch(config-line)#exit                     //退出子模式
 Switch(config)#line vty 0 4                  //进入虚拟终端配置模式
 Switch(config-line)#password ciscocisco       //密码“ciscocisco”
 Switch(config-line)#login                   //允许登陆
 Switch(config-line)#exit                    //退出子模式
 Switch(config)#no ip domain lo              //关闭命令打错时寻找DNS
 Switch(config)#enable secret cisco123         //enable 密码“cisco 123”
 Switch(config)#banner login #               //设置登陆信息
 Enter TEXT message.  End with the character '#'.
 Login Information #
 Switch(config)#Service password-encryption    //使用7级安全加密
 SSH
 SSH配置:
 Switch#conf t
 Enter configuration commands, one per line.  End with CNTL/Z.
 Switch(config)#host Rack1R1                      //修改名字
 Rack1Sw1(config)#enable secret cisco123             
 Rack1Sw1(config)#username ccie secret cisco           //配置用户名密码
 Rack1Sw1(config)#ip domain-name studyccie.com       //配置域名字
 Rack1Sw1(config)#crypto key generate rsa             //配置安全加密
 The name for the keys will be: Rack1R1.studyccie.com
 Choose the size of the key modulus in the range of 360 to 2048 for your
   General Purpose Keys. Choosing a key modulus greater than 512 may take
   a few minutes.
  
 How many bits in the modulus [512]:
 % Generating 512 bit RSA keys, keys will be non-exportable...[OK]
 Rack1Sw1(config)#ip ssh ver 2                        //配置SSH版本2
 *?? 1 0:3:46.284:  RSA key size needs to be at least 768 bits for ssh version 2
 *?? 1 0:3:46.284:  %SSH-5-ENABLED: SSH 1.5 has been enabled
 Please create RSA keys (of at least 768 bits size) to enable SSH v2.
 Rack1Sw1(config)#line vty 0 4
 Rack1Sw1(config-line)#login local                //使用本地认证
 Rack1Sw1(config-line)#transport input ssh         //指定使用SSH登陆
 Rack1Sw1(config-line)#end
  
 Configuring Port security(配置安全)
 Switchport mode access
 Switchport port-security
 Switchport port-security maximum “数量”
 Switchport port-security mac-address {“绑定的MAC地址” | Sticky(黏性地址)}
 Switchport port-security violation
 ↑{protect (丢弃)| restrict (丢弃在发出错误信息)| shutdown(进入 错误Down)}
 Errdisable recovery cause all
 Errdisable recovery Interval “恢复时间”
  
 交换机与HUB比较:
 
               HUB                                    交换机
 它们的区别在与:
 HUB是直线共享、半双工工作、一个冲突域以及需要CSMA/CD。
 交换机可以在背板上建立一条单独的虚拟链路、全双工、多个冲突域以及在全双工模式下无需CSMA/CD。
  
 2层交换机的 Troubleshooting:
 需要检查
 l  线缆
 l  干扰
 l  传输模式
 l  新增加设备
 检查以下信息:
 
 [1]
 第一个UP是:物理是否有电信号
 第二个UP是:逻辑协议
 [2]
 数据包的错误信息
 Input errors 进入接口错误
 CRC 校验错误
 [3]
 交换机输出错误
 [4]
 Collisions 重传(冲突重传)
 [5]
 Restarts 以太网控制器重启(不是交换机)