enable 进入特权模式(一般简写为en) config t 进入全局配置模式 interfacefa 0/1 进入交换机某个端口视图模式 exit 返回到上级模式 end 从全局以下模式返回到特权模式 ## 快捷指令 帮助信息(如? 、co?、copy?) 命令简写(如 en 的完整命令为 enable) 命令自动补全(Tab) 快捷键(ctrl+c中断测试,ctrl+z退回到特权视图) reload 重启(在特权模式下) hostname X修改交换机名称(在全局配置模式下)
## 端口配置指令
speed,duplex 配置交换机端口参数 show version 查看交换机版本信息 show running-config 查看当前生效的配置信息 show startup-config 查看保存在NVRAM中的启动配置信息 show interface 查看端口信息 showmac-address-table 查看交换机的MAC地址 选择某个端口Switch(config)# interface type mod/port (type:端口类型,通常有ethernet、Fastethernet、Gigabitethernet; mod:端口所在的模块; port:在该模块中的编号;):Switch(config)# interface fa 0/1; 选择多个端口Switch(config)#interface type mod/startport-endport 如:Switch(config)# interface interface fa 0/1-5 //选择端口 fa 0/1 ~ fa 0/5 Switch(config-if)#speed [10/100/auto] 设置端口通信速度 Switch(config-if)#duplex [half/full/auto] 设置端口单双工模式 若交换机设置为auto以外的具体速度,此时应注意保证通信双方也要有相同的设置值。 注意事项:在配置交换机时,要注意交换机端口的单双工模式的匹配,如果链路一端设置的是全双工,另一端是自动协商,则会造成响应差和高出错率,丢包现象会很严重。通常两端设置为相同的模式。