ospf实验

更新时间:2024-01-07 15:37:02 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

CCNP Lab Manual

Lab 1. Configuring Basic Multi Area OSPF and Area Summary

实验目的:

1、掌握多区域的OSPF配置方法。 2、区别不同区域的路由。

3、掌握OSPF的路由汇总配置。 4、掌握OSPF的基本配置命令。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、在R1上进行area 1区域OSPF配置。

R1(config)#router ospf 1 R1(config-router)#network 10.1.2.0 0.0.0.255 area 1 R1(config-router)#network 10.1.1.0 0.0.0.255 area 1 R1(config-router)#network 192.168.1.0 0.0.0.3 area 1 R1(config-router)#exit 3、在R2上进行area1与area2的区域边界路由器(ABR)的OSPF配置。

R2(config)#router ospf 1 R2(config-router)#network 192.168.1.0 0.0.0.3 area 1 R2(config-router)#network 192.168.1.4 0.0.0.3 area 0 R2(config)#exit 4、参照R1与R2的配置,完成R3与R4的配置。 5、在任一路由器上,查看OSPF邻居表。

R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.1.9 1 FULL/ - 00:00:39 192.168.1.6 Serial1/1 10.1.2.1 1 FULL/ - 00:00:37 192.168.1.1 Serial1/0 R2# 6、查看R1的路由表,观察其它区域路由。

R1#show ip route 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 ………… Gateway of last resort is not set 172.16.0.0/32 is subnetted, 2 subnets O IA 172.16.1.1 [110/193] via 192.168.1.2, 00:02:23, Serial1/1 O IA 172.16.2.1 [110/193] via 192.168.1.2, 00:02:23, Serial1/1 10.0.0.0/24 is subnetted, 2 subnets C 10.1.2.0 is directly connected, Loopback1 C 10.1.1.0 is directly connected, Loopback0 192.168.1.0/30 is subnetted, 3 subnets O IA 192.168.1.8 [110/192] via 192.168.1.2, 00:02:58, Serial1/1 C 192.168.1.0 is directly connected, Serial1/1 O IA 192.168.1.4 [110/128] via 192.168.1.2, 00:05:06, Serial1/1 R1# 7、查看R1的OSPF链路状态数据库。

R1#show ip ospf database OSPF Router with ID (10.1.2.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 10.1.2.1 10.1.2.1 492 0x80000004 0x00C83F 4 192.168.1.5 192.168.1.5 486 0x80000003 0x002BB5 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.16.1.1 192.168.1.5 315 0x80000001 0x00CCC0 172.16.2.1 192.168.1.5 315 0x80000001 0x00C1CA 192.168.1.4 192.168.1.5 479 0x80000001 0x00E33E 192.168.1.8 192.168.1.5 350 0x80000001 0x003E9F R1# 8、在R1上使用ping命令确认路由的有效性。

R1#ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 216/240/288 ms R1# 9、查看R4的路由表和ospf的链路状态数据库。

R4#show ip route 172.16.0.0/24 is subnetted, 2 subnets C 172.16.1.0 is directly connected, Loopback0 C 172.16.2.0 is directly connected, Loopback1 10.0.0.0/24 is subnetted, 2 subnets O IA 10.1.2.0 [110/193] via 192.168.1.9, 00:15:14, Serial1/0 O IA 10.1.1.0 [110/193] via 192.168.1.9, 00:15:14, Serial1/0 192.168.1.0/30 is subnetted, 3 subnets C 192.168.1.8 is directly connected, Serial1/0 O IA 192.168.1.0 [110/192] via 192.168.1.9, 00:15:14, Serial1/0 O IA 192.168.1.4 [110/128] via 192.168.1.9, 00:15:14, Serial1/0 R4# R4#show ip ospf database OSPF Router with ID (172.16.2.1) (Process ID 1) Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 172.16.2.1 172.16.2.1 1223 0x80000004 0x00B871 4 192.168.1.9 192.168.1.9 1224 0x80000002 0x00EA2E 2 Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 10.1.1.0 192.168.1.9 2 0x80000001 0x00B586 10.1.2.0 192.168.1.9 2 0x80000001 0x00AA90 192.168.1.0 192.168.1.9 1265 0x80000001 0x00766B 192.168.1.4 192.168.1.9 1265 0x80000001 0x00CB52 R4# 可以发现R4路由器学习到area1区域的具体路由,其实,可以通过在R2(ABR)上可以对area1的路由进行汇总,通过汇总可以有效的减少路由表的大小,限制LSA扩散。

10、配置R2的区域汇总。

R2(config)#router ospf 1 R2(config-router)#area 1 range 10.1.0.0 255.255.0.0 R2(config-router)#exit R2(config)#exit 11、再次查看R4的路由表和数据库。

R4#show ip route 172.16.0.0/24 is subnetted, 2 subnets C 172.16.1.0 is directly connected, Loopback0 C 172.16.2.0 is directly connected, Loopback1 10.0.0.0/16 is subnetted, 1 subnets O IA 10.1.0.0 [110/193] via 192.168.1.9, 00:00:32, Serial1/0 192.168.1.0/30 is subnetted, 3 subnets C 192.168.1.8 is directly connected, Serial1/0 O IA 192.168.1.0 [110/192] via 192.168.1.9, 00:18:36, Serial1/0 O IA 192.168.1.4 [110/128] via 192.168.1.9, 00:18:36, Serial1/0 R4# R4#show ip ospf database OSPF Router with ID (172.16.2.1) (Process ID 1) Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 172.16.2.1 172.16.2.1 6 0x80000005 0x00B672 4 192.168.1.9 192.168.1.9 13 0x80000004 0x00E630 2 Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 10.1.0.0 192.168.1.9 29 0x80000001 0x00C07C 192.168.1.0 192.168.1.9 1325 0x80000001 0x00766B 192.168.1.4 192.168.1.9 1325 0x80000001 0x00CB52 R4# 12、实验完成。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 2. Configuring OSPF in NBMA

