目标5:
配置SWITCH1和SWITCH2之间的以太网通道
1.sw1-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw1-3(config)#interface range f0/14 - 15
sw1-3(config-if-range)#channel-group 1 mode on
Creating a port-channel interface Port-channel1
sw1-3(config-if-range)#no sh
sw1-3(config-if-range)#exit
sw1-3(config)#exit
sw1-3#show ip in br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset up up
FastEthernet0/14 unassigned YES unset up up
FastEthernet0/15 unassigned YES unset up up
Port-channel1 unassigned YES unset up up
Vlan1 unassigned YES unset up up
sw1-3# show spanning-tree br
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address cc00.00f8.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8192
Address cc00.00f8.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/0 128.1 128 19 FWD 0 8192 cc00.00f8.0000 128.1
FastEthernet0/1 128.2 128 19 FWD 0 8192 cc00.00f8.0000 128.2
FastEthernet0/2 128.3 128 19 FWD 0 8192 cc00.00f8.0000 128.3
FastEthernet0/3 128.4 128 19 FWD 0 8192 cc00.00f8.0000 128.4
Port-channel1 129.65 128 12 FWD 0 8192 cc00.00f8.0000 129.65
2.w2-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw2-3(config)#in ra f0/14 -15
sw2-3(config-if-range)#channel-group 1 mode on
Creating a port-channel interface Port-channel1
sw2-3(config-if-range)#no sh
sw2-3(config-if-range)#exit
sw2-3(config)#exit
sw2-3#show ip in br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset up up
FastEthernet0/14 unassigned YES unset up up
FastEthernet0/15 unassigned YES unset up up
Port-channel1 unassigned YES unset up up
Vlan1 unassigned YES unset up up
sw2-3#show spanning-tree br
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address cc00.00f8.0000
Cost 12
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 16384
Address cc00.088c.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/0 128.1 128 19 FWD 12 16384 cc00.088c.0000 128.1
FastEthernet0/1 128.2 128 19 FWD 12 16384 cc00.088c.0000 128.2
FastEthernet0/2 128.3 128 19 FWD 12 16384 cc00.088c.0000 128.3
FastEthernet0/3 128.4 128 19 FWD 12 16384 cc00.088c.0000 128.4
Port-channel1 129.65 128 12 FWD 0 8192 cc00.00f8.0000 129.65
分析:和这一次显示也是不同的,F0/14和F0/15 合并成一个以太网端口。进行数据转发。有效地防止了数据环路。
目标6.
在SWITCH1、SWITCH2、ROUTER1上配置RIP路由协议
1.R1(config)#router rip
R1(config-router)#network 10.1.1.0
R1(config-router)#network 10.1.2.0
R1(config-router)#network 202.16.2.0
R1(config-router)#exit
2. sw1-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw1-3(config)#interface vlan 2
sw1-3(config-if)#ip add 192.168.2.254 255.255.255.0
sw1-3(config-if)#no sh
sw1-3(config-if)#exit
sw1-3(config)#interface vlan 3
sw1-3(config-if)#ip add 192.168.3.254 255.255.255.0
sw1-3(config-if)#no sh
sw1-3(config-if)#exit
sw1-3(config)#interface vlan 4
sw1-3(config-if)#ip add 192.168.4.254 255.255.255.0
sw1-3(config-if)#no sh
sw1-3(config-if)#exit
sw1-3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, Vlan4
C 192.168.2.0/24 is directly connected, Vlan2
C 192.168.3.0/24 is directly connected, Vlan3
sw1-3#
3. sw1-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw1-3(config)#interface f0/0
sw1-3(config-if)#no switchport
sw1-3(config-if)#ip add 10.1.1.3 255.255.255.0
sw1-3(config-if)#no sh
sw1-3(config-if)#exit
sw1-3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, Vlan4
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Vlan2
C 192.168.3.0/24 is directly connected, Vlan3
sw1-3#show ip in br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.1.3 YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset up up
FastEthernet0/14 unassigned YES unset up up
FastEthernet0/15 unassigned YES unset up up
Port-channel1 unassigned YES unset up up
Vlan1 unassigned YES unset up up
Vlan2 192.168.2.254 YES manual up up
Vlan3 192.168.3.254 YES manual up up
Vlan4 192.168.4.254 YES manual up up
4. sw2-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw2-3(config)#interface vlan 2
sw2-3(config-if)#ip add 192.168.2.253 255.255.255.0
sw2-3(config-if)#no sh
sw2-3(config-if)#exit
sw2-3(config)#in
sw2-3(config)#interface vlan 3
sw2-3(config-if)#ip add 192.168.3.253 255.255.255.0
sw2-3(config-if)#no sh
sw2-3(config-if)#exit
sw2-3(config)#interface vlan 4
sw2-3(config-if)#ip add 192.168.4.253 255.255.255.0
sw2-3(config-if)#no sh
sw2-3(config-if)#exit
sw2-3(config)#exit
sw2-3#show ip in br
nterface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset up up
FastEthernet0/14 unassigned YES unset up up
FastEthernet0/15 unassigned YES unset up up
Port-channel1 unassigned YES unset up up
Vlan1 unassigned YES unset up up
Vlan2 192.168.2.253 YES manual up up
Vlan3 192.168.3.253 YES manual up up
Vlan4 192.168.4.253 YES manual up up
5. sw2-3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw2-3(config)#interface f0/0
sw2-3(config-if)#no switchport
sw2-3(config-if)#ip add 10.1.2.2 255.255.255.0
sw2-3(config-if)#no sh
sw2-3(config-if)#exit
sw2-3(config)#exit
sw2-3#show ip in br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.2.2 YES manual up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset up up
Vlan2 192.168.2.253 YES manual up up
Vlan3 192.168.3.253 YES manual up up
Vlan4 192.168.4.253 YES manual up up
6. sw2-3# conf t
sw2-3(config)#router rip
sw2-3(config-router)#network 192.168.2.0
sw2-3(config-router)#network 192.168.3.0
sw2-3(config-router)#network 192.168.4.0
sw2-3(config-router)#network 10.1.2.0
sw2-3(config-router)#exit
sw2-3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 202.16.2.0/24 [120/1] via 10.1.2.1, 00:00:10, FastEthernet0/0
C 192.168.4.0/24 is directly connected, Vlan4
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, FastEthernet0/0
R 10.1.1.0 [120/1] via 10.1.2.1, 00:00:10, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Vlan2
C 192.168.3.0/24 is directly connected, Vlan3
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 202.16.2.0/24 is directly connected, Loopback0
R 192.168.4.0/24 [120/1] via 10.1.2.2, 00:00:07, Ethernet0/1
[120/1] via 10.1.1.3, 00:00:19, Ethernet0/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Ethernet0/1
C 10.1.1.0 is directly connected, Ethernet0/0
R 192.168.2.0/24 [120/1] via 10.1.2.2, 00:00:07, Ethernet0/1
[120/1] via 10.1.1.3, 00:00:19, Ethernet0/0
R 192.168.3.0/24 [120/1] via 10.1.2.2, 00:00:07, Ethernet0/1
[120/1] via 10.1.1.3, 00:00:19, Ethernet0/0
sw1-3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 202.16.2.0/24 [120/1] via 10.1.1.1, 00:00:21, FastEthernet0/0
C 192.168.4.0/24 is directly connected, Vlan4
10.0.0.0/24 is subnetted, 2 subnets
R 10.1.2.0 [120/1] via 10.1.1.1, 00:00:21, FastEthernet0/0
C 10.1.1.0 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Vlan2
C 192.168.3.0/24 is directly connected, Vlan3
分析:如上所示,所有的路由条目都已学到.
目标7:
.测试网络联通性:VLAN内PC连通性;VLAN间PC连通性;VLAN内PC与INTERNET连通性.
相同VLAN.
不同VLAN间.
内部PC和外网(Internet)的连通性测试结果.
测试成功.
本文出自 “michaelfung_专栏” 博客,转载请与作者联系!