实验配置: 1.配置接口地址(略) 2.并配置OSPF R1(config)#routerospf 1 R1(config-router)#net1.1.1.0 0.0.0.255 area 0 R1(config-router)#net12.1.1.0 0.0.0.255 area 1 R2(config)#routerospf 1 R2(config-router)#net12.1.1.0 0.0.0.255 area 1 R2(config-router)#net2.2.2.0 0.0.0.255 area 1 R2(config-router)#net23.1.1.0 0.0.0.255 area 2 R3(config)#routerospf 1 R3(config-router)#net23.1.1.0 0.0.0.255 area 2 R3(config-router)#net3.3.3.0 0.0.0.255 area 2 R3(config-router)#net34.1.1.0 0.0.0.255 area 3 R4(config)#routerospf 1 R4(config-router)#router-id4.4.4.4 R4(config-router)#net34.1.1.0 0.0.0.255 area 3 R4(config-router)#net4.4.4.4 0.0.0.255 area 3 R4(config-router)#net40.1.1.0 0.0.0.255 area 4 3.查看当前路由表 R1#showip ro os 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/2] via 12.1.1.2, 00:02:40,FastEthernet0/0 R4#showip ro os 4.配置虚链路—区域2的VL R1(config)#routerospf 1 R1(config-router)#area1 virtual-link 2.2.2.2 R2(config)#routerospf 1 R2(config-router)#area1 virtual-link 1.1.1.1 R1#show ip ospf nei NeighborID Pri State Dead Time Address Interface 2.2.2.2 0 FULL/ - - 12.1.1.2 OSPF_VL0 2.2.2.2 1 FULL/BDR 00:00:38 12.1.1.2 FastEthernet0/0 R1#show ip ro os 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/2] via 12.1.1.2, 00:00:36,FastEthernet0/0 3.0.0.0/32 is subnetted, 1 subnets OIA 3.3.3.3 [110/66] via 12.1.1.2,00:00:36, FastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnets OIA 23.1.1.0 [110/65] via 12.1.1.2,00:00:36, FastEthernet0/0 5.配置虚链路—区域3的VL R2(config)#routerospf 1 R2(config-router)#area2 virtual-link 3.3.3.3 R3(config)#routerospf 1 R3(config-router)#area2 virtual-link 2.2.2.2 R2#show ip ospf nei NeighborID Pri State Dead Time Address Interface 3.3.3.3 0 FULL/ - - 23.1.1.2 OSPF_VL1 1.1.1.1 0 FULL/ - - 12.1.1.1 OSPF_VL0 1.1.1.1 1 FULL/DR 00:00:32 12.1.1.1 FastEthernet0/0 3.3.3.3 0 FULL/ - 00:00:39 23.1.1.2 Serial1/1 R1#show ip ro os 34.0.0.0/24 is subnetted, 1 subnets OIA 34.1.1.0 [110/129] via 12.1.1.2,00:00:43, FastEthernet0/0 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/2] via 12.1.1.2, 00:03:08,FastEthernet0/0 3.0.0.0/32 is subnetted, 1 subnets OIA 3.3.3.3 [110/66] via 12.1.1.2,00:00:43, FastEthernet0/0 4.0.0.0/32 is subnetted, 1 subnets OIA 4.4.4.4 [110/130] via 12.1.1.2,00:00:43, FastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnets OIA 23.1.1.0 [110/65] via 12.1.1.2,00:00:43, FastEthernet0/0 6.配置虚链路—区域4的VL(方法一) R3(config)#routerospf 1 R3(config-router)#area3 virtual-link 4.4.4.4 R4(config)#routerospf 1 R4(config-router)#area3 virtual-link 3.3.3.3 R4#show ip os nei NeighborID Pri State Dead Time Address Interface 3.3.3.3 0 FULL/ - - 34.1.1.1 OSPF_VL0 3.3.3.3 0 FULL/ - 00:00:37 34.1.1.1 Serial1/0 R4#show ip ro os 1.0.0.0/32 is subnetted, 1 subnets O 1.1.1.1 [110/130] via 34.1.1.1,00:01:32, Serial1/0 2.0.0.0/32 is subnetted, 1 subnets OIA 2.2.2.2 [110/129] via 34.1.1.1,00:01:32, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets OIA 3.3.3.3 [110/65] via 34.1.1.1,00:01:32, Serial1/0 23.0.0.0/24 is subnetted, 1 subnets OIA 23.1.1.0 [110/128] via 34.1.1.1,00:01:32, Serial1/0 12.0.0.0/8 is variably subnetted, 2subnets, 2 masks OIA 12.1.1.0/24 [110/129] via 34.1.1.1,00:01:32, Serial1/0 7.配置虚链路—区域4的VL(方法二) R1(config)#intertunnel 0 R1(config-if)#ipadd 14.1.1.1 255.255.255.0 R1(config-if)#tunnelsource 1.1.1.1 R1(config-if)#tunneldestination 34.1.1.2 R4(config)#interfacetunnel 0 R4(config-if)#ipadd 14.1.1.2 255.255.255.0 R4(config-if)#tunnelsource 34.1.1.2 R4(config-if)#tunneldestination 1.1.1.1 R1(config)#routerospf 1 R1(config-router)#net14.1.1.0 0.0.0.255 area 0 R4(config)#routerospf 1 R4(config-router)#net14.1.1.0 0.0.0.255 area 0 R1# *Nov25 09:26:08.003: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Tunnel0 from LOADINGto FULL, Loading Done R1# *Nov25 09:26:56.815: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Tunnel0 from FULL toDOWN, Neighbor Down: Dead timer expired R1# *Nov25 09:27:38.127: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Tunnel0 from LOADINGto FULL, Loading Done R1# *Nov25 09:28:26.711: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Tunnel0 from FULL toDOWN, Neighbor Down: Dead timer expired R4# *Nov25 09:28:58.335: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Tunnel0 from LOADINGto FULL, Loading Done R4# *Nov25 09:29:16.095: %TUN-5-RECURDOWN: Tunnel0 temporarily disabled due torecursiverouting *Nov25 09:29:17.091: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Tunnel0 from FULL toDOWN, Neighbor Down: Interface down or detached *Nov25 09:29:17.099: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0,changed state to down R4(config)#ip route 12.1.1.1255.255.255.255 s1/0 R1#showip ospf nei NeighborID Pri State Dead Time Address Interface 4.4.4.4 0 FULL/ - 00:00:37 14.1.1.2 Tunnel0 2.2.2.2 0 FULL/ - - 12.1.1.2 OSPF_VL0 2.2.2.2 1 FULL/BDR 00:00:36 12.1.1.2 FastEthernet0/0 R1#ping 4.4.4.4 source1.1.1.1 Typeescape sequence to abort. Sending5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: Packetsent with a source address of 1.1.1.1 !!!!! Successrate is 100 percent (5/5), round-trip min/avg/max = 220/294/324 ms |
|