实验目的:

1、掌握NBMA网络中OSPF的邻居关系手工和自动建立的两种配置方法。

2、掌握指定OSPF的接口优先级和通过修改OSPF的默认接口网络类型避免DR的选举出错。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、其中R1、R2和R3的配置如下:

R1(config)#interface loopback 0 R1(config-if)#ip address 172.16.1.1 255.255.255.0 R1(config-if)#ip ospf network point-to-point R1(config-if)#exit R1(config)# R1(config)#interface serial 1/2 R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#encapsulation frame-relay R1(config-if)#no frame-relay inverse-arp R1(config-if)#frame-relay map ip 192.168.1.2 102 broadcast R1(config-if)#frame-relay map ip 192.168.1.3 103 broadcast R1(config-if)#exit R1(config)# R1(config)#router ospf 1 R1(config-router)#network 192.168.1.0 0.0.0.255 area 0 R1(config-router)#network 172.16.1.0 0.0.0.255 area 0 R1(config-router)#exit R1(config)# R2(config)#interface loopback 0 R2(config-if)#ip address 172.16.3.1 255.255.255.0 R2(config-if)#ip ospf network point-to-point R2(config-if)#exit R2(config)# R2(config)#interface serial 1/2 R2(config-if)#encapsulation frame-relay R2(config-if)#ip address 192.168.1.2 255.255.255.0 R2(config-if)#no frame-relay inverse-arp R2(config-if)#frame-relay map ip 192.168.1.1 201 broadcast R2(config-if)#no shutdown R2(config-if)#exit R2(config)# R2(config)#router ospf 1 R2(config-router)#network 172.16.3.0 0.0.0.255 area 0 R2(config-router)#network 192.168.1.0 0.0.0.255 area 0 R2(config-router)#exit R2(config)# R3(config)#interface loopback 0 R3(config-if)#ip address 172.16.4.1 255.255.255.0 R3(config-if)#ip ospf network point-to-point R3(config-if)#exit R3(config)# R3(config)#interface serial 1/2 R3(config-if)#ip address 192.168.1.3 255.255.255.0 R3(config-if)#encapsulation frame-relay R3(config-if)#no frame-relay inverse-arp R3(config-if)#frame-relay map ip 192.168.1.1 301 broadcast R3(config-if)#no shutdown R3(config-if)#exit R3(config)# R3(config)#router ospf 1 R3(config-router)#network 172.16.4.0 0.0.0.255 area 0 R3(config-router)#network 192.168.1.0 0.0.0.255 area 0 R3(config-router)#exit R3(config)# 3、在配置完OSPF协议后,查看R1、R2或R3路由器OSPF的邻居表,会发现OSPF的邻居关系并没有被建立:

R1#show ip ospf neighbor R1# 4、查看R1的Seiral 1/2接口OSPF信息:

R1#show ip ospf interface serial 1/2 Serial1/2 is up, line protocol is up Internet Address 192.168.1.1/24, Area 0 Process ID 1, Router ID 172.16.1.1, Network Type NON_BROADCAST, Cost: 64 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 172.16.1.1, Interface address 192.168.1.1 No backup designated router on this network Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 oob-resync timeout 120 Hello due in 00:00:15 Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) R1# 5、通过分析可以看出,影响OSPF协议不能自己形成邻居关系的主要原因是,OSPF

主观 认为NBMA的广播不支持广播和组播,因此不会主动的向外发送OSPF的HELLO数据包。

6、手工配置R1路由器的OSPF邻居关系:

R1(config)#router ospf 1 R1(config-router)#neighbor 192.168.1.2 R1(config-router)#neighbor 192.168.1.3 R2(config)#router ospf 1 R2(config-router)#neighbor 192.168.1.1 R3(config)#router ospf 1 R3(config-router)#neighbor 192.168.1.1 7、当配置完成后,系统IOS会提示如下信息:

*Jun 18 15:36:16.743: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.4.1 on Serial1/2 from LOADING to FULL, Loading Done *Jun 18 15:36:16.747: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.3.1 on Serial1/2 from LOADING to FULL, Loading Don 8、查看R1的邻居表:

R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DROTHER 00:01:31 192.168.1.2 Serial1/2 172.16.4.1 1 FULL/DR 00:01:57 192.168.1.3 Serial1/2 R1# 9、除了手工的配置方法之外,其实也可能修改OSPF的接口类型,以便路由器能够自动的创建OSPF的邻居关系,配置比较简单,也不容易出错。首先,将之前配置的neighbor的命令给no掉。然后再做配置如下:

R1(config)#interface serial 1/2 R1(config-if)#ip ospf network broadcast R1(config-if)#exit 10、查看接口信息:

R1#show ip ospf interface serial 1/2 Serial1/2 is up, line protocol is up Internet Address 192.168.1.1/24, Area 0 Process ID 1, Router ID 172.16.1.1, Network Type BROADCAST, Cost: 64 Transmit Delay is 1 sec, State DR, Priority 1 ………… R1# 11、查看R1、R2和R3路由器的OSPF邻居表:

