本文共 16579 字,大约阅读时间需要 55 分钟。
3、用Packet Tracer5.0进行模拟实验 Switch(config)#enable secret xiaowu Switch(config)#line vty 0 15 Switch(config-line)#password xiaowu Switch(config)#line console 0 Switch(config-line)#password xiaowu Switch(config)#hostname SW1 SW1(config)#no ip domain-lookup SW1(config)#vtp domain xiaowu Domain name already set to xiaowu. SW1(config)#vtp mode client Setting device to VTP CLIENT mode. SW1(config)#vtp password xiaowu Setting device VLAN database password to xiaowu SW1(config-if)#switchport mode trunk %SYS-5-CONFIG_I: Configured from console by console ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/3, Fa0/4, Fa0/5 Fa0/6, Fa0/7, Fa0/8, Fa0/9 Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/15, Fa0/16, Fa0/17 Fa0/18, Fa0/19, Fa0/20, Fa0/21 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 4 enet 100004 1500 - - - - - 0 0 1002 enet 101002 1500 - - - - - 0 0 1003 enet 101003 1500 - - - - - 0 0 1004 enet 101004 1500 - - - - - 0 0 1005 enet 101005 1500 - - - - - 0 0 Enter configuration commands, one per line. End with CNTL/Z. SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 2 SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 3 SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 4 %SYS-5-CONFIG_I: Configured from console by console ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/11 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 4 enet 100004 1500 - - - - - 0 0 Building configuration... Switch(config)#hostname SW2 SW2(config)#enable password xiaowu SW2(config)#line vty 0 15 SW2(config-line)#password xiaowu SW2(config)#line console 0 SW2(config-line)#password xiaowu SW2(config)#no ip domain-lookup SW2(config)#vtp domain xiaowu Domain name already set to xiaowu. SW2(config)#vtp mode client Setting device to VTP CLIENT mode. SW2(config)#vtp password xiaowu Setting device VLAN database password to xiaowu SW2(config-if)#switchport mode trunk %SYS-5-CONFIG_I: Configured from console by console ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 5 enet 100005 1500 - - - - - 0 0 6 enet 100006 1500 - - - - - 0 0 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 5 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 6 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 7 %SYS-5-CONFIG_I: Configured from console by console ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/8, Fa0/9, Fa0/10, Fa0/11 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 5 enet 100005 1500 - - - - - 0 0 6 enet 100006 1500 - - - - - 0 0 7 enet 100007 1500 - - - - - 0 0 1002 enet 101002 1500 - - - - - 0 0 1003 enet 101003 1500 - - - - - 0 0 1004 enet 101004 1500 - - - - - 0 0 1005 enet 101005 1500 - - - - - 0 0 Building configuration... Switch(config)#enable secret xiaowu Switch(config)#line vty 0 15 Switch(config-line)#password xiaowu Switch(config)#line console 0 Switch(config-line)#password xiaowu Switch(config)#hostname 3SW1 3SW1(config)#vtp domain xiaowu Changing VTP domain name from NULL to xiaowu 3SW1(config)#vtp mode server Device mode already VTP SERVER. 3SW1(config)#vtp password xiaowu Setting device VLAN database password to xiaowu 3SW1(vlan)#vlan 2 name vlan2 3SW1(vlan)#vlan 3 name vlan3 3SW1(vlan)#vlan 4 name vlan4 3SW1(config-if)#switchport mode trunk 3SW1(config-if)#ip address 192.168.20.254 255.255.255.0 3SW1(config-if)#ip address 192.168.30.254 255.255.255.0 3SW1(config-if)#ip address 192.168.40.254 255.255.255.0 Enter configuration commands, one per line. End with CNTL/Z. domain Set the name of the VTP administrative domain. mode Configure VTP device mode password Set the password for the VTP administrative domain version Set the adminstrative domain to VTP version client Set the device to client mode. server Set the device to server mode. transparent Set the device to transparent mode. 3SW1(config-if)#no switchport 3SW1(config-if)#ip address 172.16.100.20 255.255.255.0 3SW1(config)#router ospf 100 3SW1(config-router)#network 172.16.100.0 0.0.0.255 area 10 3SW1(config-router)#network 192.168.20.0 0.0.0.255 area 10 3SW1(config-router)#network 192.168.30.0 0.0.0.255 area 10 3SW1(config-router)#network 192.168.40.0 0.0.0.255 area 10 Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 172.16.0.0/24 is subnetted, 7 subnets O 172.16.10.0 [110/129] via 172.16.100.10, 00:02:18, FastEthernet0/1 O 172.16.20.0 [110/129] via 172.16.100.10, 00:02:18, FastEthernet0/1 O 172.16.30.0 [110/65] via 172.16.100.10, 00:02:18, FastEthernet0/1 O 172.16.40.0 [110/65] via 172.16.100.10, 00:02:18, FastEthernet0/1 O 172.16.50.0 [110/193] via 172.16.100.10, 00:02:18, FastEthernet0/1 C 172.16.100.0 is directly connected, FastEthernet0/1 O 172.16.200.0 [110/130] via 172.16.100.10, 00:02:18, FastEthernet0/1 C 192.168.20.0/24 is directly connected, Vlan2 C 192.168.30.0/24 is directly connected, Vlan3 C 192.168.40.0/24 is directly connected, Vlan4 Switch(config)#hostname 3SW2 3SW2(config)#enable secret xiaowu 3SW2(config)#line vty 0 15 3SW2(config-line)#password xiaowu 3SW2(config)#line console 0 3SW2(config-line)#password xiaowu 3SW2(config)#vtp domain xiaowu Changing VTP domain name from NULL to xiaowu 3SW2(config)#vtp password xiaowu Setting device VLAN database password to xiaowu 3SW2(config)#vtp mode server Device mode already VTP SERVER. 3SW2(config-if)#switchport mode trunk % Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode. 3SW2(vlan)#vlan 5 name vlan5 3SW2(vlan)#vlan 6 name vlan6 3SW2(vlan)#vlan 7 name vlan7 3SW2(config-if)#ip address 192.168.50.254 255.255.255.0 3SW2(config-if)#ip address 192.168.60.254 255.255.255.0 3SW2(config-if)#ip address 192.168.70.254 255.255.255.0 %SYS-5-CONFIG_I: Configured from console by console 3SW2(config-if)#no switchport 3SW2(config-if)#ip address 172.16.200.20 255.255.255.0 3SW2(config)#router ospf 100 3SW2(config-router)#network 172.16.200.0 0.0.0.255 area 10 3SW2(config-router)#network 192.168.50.0 0.0.0.255 area 10 3SW2(config-router)#network 192.168.60.0 0.0.0.255 area 10 3SW2(config-router)#network 192.168.70.0 0.0.0.255 area 10 Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 172.16.0.0/24 is subnetted, 7 subnets O 172.16.10.0 [110/129] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 172.16.20.0 [110/65] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 172.16.30.0 [110/129] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 172.16.40.0 [110/193] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 172.16.50.0 [110/65] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 172.16.100.0 [110/130] via 172.16.200.10, 00:00:04, FastEthernet0/1 C 172.16.200.0 is directly connected, FastEthernet0/1 O 192.168.20.0/24 [110/131] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 192.168.30.0/24 [110/131] via 172.16.200.10, 00:00:04, FastEthernet0/1 O 192.168.40.0/24 [110/131] via 172.16.200.10, 00:00:04, FastEthernet0/1 C 192.168.50.0/24 is directly connected, Vlan5 C 192.168.60.0/24 is directly connected, Vlan6 C 192.168.70.0/24 is directly connected, Vlan7 Router(config)#hostname R1 R1(config-line)#password xiaowu R1(config)#line console 0 R1(config-line)#password xiaowu R1(config)#no ip domain-lookup R1(config-if)#ip address 172.16.10.10 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#ip address 172.16.20.10 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#ip address 172.16.30.10 255.255.255.0 R1(config-if)#clock rate 64000 R1(config)#router ospf 100 R1(config-router)#network 172.16.10.0 0.0.0.255 area 10 R1(config-router)#network 172.16.20.0 0.0.0.255 area 10 R1(config-router)#network 172.16.30.0 0.0.0.255 area 10 Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 172.16.0.0/24 is subnetted, 7 subnets C 172.16.10.0 is directly connected, Serial0/0/0 C 172.16.20.0 is directly connected, Serial0/1/0 C 172.16.30.0 is directly connected, Serial0/0/1 O 172.16.40.0 [110/128] via 172.16.30.20, 00:06:37, Serial0/0/1 O 172.16.50.0 [110/128] via 172.16.20.20, 00:08:06, Serial0/1/0 [110/128] via 172.16.10.20, 00:07:31, Serial0/0/0 O 172.16.100.0 [110/65] via 172.16.30.20, 00:00:32, Serial0/0/1 O 172.16.200.0 [110/65] via 172.16.20.20, 00:00:07, Serial0/1/0 Router(config)#hostname R2 R2(config)#enable secret xiaowu R2(config-line)#password xiaowu R2(config)#line console 0 R2(config-line)#password xiaowu R2(config)#no ip domain-lookup R2(config-if)#ip address 172.16.10.20 255.255.255.0 R2(config-if)#ip address 192.168.40.10 255.255.255.0 R2(config-if)#clock rate 64000 R2(config-if)#ip address 172.16.50.10 255.255.255.0 R2(config-if)#clock rate 64000 R2(config)#router ospf 100 R2(config-router)#network 172.16.10.0 0.0.0.255 area 10 R2(config-router)#network 172.16.40.0 0.0.0.255 area 10 R2(config-router)#network 172.16.50.0 0.0.0.255 area 10 Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 172.16.0.0/24 is subnetted, 7 subnets C 172.16.10.0 is directly connected, Serial0/0/0 O 172.16.20.0 [110/128] via 172.16.10.10, 00:52:31, Serial0/0/0 [110/128] via 172.16.50.20, 00:52:21, Serial0/0/1 O 172.16.30.0 [110/128] via 172.16.10.10, 00:52:31, Serial0/0/0 O 172.16.40.0 [110/192] via 172.16.10.10, 00:51:42, Serial0/0/0 C 172.16.50.0 is directly connected, Serial0/0/1 O 172.16.100.0 [110/129] via 172.16.10.10, 00:45:31, Serial0/0/0 O 172.16.200.0 [110/65] via 172.16.50.20, 00:45:07, Serial0/0/1 O 192.168.20.0/24 [110/130] via 172.16.10.10, 00:43:21, Serial0/0/0 O 192.168.30.0/24 [110/130] via 172.16.10.10, 00:43:21, Serial0/0/0 C 192.168.40.0/24 is directly connected, Serial0/1/0 O 192.168.50.0/24 [110/66] via 172.16.50.20, 00:38:37, Serial0/0/1 O 192.168.60.0/24 [110/66] via 172.16.50.20, 00:38:37, Serial0/0/1 O 192.168.70.0/24 [110/66] via 172.16.50.20, 00:38:37, Serial0/0/1 R3与R4的配置与R1和R2相似,这里就不在写出。 本文转自 Jhuster 51CTO博客,原文链接:http://blog.51cto.com/xwnet/115622,如需转载请自行联系原作者