在Cisco认证考试中,Switch命令是考察的重要内容之一。掌握这些命令不仅可以提高考试通过率,还能在实际工作中更好地进行网络管理和维护。本文将为您详细介绍Cisco认证考试中Switch命令的使用方法和注意事项。
一、设置主机名/系统名
在基于IOS的交换机上设置主机名/系统名:
switch(config)# hostname hostname
在基于CLI的交换机上设置主机名/系统名:
switch(enable) set system name name-string
二、设置登录口令
在基于IOS的交换机上设置登录口令:
switch(config)# enable password level 1 password
在基于CLI的交换机上设置登录口令:
switch(enable) set password
三、设置远程访问
在基于IOS的交换机上设置远程访问:
switch(config)# interface vlan 1
switch(config-if)# ip address IP地址 子网掩码
四、其他常用命令
- 查看交换机配置:switch# show running-config
- 保存配置:switch(config)# copy running-config startup-config
- 重启交换机:switch# reload
- 进入特权模式:switch# enable
- 退出特权模式:switch# disable
- 进入配置模式:switch(config)#
- 退出配置模式:switch(config)# exit
- 清除配置:switch(config)# erase startup-config
- 查看MAC地址表:switch# show mac-address-table
- 配置VLAN:switch(config)# vlan vlan-id
- 划分端口到VLAN:switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan vlan-id - 配置trunk端口:switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan vlan-id … (多个VLAN之间用逗号隔开) - 查看接口状态:switch# show interfaces status
- 查看IP地址:switch# show ip interface brief
- 查看ARP表:switch# show ip arp
- 查看路由表:switch# show ip route
- 查看MAC表:switch# show mac-address-table dynamic
- 配置静态路由:switch(config)# ip route destination-network subnet-mask下一跳IP地址或主机名