R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 1 FULL/DROTHER 00:00:32 192.168.1.2 Serial1/2 172.16.4.1 1 FULL/DR 00:00:33 192.168.1.3 Serial1/2 R1# R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.1.1 1 FULL/BDR 00:00:30 192.168.1.1 Serial1/2 R2# R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.1.1 1 FULL/BDR 00:00:39 192.168.1.1 Serial1/2 R3# 12、仔细观察OSPF的邻居表,会发现如下问题:

R1的OSPF邻居表,指出172.16.4.1为DR,172.16.3.1为DROTHER,而自己为BDR。

R2的OSPF邻居表,指出172.16.1.1为BDR,而自己为DR。 R3的OSPF邻居表,指出172.16.1.1为BDR,而自己为DR。 通过如下图示,可以更清楚看出DR和BDR的关系:

出现此问题的原因是因为Frame-Relay的网络拓扑非全网状。R3在与R1在进行邻居创建时,R3并不知道网络中还有R2的存在。同时,R2与R1进行创建时,也不知晓R3的存在。此时,在网络中运行的其实是两个不同的OSPF的自治系统。

13、由于上述的问题,还会导致其它原因,比如:R3路由器的172.16.4.0/24的子网出错,R3会向R1通告LSA,R1在收到此LSA后,R1并不会向R3转发,

其原因是,R1认为R3是由DR来完成通告的。其默守OSPF的多路访问网络的更新规则。另外:如果R1的172.16.1.0/24网络出错,R1默认会向DR通告,即向R3通告,而不会向R2通告,因为R1作为BDR,只需要将LSA通告给DR即可,而其它的DROTHER的通告是由DR完成的,而做为DR的R3在收到R1发送的LSA后,R3实际上并没有向R2通告,这是因为R3并不知道网络中还有R2的存在。

14、要解决这样的问题,必须手工的指定网络的DR的角色。由于OSPF的优先级会影响DR的选举,优先级为0的OSPF的路由永远不能成为DR,优先级越高越容易成为DR的原则,默认OSPF的优先级为1,因此将R2与R3的优先级直接修改为0,配置如下:

R2(config)#interface serial 1/2 R2(config-if)#ip ospf priority 0 R2(config-if)#exit R2(config)# R3(config)#interface serial 1/2 R3(config-if)#ip ospf priority 0 R3(config-if)#exit 15、查看所有路由器的邻居表,从邻居表可以看出OSPF各台路由器,已经拥有合适的角色:

R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.3.1 0 FULL/DROTHER 00:00:38 192.168.1.2 Serial1/2 172.16.4.1 0 FULL/DROTHER 00:00:39 192.168.1.3 Serial1/2 R1# R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.1.1 1 FULL/DR 00:00:31 192.168.1.1 Serial1/2 R2# R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.1.1 1 FULL/DR 00:00:38 192.168.1.1 Serial1/2 R3# 16、其实也可以修改OSPF的接口类型,以避免DR和BDR的选举,从而减少DR选举出错的可能性。比如,将R1的接口网络类型修改为P2MP(点到多点),而将R2和R3的接口网络类型修改为P2P(点对点)。因为在OSPF的各种网络类型中:P2MP和P2P都是不需要选举DR和BDR的。

17、另外,在配置接口网络类型时,还注意接口的HELLO死亡间隔时间。因为不同的类型的网络其时间是不一致的。不一致的HELLO的时间间隔,会导致OSPF的邻居关系无法创建。

18、下面给出一张OSPF所支持的网络类型和DR选举,以及HELLO时间间隔的表,以供参阅。具体配置不再列出。

OSPF ModeBroadcastNonbroadcast (NBMA)Point-to-multipointPoint-to-multipoint nonbroadcastPoint-to-pointNBMA Preferred TopologyFull or partial meshFull or partial meshPartial-mesh or starpartial-mesh or starPartial-mesh or star, using subinterfaceSubnet AddressSameHello Timer10 secAdjacencyAutomatic, DR/BDR electedManual configuration, DR/BDR electedAutomatic, no DR/BDRManual configuration, no/DR/BDRAutomatic, no DR/BDRRFC or CiscoCiscoSame30 secRFCSame30 SecRFCSameDifferent for Each Subinterface30 secCisco10 secCisco 19、实验完成。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 3. Configuring OSPF Authentication

实验目的:

1、掌握OSPF接口认证及区域认证的配置方法。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、配置OSPF协议,并使用相关命令确认其正常工作。 3、查看R1和R2的路由表。

R1#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 2 subnets O IA 172.16.1.0 [110/193] via 192.168.1.2, 00:01:02, Serial1/1 O IA 172.16.2.0 [110/193] via 192.168.1.2, 00:01:02, Serial1/1 10.0.0.0/24 is subnetted, 2 subnets C 10.1.2.0 is directly connected, Loopback0 C 10.1.1.0 is directly connected, Loopback1 192.168.1.0/30 is subnetted, 3 subnets O IA 192.168.1.8 [110/192] via 192.168.1.2, 00:01:12, Serial1/1 C 192.168.1.0 is directly connected, Serial1/1 O IA 192.168.1.4 [110/128] via 192.168.1.2, 00:05:47, Serial1/1 R1# R2#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 2 subnets O IA 172.16.1.0 [110/129] via 192.168.1.6, 00:09:16, Serial1/1 O IA 172.16.2.0 [110/129] via 192.168.1.6, 00:09:16, Serial1/1 10.0.0.0/24 is subnetted, 2 subnets O 10.1.2.0 [110/65] via 192.168.1.1, 00:14:00, Serial1/0 O 10.1.1.0 [110/65] via 192.168.1.1, 00:14:00, Serial1/0 192.168.1.0/30 is subnetted, 3 subnets O IA 192.168.1.8 [110/128] via 192.168.1.6, 00:09:26, Serial1/1 C 192.168.1.0 is directly connected, Serial1/0 C 192.168.1.4 is directly connected, Serial1/1 R2# 4、在R1上启用OSPF的明文认证,配置如下:

