实验四:交换机的基本命令使用
一、 理论基础
人们在使用网络设备的过程中,往往要查看设备的配置信息,删除配置或者重新启动设备等等,在此我们介绍几个常用的公用命令,以便大家在后面的实验中能够避免一些不必要的麻烦。
二、 实验案例
交换机的基本命令的使用的配置 1、实验拓扑结构图:
2、配置说明:
交换机的管理地址:192.168.10.100 /24
PC1的IP:192.168.10.10/24 MAC:000d-608b-0c95 PC2的IP:192.168.10.11/24 MAC:00e0-4c39-6a90
3、具体配置:
交换机的基本命令的使用: [Quidway]int vlan 1
[Quidway-Vlan-interface1]
%Apr 2 00:08:46 2000 Quidway L2INF/5/VLANIF LINK STATUS CHANGE: Vlan-interface1: turns into UP state
[Quidway-Vlan-interface1]ip address 192.168.10.100 255.255.255.0 [Quidway-Vlan-interface1] %Apr 2 00:09:02 2000 Quidway IFNET/5/UPDOWN:Line protocol on the interface Vlan -interface1 turns into UP state [Quidway]dis mac-address
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s)
00e0-4c39-6a90 1 Learned Ethernet0/1 AGING 000d-608b-0c95 1 Learned Ethernet0/3 AGING
--- 2 mac address(es) found --- [Quidway]dis mac-address ? H-H-H MAC address
aging-time Global aging time count MAC entries count dynamic Dynamic entry, with aging, can be added/deleted, lost after reset interface Choose one interface to display
static Static entry, without aging, can be added/deleted, saved to the configuration file vlan VLAN
[Quidway]dis mac-address aging-time Mac address aging time: 300s [Quidway]dis arp
IP Address MAC Address VLAN ID Port Name Aging Type --- 0 entry found --- [Quidway]ping 192.168.10.10
PING 192.168.10.10: 56 data bytes, press CTRL_C to break
Reply from 192.168.10.10: bytes=56 Sequence=1 ttl=128 time = 20 ms Reply from 192.168.10.10: bytes=56 Sequence=2 ttl=128 time = 20 ms Reply from 192.168.10.10: bytes=56 Sequence=3 ttl=128 time = 20 ms Reply from 192.168.10.10: bytes=56 Sequence=4 ttl=128 time = 20 ms Reply from 192.168.10.10: bytes=56 Sequence=5 ttl=128 time = 20 ms --- 192.168.10.10 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss
round-trip min/avg/max = 20/20/20 ms [Quidway]dis arp
IP Address MAC Address VLAN ID Port Name Aging Type 192.168.10.10 000d-608b-0c95 1 Ethernet0/3 20 Dynamic --- 1 entry found --- [Quidway]ping 192.168.10.11
PING 192.168.10.11: 56 data bytes, press CTRL_C to break
Reply from 192.168.10.11: bytes=56 Sequence=1 ttl=128 time = 30 ms Reply from 192.168.10.11: bytes=56 Sequence=2 ttl=128 time = 20 ms Reply from 192.168.10.11: bytes=56 Sequence=3 ttl=128 time = 20 ms Reply from 192.168.10.11: bytes=56 Sequence=4 ttl=128 time = 20 ms Reply from 192.168.10.11: bytes=56 Sequence=5 ttl=128 time = 20 ms --- 192.168.10.11 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss
round-trip min/avg/max = 20/22/30 ms [Quidway]dis arp
IP Address MAC Address VLAN ID Port Name Aging Type 192.168.10.10 000d-608b-0c95 1 Ethernet0/3 20 Dynamic 192.168.10.11 00e0-4c39-6a90 1 Ethernet0/1 20 Dynamic --- 2 entries found ---
静态绑定PCB和E0/3端口:手动添加的静态表项没有老化时间(NOAGED) [Quidway]mac-address static 000d-608b-0c95 interface e0/3 vlan 1 [Quidway]dis mac-address
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s) 00e0-4c39-6a90 1 Learned Ethernet0/1 AGING 000d-608b-0c95 1 Config static Ethernet0/3 NOAGED --- 2 mac address(es) found --- 此时把PC B和交换机的E0/5端口相连,那么再次显示表项时,会发现E0/5并没有学习到,因为静态表项优先于动态表项。分别用PC A ping PC B,测试结果:接E0/3(通),E0/5(不通)。
三、 实验总结
通过以上实验我们学习了如何给交换机加管理地址,如何设置aging-time的大小,arp的使用,静态地址绑定等等命令的使用。还有一些基本的命令这里就不再一一列举了,如:dis cur、save、dis save、reset save、reboot、dis version。