Switch(config)#vlan 10,20 Switch(config-vlan)#int e0/2 Switch(config-if)#sw ac vl 10 Switch(config-if)#int e0/3 Switch(config-if)#sw ac vl 20 Switch(config-if)#int vl 10 Switch(config-if)#ip add 192.168.10.254 255.255.255.0 Switch(config-if)#no sh Switch(config-if)#int vl 20 Switch(config-if)#ip add 192.168.20.254 255.255.255.0 Switch(config-if)#no sh
检查R2和R3的连通性
1 2 3 4 5
R2#ping 192.168.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds: ..!!! Success rate is 60 percent (3/5), round-trip min/avg/max = 1/1/1 ms
三层交换机的路由模块可以和路由器一样启动任何协议
三层交换综合实验
配置trunk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
SW1(config)#int range e0/1 -2 SW1(config-if-range)#sw tr en do SW1(config-if-range)#sw mo tr ================================= SW2(config)#int range e0/1 -2 SW2(config-if-range)#sw tr en do SW2(config-if-range)#sw mo tr ================================ SW3(config)#int range e0/1 -3, e1/1 SW3(config-if-range)#sw tr en do SW3(config-if-range)#sw mo tr ================================ SW4(config)#int e0/2 SW4(config-if)#sw tr en do SW4(config-if)#sw mo tr ================================ SW5(config)#int e0/1 SW5(config-if)#sw tr en do SW5(config-if)#sw mo tr
配置vtp
1 2 3 4 5 6
SW3(config)#vtp do cisco SW3(config)#vtp mo ser ========================== 除了Sw3外的交换机 vtp do cisco vtp mo cl
创建vlan
1 2 3 4
SW3(config)#vlan 46,34,23,12,15,57 ================================ 去Sw3以外的交换机上检查是否同步vlan show vlan
将R6R7对应接口加入vlan
1 2 3 4 5
SW4(config)#int e0/1 SW4(config-if)#sw ac vl 46 =================== SW5(config)#int e0/2 SW5(config-if)#sw ac vl 57
Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 1 FULL/BDR 00:00:38 192.168.34.3 Vlan34 6.6.6.6 1 FULL/DR 00:00:39 192.168.46.6 Vlan46 ====================================== SW3#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface 4.4.4.4 1 FULL/DR 00:00:36 192.168.34.4 Vlan34 2.2.2.2 1 FULL/BDR 00:00:38 192.168.23.2 Vlan23 ===================================== R6#sh ip route ospf 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/13] via 192.168.46.4, 00:00:32, Ethernet0/0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/12] via 192.168.46.4, 00:00:32, Ethernet0/0 4.0.0.0/32 is subnetted, 1 subnets O 4.4.4.4 [110/11] via 192.168.46.4, 00:00:32, Ethernet0/0 O IA 192.168.23.0/24 [110/12] via 192.168.46.4, 00:00:32, Ethernet0/0 O 192.168.34.0/24 [110/11] via 192.168.46.4, 00:00:32, Ethernet0/0
检查ISIS
1 2 3
SW2#sh ip route isis 1.0.0.0/24 is subnetted, 1 subnets i L2 1.1.1.0 [115/20] via 192.168.12.1, 00:05:36, Vlan12
检查eigrp
1 2 3
SW1#sh ip route eigrp 5.0.0.0/24 is subnetted, 1 subnets D 5.5.5.0 [90/130816] via 192.168.15.5, 00:04:30, Vlan15
检查rip
1 2 3
SW5#sh ip route rip 7.0.0.0/24 is subnetted, 1 subnets R 7.7.7.0 [120/1] via 192.168.57.7, 00:00:09, Vlan57
R6#sh ip route ospf 1.0.0.0/24 is subnetted, 1 subnets O E2 1.1.1.0 [110/20] via 192.168.46.4, 00:01:25, Ethernet0/0 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/13] via 192.168.46.4, 00:04:45, Ethernet0/0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/12] via 192.168.46.4, 00:04:45, Ethernet0/0 4.0.0.0/32 is subnetted, 1 subnets O 4.4.4.4 [110/11] via 192.168.46.4, 00:04:45, Ethernet0/0 5.0.0.0/24 is subnetted, 1 subnets O E2 5.5.5.0 [110/20] via 192.168.46.4, 00:01:01, Ethernet0/0 7.0.0.0/24 is subnetted, 1 subnets O E2 7.7.7.0 [110/20] via 192.168.46.4, 00:00:19, Ethernet0/0 O E2 192.168.15.0/24 [110/20] via 192.168.46.4, 00:01:01, Ethernet0/0 O IA 192.168.23.0/24 [110/12] via 192.168.46.4, 00:04:45, Ethernet0/0 O 192.168.34.0/24 [110/11] via 192.168.46.4, 00:04:45, Ethernet0/0 O E2 192.168.57.0/24 [110/20] via 192.168.46.4, 00:00:19, Ethernet0/0
检查连通性和经过的路线
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
R6#ping 7.7.7.7 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 2/3/4 ms R6#tr R6#traceroute 7.7.7.7 Type escape sequence to abort. Tracing the route to 7.7.7.7 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.46.4 1 msec 0 msec 0 msec 2 192.168.34.3 1 msec 1 msec 1 msec 3 192.168.23.2 2 msec 2 msec 2 msec 4 192.168.12.1 3 msec 2 msec 1 msec 5 192.168.15.5 2 msec 3 msec 2 msec 6 192.168.57.7 3 msec * 5 msec