实验拓扑图
实验过程
1.R1的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R1 R1(config)#int lo0 R1(config-if)#ip add 131.131.1.1 255.255.255.0 R1(config-if)#exit R1(config)#int s0/0 R1(config-if)#no shut R1(config-if)#ip add 131.131.2.2 255.255.255.0 R1(config-if)#exit |
2.R2的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R2 R2(config)#int s0/0 R2(config-if)#no shut R2(config-if)#ip add 131.131.2.1 255.255.255.0 R2(config-if)#exit R2(config)#int s0/1 R2(config-if)#no shut R2(config-if)#ip add 172.16.255.1 255.255.255.252 R2(config-if)#exit |
3.R3的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R3 R3(config)#int s0/1 R3(config-if)#no shut R3(config-if)#ip add 172.16.255.2 255.255.255.252 R3(config-if)#exit R3(config)#int s0/2 R3(config-if)#no shut R3(config-if)#ip add 172.16.255.5 255.255.255.252 R3(config-if)#exit |
4.R4的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R4 R4(config)#int s0/2 R4(config-if)#no shut R4(config-if)#ip add 172.16.255.6 255.255.255.252 R4(config-if)#exit R4(config)#int s0/3 R4(config-if)#no shut R4(config-if)#ip add 172.16.255.9 255.255.255.252 R4(config-if)#exit |
5.R5的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R5 R5(config)#int s0/3 R5(config-if)#no shut R5(config-if)#ip add 172.16.255.10 255.255.255.252 R5(config-if)#exit R5(config)#int s0/0 R5(config-if)#no shut R5(config-if)#ip add 192.168.1.1 255.255.255.0 R5(config-if)#exit |
6.R6的预配置
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line console 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R6 R6(config)#int s0/0 R6(config-if)#no shut R6(config-if)#ip add 192.168.1.2 255.255.255.0 R6(config-if)#exit R6(config)#int lo0 R6(config-if)#ip add 192.168.2.1 255.255.255.0 R6(config-if)#exit |
7.R1的RIP配置
R1(config)#router rip R1(config-router)#version 2 R1(config-router)#no auto R1(config-router)#net 131.131.0.0 R1(config-router)#end |
8.R2的RIP和OSPF配置
R2(config)#router rip R2(config-router)#version 2 R2(config-router)#no auto R2(config-router)#net 131.131.0.0 R2(config-router)#exit R2(config)#router ospf 1 R2(config-router)#net 172.16.255.1 0.0.0.0 area 1 R2(config-router)#exit R2(config)#router ospf 1 R2(config-router)#redistribute rip subnets metric 200 //把RIP重发布到OSPF中 R2(config-router)#exit R2(config)#router rip R2(config-router)#redistribute ospf 1 metric 10 //把OSPF重发布到RIP中 R2(config-router)#end |
9.R3的OSPF配置
R3(config)#router ospf 1 R3(config-router)#net 172.16.255.2 0.0.0.0 area 1 R3(config-router)#net 172.16.255.5 0.0.0.0 area 1 R3(config-router)#end |
10.R4的OSPF配置
R4(config)#router ospf 1 R4(config-router)#net 172.16.255.6 0.0.0.0 area 1 R4(config-router)#net 172.16.255.9 0.0.0.0 area 0 R4(config-router)#end |
11.R5的RIP和OSPF配置
R5(config)#router ospf 1 R5(config-router)#net 172.16.255.10 0.0.0.0 area 0 R5(config-router)#exit R5(config)#router rip R5(config-router)#version 2 R5(config-router)#no aut R5(config-router)#net 192.168.1.0 R5(config-router)#exit R5(config)#router ospf 1 R5(config-router)#redistribute rip subnets metric 200 R5(config-router)#exit R5(config)#router rip R5(config-router)#redistribute ospf 1 metric 10 R5(config-router)#end |
12.R6的RIP配置
R6(config)#router rip R6(config-router)#version 2 R6(config-router)#no auto R6(config-router)#net 192.168.1.0 R6(config-router)#net 192.168.2.0 R6(config-router)#end |
13.查看R3的链路状态数据库
R3#show ip ospf da
OSPF Router with ID (172.16.255.5) (Process ID 1)
Router Link States (Area 1) //1型LSA
Link ID ADV Router Age Seq# Checksum Link count 172.16.255.1 172.16.255.1 382 0x80000003 0x008962 2 172.16.255.5 172.16.255.5 458 0x80000002 0x00778E 4 172.16.255.9 172.16.255.9 459 0x80000001 0x00A82D 2
Summary Net Link States (Area 1) //3型LSA
Link ID ADV Router Age Seq# Checksum 172.16.255.8 172.16.255.9 455 0x80000001 0x005B1A
Summary ASB Link States (Area 1) //4型LSA
Link ID ADV Router Age Seq# Checksum 192.168.1.1 172.16.255.9 336 0x80000001 0x006E5C
Type-5 AS External Link States //5型LSA
Link ID ADV Router Age Seq# Checksum Tag 131.131.1.0 172.16.255.1 382 0x80000001 0x007BAA 0 131.131.2.0 172.16.255.1 382 0x80000001 0x0070B4 0 192.168.1.0 192.168.1.1 342 0x80000001 0x0021F4 0 192.168.2.0 192.168.1.1 342 0x80000001 0x0016FE 0 |
14.查看R3的路由表
R3#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
172.16.0.0/30 is subnetted, 3 subnets C 172.16.255.0 is directly connected, Serial0/1 C 172.16.255.4 is directly connected, Serial0/2 O IA 172.16.255.8 [110/128] via 172.16.255.6, 00:08:13, Serial0/2 131.131.0.0/24 is subnetted, 2 subnets O E2 131.131.1.0 [110/200] via 172.16.255.1, 00:07:27, Serial0/1 O E2 131.131.2.0 [110/200] via 172.16.255.1, 00:07:27, Serial0/1 O E2 192.168.1.0/24 [110/200] via 172.16.255.6, 00:07:27, Serial0/2 O E2 192.168.2.0/24 [110/200] via 172.16.255.6, 00:07:27, Serial0/2 |
15.由于area 1路由违背了stub区域要求,即stub区域不能够有ASBR路由器的特性。因此本实验采用NSSA的配置方法来减少R3路由器的路由表大小。