R1(config)#interface serial 1/1 R1(config-if)#ip ospf authentication R1(config-if)#ip ospf authentication-key cisco R1(config-if)#exit 5、配置完成后,打开debug观察系统提示系统。

00:30:33: OSPF: 192.168.1.5 address 192.168.1.2 on Serial1/1 is dead 00:30:33: OSPF: 192.168.1.5 address 192.168.1.2 on Serial1/1 is dead, state DOWN 00:30:33: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.5 on Serial1/1 from FULL to DOWN, Neighbor Down: Dead timer expired 00:30:35: OSPF: Rcv pkt from 192.168.1.2, Serial1/1 : Mismatch Authentication type. Input packet specified type 0, we use type 1 00:54:45: OSPF: Rcv pkt from 192.168.1.2, Serial1/1 : Mismatch Authentication Key - Clear Text 6、在R2上启用OSPF的认证:

R2(config)#interface s1/1 R2(config-if)#ip ospf authentication R2(config-if)#ip ospf authentication-key cisco R2(config-if)#exit R2(config)#exit 7、查看R1的debug信息和路由表信息:

00:54:55: OSPF: 2 Way Communication to 192.168.1.5 on Serial1/1, state 2WAY 00:54:55: OSPF: Send DBD to 192.168.1.5 on Serial1/1 seq 0x2154 opt 0x42 flag 0x7 len 32 00:54:55: OSPF: Rcv DBD from 192.168.1.5 on Serial1/1 seq 0x182 opt 0x42 flag 0x7 len 32 mtu 1500 state EXSTART 00:54:55: OSPF: NBR Negotiation Done. We are the SLAVE 00:54:55: OSPF: Send DBD to 192.168.1.5 on Serial1/1 seq 0x182 opt 0x42 flag 0x2 len 152 00:54:55: OSPF: Rcv DBD from 192.168.1.5 on Serial1/1 seq 0x183 opt 0x42 flag 0x3 len 152 mtu 1500 state EXCHANGE 00:54:55: OSPF: Send DBD to 192.168.1.5 on Serial1/1 seq 0x183 opt 0x42 flag 0x0 len 32 00:54:55: OSPF: Database request to 192.168.1.5 00:54:55: OSPF: sent LS REQ packet to 192.168.1.2, length 60 00:54:55: OSPF: Rcv DBD from 192.168.1.5 on Serial1/1 seq 0x184 opt 0x42 flag 0x1 len 32 mtu 1500 state EXCHANGE 00:54:55: OSPF: Exchange Done with 192.168.1.5 on Serial1/1 00:54:55: OSPF: Send DBD to 192.168.1.5 on Serial1/1 seq 0x184 opt 0x42 flag R1#0x0 len 32 00:54:55: OSPF: Synchronized with 192.168.1.5 on Serial1/1, state FULL 00:54:55: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.5 on Serial1/1 from LOADING to FULL, Loading Done 00:54:56: OSPF: Build router LSA for area 1, router ID 10.1.2.1, seq 0x8000000C R1#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 2 subnets O IA 172.16.1.0 [110/193] via 192.168.1.2, 00:01:53, Serial1/1 O IA 172.16.2.0 [110/193] via 192.168.1.2, 00:01:53, Serial1/1 10.0.0.0/24 is subnetted, 2 subnets

10.0.0.0/24 is subnetted, 2 subnets C 10.1.2.0 is directly connected, Loopback1 C 10.1.1.0 is directly connected, Loopback0 192.168.1.0/30 is subnetted, 2 subnets C 1929999.168.1.0 is directly connected, Serial1/1 O IA 192.168.1.4 [110/128] via 192.168.1.2, 00:16:54, Serial1/1 R1# 通过上述比较,可以很清楚的理解E1与E2的路由度量计算方法。 9、查看R1路由器的链路状态数据库。

R1#show ip ospf database OSPF Router with ID (10.1.2.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 10.1.2.1 10.1.2.1 1413 0x80000009 0x0003FD 4 192.168.1.5 192.168.1.5 1413 0x80000006 0x0025B8 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 192.168.1.4 192.168.1.5 1437 0x80000001 0x00E33E Summary ASB Link States (Area 1) Link ID ADV Router Age Seq# Checksum 192.168.1.6 192.168.1.5 1061 0x80000001 0x00D348 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 172.16.1.0 192.168.1.6 3603 0x80000003 0x00CF35 0 172.16.2.0 192.168.1.6 3603 0x80000003 0x00C43F 0 172.16.3.0 192.168.1.6 3603 0x80000003 0x00B949 0 R1# 10、之前的R1的路由表中,显示的外网路由为3条。为了减少路由表的大小,可以在R3上进行外网的路由汇总,具体配置如下:

R3(config)#router ospf 1 R3(config-router)#summary-address 172.16.0.0 255.255.0.0 R3(config-router)#exit R3(config)#exit 11、查看R1路由表,确认汇总成功。

R1#show ip route Gateway of last resort is not set O E1 172.16.0.0/16 [110/328] via 192.168.1.2, 00:01:29, Serial1/1 10.0.0.0/24 is subnetted, 2 subnets C 10.1.2.0 is directly connected, Loopback1 C 10.1.1.0 is directly connected, Loopback0 192.168.1.0/30 is subnetted, 2 subnets C 192.168.1.0 is directly connected, Serial1/1 O IA 192.168.1.4 [110/128] via 192.168.1.2, 00:24:56, Serial1/1 R1# 12、完成实验。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 5. Configuring OSPF Default Route With Metric

