四种模式
- 用户模式 Switch>
- 特权模式 Switch#
- 全局配置模式 Switch(config)#
- 端口模式 Switch(config-if)#
模式切换指令
enable 进入特权模式(一般简写为en)
config t 进入全局配置模式
interface fa 0/1 进入交换机某个端口视图模式
exit 返回到上级模式
end 从全局以下模式返回到特权模式
快捷指令
帮助信息(如? 、co?、copy?)
命令简写(如 en 的完整命令为 enable)
命令自动补全(Tab)
快捷键(ctrl+c中断测试,ctrl+z退回到特权视图)
查看配置指令
show version 查看交换机版本信息
show ip route 查看路由表
show running-config 查看当前生效的配置信息
show startup-config 查看保存在NVRAM中的启动配置信息
show interface 查看所有端口信息
show interface fastEthernet 0/0 查看某个端口信息
show mac-address-table 查看交换机的MAC地址
Password
可以设置通过console端口连接设备及Telnet远程登录时所需的密码
Switch#config terminal
Switch(config)#enable password cisco //设置进入特权模式的密码为cisco
Switch(config)#no enable password //取消特权模式密码
Switch(config)#line console 0 //表示配置控制台线路,0是控制台的线路编号
Switch(config-line)#password cisco //设置进入控制台访问的密码
Switch(config-line)#login //用于打开登录认证功能
Switch(config-line)#no password //取消密码
配置用户登录密码并登陆
Switch(config)# enable password ******* 设置进入特权模式的密码
Switch(config)# line vty 0 4
Switch(config-line)# password 123456
Switch(config-line)# login