底层配置:
R1
r1(config)#int s2/2 r1(config-if)#ip add 15.0.0.1 255.255.255.0 r1(config-if)#no sh
r1(config-if)#int s3/0
r1(config-if)#ip add 192.168.0.1 255.255.255.0 r1(config-if)#en frame-relay r1(config-if)#no frame-relay inverse-arp r1(config-if)#frame-relay map ip 192.168.0.2 102 b r1(config-if)#frame-relay map ip 192.168.0.3 103 b r1(config-if)#no sh
r1(config-if)#int lo0
r1(config-if)#ip add 1.1.1.1 255.255.255.0
R2
r2(config)#int f0/0 r2(config-if)#ip add 172.16.0.2 255.255.255.0 r2(config-if)#no sh
r2(config-if)#int s3/0
r2(config-if)#en frame-relay r2(config-if)#no sh r2(config)#int s3/0.1 m r2(config-subif)#ip add 192.168.0.2 255.255.255.0 r2(config-subif)#no frame-relay inverse-arp r2(config-subif)#frame-relay map ip 192.168.0.1 201 b r2(config-subif)#frame-relay map ip 192.168.0.3 203 b
r2(config-subif)#int lo0
r2(config-if)#ip add 2.2.0.2 255.255.255.0 r2(config-if)#int lo1 r2(config-if)#ip add 2.2.1.2 255.255.255.0 r2(config-if)#int lo2 r2(config-if)#ip add 2.2.2.2 255.255.255.0 r2(config-if)#int lo3 r2(config-if)#ip add 2.2.3.2 255.255.255.0
R3
r3(config)#int s3/0 r3(config-if)#en frame-relay r3(config-if)#ip add 192.168.0.3 255.255.255.0 r3(config-if)#no frame-relay inv r3(config-if)#frame-relay map ip 192.168.0.2 302 b r3(config-if)#frame-relay map ip 192.168.0.1 301 b r3(config-if)#no sh r3(config-if)#int s2/2 r3(config-if)#ip add 34.0.0.3 255.255.255.0 r3(config-if)#no sh
r3(config-if)#int lo0
r3(config-if)#ip add 3.3.0.3 255.255.255.0 r3(config-if)#int lo1 r3(config-if)#ip add 3.3.1.3 255.255.255.0 r3(config-if)#int lo2 r3(config-if)#ip add 3.3.2.3 255.255.255.0 r3(config-if)#int lo3 r3(config-if)#ip add 3.3.3.3 255.255.255.0
R4
r4(config)#int s2/1 r4(config-if)#ip add 34.0.0.4 255.255.255.0 r4(config-if)#no sh
r4(config-if)#int f0/0
r4(config-if)#ip add 172.16.0.4 255.255.255.0 r4(config-if)#no sh
r4(config-if)#int lo0
r4(config-if)#ip add 4.4.4.4 255.255.255.0
R5
r5(config)#int s2/1 r5(config-if)#ip add 15.0.0.5 255.255.255.0 r5(config-if)#no sh
r5(config-if)#int f0/0
r5(config-if)#ip add 172.16.0.5 255.255.255.0 r5(config-if)#no sh
r5(config-if)#int lo0
r5(config-if)#ip add 5.5.5.5 255.255.255.0 |
路由
R1 r1(config)#router os 1 r1(config-router)#router-id 1.1.1.1 r1(config-router)#net 15.0.0.0 0.0.0.255 a 0 r1(config-router)#net 192.168.0.0 0.0.0.255 a 123 r1(config-router)#net 1.1.1.0 0.0.0.255 a 0
r1(config-router)#int s3/0
r1(config-if)#ip ospf network broadcast \\修改frame-rely下ospf模式为广播 r1(config-if)#ip ospf priority 0 \\修改优先级为0不参加DR选举
R2
r2(config)#router os 1 r2(config-router)#router-id 2.2.2.2 r2(config-router)#net 2.2.0.0 0.0.255.255 a 123 r2(config-router)#net 192.168.0.0 0.0.0.255 a 123 r2(config-router)#net 172.16.0.0 0.0.0.255 a 25
r2(config-router)#int s3/0.1
r2(config-subif)#ip os net broadcast r2(config-subif)#ip os priority 255 r2(config-subif)#int f0/0 r2(config-if)#ip os p 255 \\修改优先级为最高,以满足要求2的条件
R3
r3(config)#router os 1 r3(config-router)#router-id 3.3.3.3 r3(config-router)#net 192.168.0.0 0.0.0.255 a 123 r3(config-router)#net 34.0.0.0 0.0.0.255 a 34
r3(config-router)#router eigrp 3
r3(config-router)#net 3.3.0.0 255.255.252.0
r3(config-router)#int s3/0
r3(config-if)#ip os net b r3(config-if)#ip os p 0
R4
r4(config)#router os 1 r4(config-router)#net 34.0.0.0 0.0.0.255 a 34 r4(config-router)#net 172.16.0.0 0.0.0.255 a 25
r4(config-router)#router rip
r4(config-router)#net 4.0.0.0
r4(config-router)#int f0/0
r4(config-if)#ip os p 0
R5
r5(config)#router os 1 r5(config-router)#net 5.5.5.0 0.0.0.255 a 0 r5(config-router)#net 15.0.0.0 0.0.0.255 a 0 r5(config-router)#net 172.16.0.0 0.0.0.255 a 25
r5(config-router)#int f0/0
r5(config-if)#ip os p 0 |
认证
R1 r1(config)#int s2/2 r1(config-if)#ip os authentication message-digest r1(config-if)#ip os message-digest-key 1 md5 cisco
R5
r5(config)#int s2/1 r5(config-if)#ip os authentication message-digest r5(config-if)#ip os message-digest-key 1 md5 cisco
在area 0区启用密文认证,以满足要求7
|
虚链路
R4 r4(config)#router os 1 r4(config-router)#area 25 virtual-link 5.5.5.5 R5 r5(config)#router os 1 r5(config-router)#area 25 virtual-link 4.4.4.4 r5(config-router)#area 25 virtual-link 2.2.2.2 R2 r2(config)#router os 1 r2(config-router)#area 25 virtual-link 5.5.5.5 r2(config-router)#area 123 virtual-link 1.1.1.1 R1 r1(config)#router os 1 r1(config-router)#area 123 virtual-link 2.2.2.2
分别搭建三个虚拟链路 以满足要求三,当R1和R5断开连接后全网其他线路相互通讯正常
|
NSSA区域/重分布
R3 r3(config)#router os 1 r3(config-router)#area 34 nssa r3(config-router)#redistribute eigrp 3 subnets R4 r4(config)#router os 1 r4(config-router)#area 34 nssa r4(config-router)#redistribute rip subnets
满足条件四 设置area 34区域为nssa
|
汇聚
R3 r3(config)#router os 1 r3(config-router)#summary-address 3.3.0.0 255.255.252.0 \\对重分布的EIGRP AS3的路由做汇总以满足要求六
R2
r2(config)#router os 1 r2(config-router)#area 123 range 2.2.0.0 255.255.252.0 advertise \\对域间路由条目做汇总,以使得area 0区域出现要求五所要求的路由 R1 r1(config)#ip prefix-list hz p 5.5.5.0/24 ge 32 r1(config)#ip prefix-list hz p 4.4.4.0/24 r1(config)#ip prefix-list hz p 3.3.0.0/22 r1(config)#ip prefix-list hz p 192.168.0.0/24 r1(config)#ip prefix-list hz p 172.16.0.0/24 r1(config)#ip prefix-list hz p 34.0.0.0/24 r1(config)#ip prefix-list hz p 2.2.0.0/22 le 24 r1(config)#router os 1 r1(config-router)#distribute-list prefix hz in
R5
r5(config)#ip prefix-list hz p 1.1.1.0/24 ge 32 r5(config)#ip prefix-list hz p 4.4.4.0/24 r5(config)#ip prefix-list hz p 3.3.0.0/22 r5(config)#ip prefix-list hz p 192.168.0.0/24 r5(config)#ip prefix-list hz p 172.16.0.0/24 r5(config)#ip prefix-list hz p 34.0.0.0/24 r5(config)#ip prefix-list hz p 2.2.0.0/22 le 24 r5(config)#router os 1 r5(config-router)#distribute-list prefix hz in
分别在R1 R5上做路由过滤,以满足要求五的条件
|
要求一:全网通
r1#ping 2.2.2.2
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 120/266/360 ms
r1#ping 3.3.3.3
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 108/142/208 ms
r1#ping 4.4.4.4
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 168/257/376 ms
r1#ping 5.5.5.5
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 116/150/204 ms
r1#ping 172.16.0.5
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.0.5, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 116/150/204 ms
r1#ping 192.168.0.3
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 100/141/228 ms
r1#ping 34.0.0.4
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 34.0.0.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 168/261/340 ms
从R1上ping测试各个网段 全网通,满足要求一
|
要求二:R2为指定DR 无论是否有新路由加入 R2始终是DR
r2#sh ip os n
Neighbor ID Pri State Dead Time Address Interface
5.5.5.5 0 FULL/ - - 172.16.0.5 OSPF_VL0 4.4.4.4 0 FULL/DROTHER 00:00:33 172.16.0.4 FastEthernet0/0 5.5.5.5 0 FULL/DROTHER 00:00:35 172.16.0.5 FastEthernet0/0 1.1.1.1 0 FULL/DROTHER 00:00:33 192.168.0.1 Serial3/0.1 3.3.3.3 0 FULL/DROTHER 00:00:36 192.168.0.3 Serial3/0.1
在R2上查看邻居,全部优先级为0 不参加DR选举,以满足要求二
|
要求三:当r1、r5断开,其它互通
r1(config)#int s2/2 r1(config-if)#sh r1(config-if)# *Oct 25 15:10:45.623: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on Serial2/2 from FULL to DOWN, Neighbor Down: Interface down or
detached
r1(config-if)# *Oct 25 15:10:47.587: %LINK-5-CHANGED: Interface Serial2/2, changed state to administratively down *Oct 25 15:10:48.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to down r1(config-if)# r1#ping *Oct 25 15:10:51.091: %SYS-5-CONFIG_I: Configured from console by console
r1#ping 5.5.5.5 so 1.1.1.1
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 168/261/340 ms
关闭R1 S2/2口 测试由源1.1.1.1能否与目的5.5.5.5进行通讯,以确定当1-5之间链路断开不会影响到网络数据的传输
|
要求四:area 34为NSSA
r3#sh ip os database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 34)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 1371 0x80000007 0x00B373 2 4.4.4.4 4.4.4.4 1416 0x80000007 0x0056CA 2
Summary Net Link States (Area 34)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 4.4.4.4 332 0x80000001 0x001FC1 2.2.0.0 4.4.4.4 186 0x80000002 0x009190 2.2.0.2 4.4.4.4 332 0x80000001 0x008915 2.2.1.2 4.4.4.4 332 0x80000001 0x007E1F 2.2.2.2 4.4.4.4 332 0x80000001 0x007329 2.2.3.2 4.4.4.4 332 0x80000001 0x006833 5.5.5.5 4.4.4.4 1416 0x80000004 0x00DD30 15.0.0.0 4.4.4.4 1416 0x80000004 0x00795A 172.16.0.0 4.4.4.4 1416 0x80000004 0x003531 192.168.0.0 4.4.4.4 927 0x80000009 0x008BE7
Type-7 AS External Link States (Area 34)
Link ID ADV Router Age Seq# Checksum Tag
3.3.0.0 3.3.3.3 1371 0x80000004 0x00B2B4 0 4.4.4.0 4.4.4.4 1417 0x80000003 0x006EEB 0
Router Link States (Area 123)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 992 0x80000006 0x00E728 1 2.2.2.2 2.2.2.2 1106 0x80000008 0x00475B 5 3.3.3.3 3.3.3.3 1124 0x80000007 0x006C8F 1
Net Link States (Area 123)
Link ID ADV Router Age Seq# Checksum
192.168.0.2 2.2.2.2 1106 0x80000005 0x00DACB
Summary Net Link States (Area 123)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 479 0x80000004 0x0041EF 1.1.1.1 2.2.2.2 333 0x80000001 0x00B539 2.2.0.0 1.1.1.1 334 0x80000001 0x00C035 5.5.5.5 1.1.1.1 337 0x80000001 0x0011D2 5.5.5.5 2.2.2.2 1109 0x80000005 0x0072A8 15.0.0.0 1.1.1.1 481 0x80000004 0x0024C2 15.0.0.0 2.2.2.2 1109 0x80000005 0x000ED2 34.0.0.0 1.1.1.1 337 0x80000001 0x00BED6 34.0.0.0 2.2.2.2 1612 0x80000002 0x0026A9 172.16.0.0 1.1.1.1 337 0x80000001 0x0072C8 172.16.0.0 2.2.2.2 1109 0x80000005 0x00C9A9
Summary ASB Link States (Area 123)
Link ID ADV Router Age Seq# Checksum
4.4.4.4 1.1.1.1 337 0x80000001 0x0031B5 4.4.4.4 2.2.2.2 1109 0x80000003 0x008C94
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
3.3.0.0 3.3.3.3 1127 0x80000005 0x002B62 0 4.4.4.0 4.4.4.4 1421 0x80000003 0x00DAA7 0
在R3上看到7类的链路状态表,以确定area 34区域为NSSA区域
|
要求五:R2有四个回环口:2.2.0.2~2.2.3.2,在区域0中只出现2.2.0.0/22汇总路由
要求六:R3有四个回环口:3.3.0.3~3.3.3.3,在区域0中只出现3.3.0.0/22汇总路由
r1#sh ip rou
*Oct 25 15:52:48.403: %SYS-5-CONFIG_I: Configured from console by console r1#sh ip rou 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
34.0.0.0/24 is subnetted, 1 subnets
O IA 34.0.0.0 [110/130] via 192.168.0.2, 00:00:02, Serial3/0 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnets O IA 2.2.0.0 [110/65] via 192.168.0.2, 00:00:02, Serial3/0 3.0.0.0/22 is subnetted, 1 subnets O E2 3.3.0.0 [110/20] via 192.168.0.3, 00:00:02, Serial3/0 4.0.0.0/24 is subnetted, 1 subnets O E2 4.4.4.0 [110/20] via 192.168.0.2, 00:00:02, Serial3/0 5.0.0.0/32 is subnetted, 1 subnets O 5.5.5.5 [110/66] via 192.168.0.2, 00:00:03, Serial3/0 172.16.0.0/24 is subnetted, 1 subnets O IA 172.16.0.0 [110/65] via 192.168.0.2, 00:00:04, Serial3/0 C 192.168.0.0/24 is directly connected, Serial3/0 |
要求七:区域0 中密文认证,密码:cisco
r1#debug ip os adj OSPF adjacency events debugging is on r1# *Oct 25 15:06:00.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:06:10.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:06:20.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:06:30.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:06:40.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:06:50.283: OSPF: Send with youngest Key 1 r1# *Oct 25 15:07:00.283: OSPF: Send with youngest Key 1 r1#u *Oct 25 15:07:10.283: OSPF: Send with youngest Key 1 \\以上内容说明R1在发送KEY r1#u all All possible debugging has been turned off r1#sh ip os n
Neighbor ID Pri State Dead Time Address Interface
5.5.5.5 0 FULL/ - 00:00:38 15.0.0.5 Serial2/2 \\邻居已经建立,说明认证成功 2.2.2.2 255 FULL/DR 00:00:36 192.168.0.2 Serial3/0 3.3.3.3 0 2WAY/DROTHER 00:00:38 192.168.0.3 Serial3/0 |