实验目的:

1、掌握如何使用管理距离控制OSPF的默认路由选择。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、R1与R4路由器的s1/2接口帧中继配置。

R1(config)#interface serial 1/2 R1(config-if)#encapsulation frame-relay R1(config-if)#ip ospf network broadcast R1(config-if)#ip address 172.16.1.1 255.255.255.252 R1(config)#exit R4(config)#interface serial 1/2 R4(config-if)#encapsulation frame-relay R4(config-if)#ip ospf network broadcast R4(config-if)#ip address 172.16.1.2 255.255.255.252 R4(config)#exit 3、按实验拓扑配置各路由器的OSPF协议,注意接口所在不同网络。 4、查看R2的路由表。

R2#show ip route Gateway of last resort is not set 192.168.1.0/30 is subnetted, 2 subnets C 192.168.1.0 is directly connected, Serial1/0 C 192.168.1.4 is directly connected, Serial1/1 R2# R2#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) R2# 5、为了能够保证网络通讯,在R1和R3上配置不同协议的路由重发布和OSPF的默认路由。

R1(config)#router rip R1(config-router)#redistribute ospf 1 metric 10 R1(config-router)#exit R1(config)# R1(config)#router ospf 1 R1(config-router)# default-information originate always R1(config-router)#exit R1(config)#exit R3(config)#router rip R3(config-router)#redistribute ospf 1 metric 10 R3(config-router)#exit R3(config)# R3(config)#router ospf 1 R3(config-router)# default-information originate always R3(config-router)#exit R3(config)#exit R3# 6、再次查看R2路由器路由表并使用ping命令确认路由。

R2#show ip route Gateway of last resort is not set O E2 10.0.0.0/8 [110/20] via 192.168.1.1, 00:01:19, Serial1/0 192.168.1.0/30 is subnetted, 2 subnets C 192.168.1.0 is directly connected, Serial1/0 C 192.168.1.4 is directly connected, Serial1/1 O*E2 0.0.0.0/0 [110/1] via 192.168.1.6, 00:01:19, Serial1/1 [110/1] via 192.168.1.1, 00:01:19, Serial1/0 R2# R2#ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/82/120 ms R2# 7、在上面的实验中,R2选择到达非OSPF网络的路由下一跳是R1和R3,并且是均衡负载。而在本实验中,从R1到达非OSPF网络是使用帧中继的网络。从R3到达非OSPF网络是使用100Mbps的快速以太网。因此选择从R3到达外网远比从R1到达非OSPF网络要好。也即是最佳最路由。

8、为了解决这个问题,在通告默认路由时可以采用定制度量的参数,来影响路由器选择最佳路由。可以在R1和R3上进行如下配置。

R1(config)#router ospf 1 R1(config-router)#default-information originate always metric 100

http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 7. Configuring OSPF Totally Stub Area

实验目的:

1、掌握类型1、2、3、4和5的LSA的作用。

2、掌握OSPF完全末节(Totally Stub)区域特点。 3、掌握OSPF Totally Stub区域配置方法。

4、掌握OSPF Stub区域配置要求: Stub区域没有ASBR,它至少拥有一个ABR。 5、注意:完全末节区域(NSSA)为CISCO私有的。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、配置OSPF与RIP的协议,并使用ping和show ip route命令进行确认协议正常工作。

3、为了完成实验需要在R3上配置重发布,配置如下:

R3(config)#router ospf 1 R3(config-router)#redistribute rip subnets metric 200 R3(config-router)#exit R3(config)# R3(config)#router rip R3(config-router)#redistribute ospf 1 metric 10 R3(config-router)#exit R3(config)#exit 4、首先将area 1配置成ospf stub area区域。 5、查看R1路由器的路由表和数据链路状态数据库。

R1#show ip ospf database OSPF Router with ID (172.16.1.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.1.1 172.16.1.1 155 0x80000005 0x0055C7 3 172.16.255.5 172.16.255.5 155 0x80000005 0x004F97 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 0.0.0.0 172.16.255.5 168 0x80000001 0x00017B 172.16.2.0 172.16.255.5 168 0x80000002 0x0068D3 172.16.255.4 172.16.255.5 168 0x80000002 0x00B7C6 172.16.255.8 172.16.255.5 168 0x80000002 0x001228 R1# R1#show ip route Gateway of last resort is 172.16.255.2 to network 0.0.0.0 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:04:19, Serial1/1 O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:04:19, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 O IA 172.16.2.0/24 [110/193] via 172.16.255.2, 00:04:19, Serial1/1 O*IA 0.0.0.0/0 [110/65] via 172.16.255.2, 00:04:19, Serial1/1 R1# 6、通过stub的区域特性配置,已经可以有效的减少路由表的大小。但是此时R1的路由表并不是最精简的。可以使用totally stub区域特性来进一步的减少路由表尺寸。配置如下:

R2(config)#router ospf 1 R2(config-router)#area 1 stub no-summary R2(config-router)#exit R2(config)#exit R2# R1(config)#router ospf 1 R1(config-router)#area 1 stub R1(config-router)#exit R1(config)#exit R1# 7、再次查看R1的路由表。

R1#show ip route 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, 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 172.16.255.2 to network 0.0.0.0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 O*IA 0.0.0.0/0 [110/65] via 172.16.255.2, 00:34:32, Serial1/1 R1# 8、查看R1的链路状态数据库。现在R1的链路状态数据库,仅有类型1和经过汇总的类型3的LSA。而其它的OSPF区域LSA被禁止了。

R1#show ip ospf database OSPF Router with ID (172.16.1.1) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.1.1 172.16.1.1 387 0x80000006 0x0053C8 3 172.16.255.5 172.16.255.5 412 0x80000006 0x004D98 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 0.0.0.0 172.16.255.5 295 0x80000003 0x00FC7D R1# 9、使用ping命令确认路由。

R1#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 216/570/1488 ms R1# 10、本次实验的关键是:完全末节区域(Totally Stub Area)拒绝了类型3、类型4和类型5的LSA。而对于其它区域的非OSPF自治系统的网络使用默认路由替代。

11、实验完成。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 8. Configuring OSPF NSSA Area and NSSA Totally Stub

实验目的:

1、掌握类型1、2、3、4和5的LSA,及类型7的LSA在完全次末节区域的作用。 2、掌握次未节区域(NSSA)和完全次末节区域(NSSA Totally Stub Area)特点。 3、掌握两种区域配置方法。

4、注意:完全次末节区域(Totally NSSA)为CISCO私有的。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、配置OSPF与RIP的协议,并使用ping和show ip route命令进行确认协议正常工作。

3、为了完成实验需要在R2和R5上配置重发布,配置如下:

R2(config)#router ospf 1 R2(config-router)#redistribute rip metric 200 subnets R2(config-router)#exit R2(config)# R2(config)#router rip R2(config-router)#redistribute ospf 1 metric 10 R2(config-router)#exit R2(config)#exit R5(config)#router ospf 1 R5(config-router)#redistribute rip metric 200 subnets R5(config-router)#exit R5(config)# R5(config)#router rip R5(config-router)#redistribute ospf 1 metric 10 R5(config-router)#exit R5(config)#exit 4、查看R3的路由表的路由表和链路状态数据库。

R3#show ip ospf database OSPF Router with ID (172.16.255.5) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.255.1 172.16.255.1 534 0x80000005 0x008564 2 172.16.255.5 172.16.255.5 679 0x80000004 0x007390 4 172.16.255.9 172.16.255.9 672 0x80000003 0x00A42F 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.16.255.8 172.16.255.9 662 0x80000001 0x005B1A Summary ASB Link States (Area 1) Link ID ADV Router Age Seq# Checksum 192.168.1.1 172.16.255.9 98 0x80000001 0x006E5C Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 131.131.1.0 172.16.255.1 513 0x80000001 0x007BAA 0 131.131.2.0 172.16.255.1 513 0x80000001 0x0070B4 0 192.168.1.0 192.168.1.1 94 0x80000002 0x001FF5 0 192.168.2.0 192.168.1.1 94 0x80000002 0x0014FF 0 R3# R3#show ip route Gateway of last resort is not set 172.16.0.0/30 is subnetted, 3 subnets C 172.16.255.0 is directly connected, Serial1/0 C 172.16.255.4 is directly connected, Serial1/1 O IA 172.16.255.8 [110/128] via 172.16.255.6, 00:07:46, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets O E2 131.131.1.0 [110/200] via 172.16.255.1, 00:00:30, Serial1/0 O E2 131.131.2.0 [110/200] via 172.16.255.1, 00:00:30, Serial1/0 O E2 192.168.1.0/24 [110/200] via 172.16.255.6, 00:00:30, Serial1/1 O E2 192.168.2.0/24 [110/200] via 172.16.255.6, 00:00:30, Serial1/1 R3# 4、由于area 1路由违背了stub区域要求,即stub区域不能够有ASBR路由器的特性。因此本实验采用NSSA的配置方法来减少R3路由器的路由表大小。 5、在R4上将area 1区域配置成NSSA区域:

R4(config)#router ospf 1 R4(config-router)#area 1 nssa default-information-originate R4(config-router)#exit R4(config)# 6、在R3上作如下配置。

R3(config)#router ospf 1 R3(config-router)#area 1 nssa R3(config-router)#exit R3(config)#exit R3# 7、在R2上作如下配置。

R2(config)#router ospf 1 R2(config-router)#area 1 nssa R2(config-router)#exit R2(config)#exit R3# 8、再次查看R3路由表和链路状态数据库。

R3#show ip route Gateway of last resort is 172.16.255.6 to network 0.0.0.0 172.16.0.0/30 is subnetted, 3 subnets C 172.16.255.0 is directly connected, Serial1/0 C 172.16.255.4 is directly connected, Serial1/1 O IA 172.16.255.8 [110/128] via 172.16.255.6, 00:01:10, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets O N2 131.131.1.0 [110/200] via 172.16.255.1, 00:01:10, Serial1/0 O N2 131.131.2.0 [110/200] via 172.16.255.1, 00:01:10, Serial1/0 O*N2 0.0.0.0/0 [110/1] via 172.16.255.6, 00:01:10, Serial1/1 R3# 下面显示的是R3的链路状态数据库。

R3#show ip ospf database OSPF Router with ID (172.16.255.5) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.255.1 172.16.255.1 314 0x80000007 0x0027BA 2 172.16.255.5 172.16.255.5 314 0x80000008 0x0011E8 4 172.16.255.9 172.16.255.9 450 0x80000005 0x004C7D 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.16.255.8 172.16.255.9 850 0x80000002 0x00FE6F Type-7 AS External Link States (Area 1) Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 172.16.255.9 850 0x80000001 0x00C464 0 131.131.1.0 172.16.255.1 318 0x80000001 0x00213D 0 131.131.2.0 172.16.255.1 318 0x80000001 0x001647 0 R3# 9、查看R2或R3的路由表。

R2#show ip route Gateway of last resort is 172.16.255.2 to network 0.0.0.0 172.16.0.0/30 is subnetted, 3 subnets C 172.16.255.0 is directly connected, Serial1/1 O 172.16.255.4 [110/128] via 172.16.255.2, 00:07:26, Serial1/1 O IA 172.16.255.8 [110/192] via 172.16.255.2, 00:07:26, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets R 131.131.1.0 [120/1] via 131.131.2.2, 00:00:06, Serial1/0 C 131.131.2.0 is directly connected, Serial1/0 O*N2 0.0.0.0/0 [110/1] via 172.16.255.2, 00:07:26, Serial1/1 R2# 下面是R1路由器的路由表内容:

R1#show ip route Gateway of last resort is 131.131.2.1 to network 0.0.0.0 R 172.16.0.0/16 [120/10] via 131.131.2.1, 00:00:28, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets C 131.131.1.0 is directly connected, Loopback0 C 131.131.2.0 is directly connected, Serial1/1 R* 0.0.0.0/0 [120/10] via 131.131.2.1, 00:00:28, Serial1/1 R1# 10、在R1上使用ping命令测试默认路由有效性:

R1#ping 192.168.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 288/384/432 ms R1# 11、为了进一步简化area 1区域的路由器的路由表,我们采用完全次末节区域(Totally NSSA)特性来配置area 1。

12、在NSSA的基础上配置Totally NSSA区域特性,只需要在R4的路由器上作如下配置:

R4(config)#router ospf 1 R4(config-router)#area 1 nssa no-summary R4(config-router)#exit 13、再次查看R3的路由表和链路状态数据库:

R3#show ip route Gateway of last resort is 172.16.255.6 to network 0.0.0.0 172.16.0.0/30 is subnetted, 2 subnets C 172.16.255.0 is directly connected, Serial1/0 C 172.16.255.4 is directly connected, Serial1/1

131.131.0.0/24 is subnetted, 2 subnets O N2 131.131.1.0 [110/200] via 172.16.255.1, 00:20:24, Serial1/0 O N2 131.131.2.0 [110/200] via 172.16.255.1, 00:20:24, Serial1/0 O*IA 0.0.0.0/0 [110/65] via 172.16.255.6, 00:02:10, Serial1/1 R3# R3#show ip ospf database OSPF Router with ID (172.16.255.5) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.255.1 172.16.255.1 1504 0x80000007 0x0027BA 2 172.16.255.5 172.16.255.5 1504 0x80000008 0x0011E8 4 172.16.255.9 172.16.255.9 1640 0x80000005 0x004C7D 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 0.0.0.0 172.16.255.9 396 0x80000001 0x0070FF Type-7 AS External Link States (Area 1) Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 172.16.255.9 66 0x80000002 0x00C265 0 131.131.1.0 172.16.255.1 1508 0x80000001 0x00213D 0 131.131.2.0 172.16.255.1 1508 0x80000001 0x001647 0 R3# 14、查看R1和R2路由表,并且使用ping命令确认路由。

R2#show ip route Gateway of last resort is 172.16.255.2 to network 0.0.0.0 172.16.0.0/30 is subnetted, 2 subnets C 172.16.255.0 is directly connected, Serial1/1 O 172.16.255.4 [110/128] via 172.16.255.2, 00:23:09, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets R 131.131.1.0 [120/1] via 131.131.2.2, 00:00:17, Serial1/0 C 131.131.2.0 is directly connected, Serial1/0 O*IA 0.0.0.0/0 [110/129] via 172.16.255.2, 00:04:46, Serial1/1 R2# R1#show ip route Gateway of last resort is 131.131.2.1 to network 0.0.0.0 R 172.16.0.0/16 [120/10] via 131.131.2.1, 00:00:13, Serial1/1 131.131.0.0/24 is subnetted, 2 subnets C 131.131.1.0 is directly connected, Loopback0 C 131.131.2.0 is directly connected, Serial1/1 R* 0.0.0.0/0 [120/10] via 131.131.2.1, 00:00:13, Serial1/1 R1# R1#ping 192.168.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 336/454/528 ms R1# 15、最后,到R5的路由器上查看在R3路由器上的类型7的LSA是否被转换为类型5的LSA:

R5#show ip ospf database OSPF Router with ID (192.168.1.1) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 172.16.255.9 172.16.255.9 338 0x80000004 0x005DC2 2 192.168.1.1 192.168.1.1 767 0x80000004 0x002753 2 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 172.16.255.0 172.16.255.9 81 0x80000002 0x002C10 172.16.255.4 172.16.255.9 1337 0x80000002 0x0081F6 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 131.131.1.0 172.16.255.9 1761 0x80000001 0x0085DA 0 131.131.2.0 172.16.255.9 1761 0x80000001 0x007AE4 0 192.168.1.0 192.168.1.1 767 0x80000003 0x001DF6 0 192.168.2.0 192.168.1.1 767 0x80000003 0x001201 0 R5# 16、实验完成。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 9. Configuring OSPF Virtual-Link

实验目的:

1、理解OSPF虚链路原理及何时需要使用虚链路。 2、掌握OSPF虚链路配置方法

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、首先配置R2,R3,R4的OSPF协议,配置过程中注意区域号,另外:在R2的OSPF协议中先不要network s1/0接口IP标识。确保area 2 、area 0和area 1的OSPF能够正常工作。其中R2路由的OSPF配置如下如示:

R2(config)#router ospf 1 R2(config-router)#network 172.16.255.4 0.0.0.3 area 2 R2(config-router)#exit R2(config)#exit R2# 3、查看R2的路由表。

R2#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/0 C 172.16.255.4/30 is directly connected, Serial1/1 O IA 172.16.255.8/30 [110/128] via 172.16.255.6, 00:00:27, Serial1/1 O IA 172.16.16.1/32 [110/129] via 172.16.255.6, 00:00:04, Serial1/1 R2# 4、再次配置R1和R2的OSPF协议,配置如下:

R1(config)#router ospf 1 R1(config-router)#network 172.16.255.0 0.0.0.3 area 3 R1(config-router)#network 172.16.1.0 0.0.0.255 area 3 R1(config-router)#exit R1(config)#exit R1# R2(config)#router ospf 1 R2(config-router)#network 172.16.255.0 0.0.0.3 area 3 R2(config-router)#exit R2(config)#exit R2# 5、查看R1与R2的OSPF的邻居表:

R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.255.5 1 FULL/ - 00:00:38 172.16.255.2 Serial1/1 R1#

R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.255.9 1 FULL/ - 00:00:37 172.16.255.6 Serial1/1 172.16.1.1 1 FULL/ - 00:00:30 172.16.255.1 Serial1/0 R2# 6、查看R1路由表:

R1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 R1# 通过观察R1的路由表,R1的路由器无法学习到骨干区域、area 1和area 2区域的路由。造成这个问题的主要原因是:area 3区域与骨干区域area 0被分割。 OSPF的区域配置规则是:普通区域必须与骨干区域直连。

7、当有这种问题出现时,可以使用虚链路的配置方案解决。使用虚链路可以确保非直连区域能够逻辑认为自己与骨干区域直连。在R2和R3上进行如下虚拟路的配置。

R2(config)#router ospf 1 R2(config-router)#area 2 virtual-link 172.16.255.9 R2(config-router)#exit R2(config)#exit R2# R3(config)#router ospf 1 R3(config-router)#area 2 virtual-link 172.16.255.5 R3(config-router)#exit R3(config)#exit R3# 8、查看R2的邻居表:

R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.255.9 1 FULL/ - 00:00:30 172.16.255.6 Serial1/1 172.16.1.1 1 FULL/ - 00:00:33 172.16.255.1 Serial1/0 R2# 9、查看R1的路由表,确认R1路由器已经学习其它区域的路由。

R1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:08:40, Serial1/1 O IA 172.16.255.8/30 [110/192] via 172.16.255.2, 00:06:20, Serial1/1 O IA 172.16.16.1/32 [110/193] via 172.16.255.2, 00:06:20, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 R1# 10、使用ping命令确认路由有效性:

R1#ping 172.16.16.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.16.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 152/251/312 ms R1# 11、实验完成。

工大瑞普Cisco课程开发小组 http://www.edurainbow.com http://bbs.edurainbow.com http://cisco.njut.edu.cn

CCNP Lab Manual

Lab 10. Configuring OSPF Virtual-Link(Cont.)

实验目的:

1、理解OSPF虚链路原理及何时需要使用虚链路。 2、掌握OSPF虚链路配置方法

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、首先配置R2,R3,R4的OSPF协议,配置过程中注意区域号: 3、完成配置后,查看R1的路由表。

R1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:02:11, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 R1# 4、查看R2的路由表:

R2#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks C 172.16.255.0/30 is directly connected, Serial1/0 C 172.16.255.4/30 is directly connected, Serial1/1 O 172.16.1.1/32 [110/65] via 172.16.255.1, 00:05:10, Serial1/0 R2# 5、查看R3的路由表:

R3#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks C 172.16.255.4/30 is directly connected, Serial1/0 C 172.16.255.8/30 is directly connected, Serial1/1 O IA 172.16.16.1/32 [110/65] via 172.16.255.10, 00:05:16, Serial1/1 R3# 6、查看R4路由表:

R4#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks O IA 172.16.255.4/30 [110/128] via 172.16.255.9, 00:19:32, Serial1/0 C 172.16.255.8/30 is directly connected, Serial1/0 C 172.16.16.0/24 is directly connected, Loopback0 R4# 7、通过以上查看,可以发现,任何一台路由器都无法学习到完整的网络路由。产生此问题的主要原因是:骨干0的区域被area 2分割,造成整个网络变成两个OSPF的自治系统。所以相互之间都无法学习完整的路由。

8、在这种情况下,可以通过配置虚链路来解决骨干被分割的问题。在R2与R3的路由器上实施如下配置:

R2(config)#router ospf 1 R2(config-router)#area 2 virtual-link 172.16.255.9 R2(config-router)#exit R2(config)#exit R2# R3(config)#router ospf 1 R3(config-router)#area 2 virtual-link 172.16.255.5 R3(config-router)#exit R3(config)#exit R3# 9、查看任意一台路由,确认路由学习情况。本处选择R1路由器。

R1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks C 172.16.255.0/30 is directly connected, Serial1/1 O IA 172.16.255.4/30 [110/128] via 172.16.255.2, 00:01:08, Serial1/1 O 172.16.255.8/30 [110/192] via 172.16.255.2, 00:01:08, Serial1/1 O IA 172.16.16.1/32 [110/193] via 172.16.255.2, 00:01:08, Serial1/1 C 172.16.1.0/24 is directly connected, Loopback0 R1# 10、接下来,使用ping命令,确认路由是否有效。

R1#ping 172.16.16.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.16.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 188/239/288 ms R1# R1#

本文来源:https://www.bwwdw.com/article/vg6x.html

Top