实验使用的工具:小凡模拟器
★☆一、配置各个路由器的接口,并使用查看命令 分析路由表及链路状态库的变化。☆★
①配置R1为RIP路由协议,并宣告网段
Router>
Router>enable
Router#config terminal
Router(config)#hostname R1-jin
R1-jin(config)#interface f0/0
R1-jin(config-if)#ip address 10.0.0.1 255.0.0.0
R1-jin(config-if)#no shutdown
R1-jin(config-if)#interface f1/0
R1-jin(config-if)#ip address 20.0.0.1 255.0.0.0
R1-jin(config-if)#no shutdown
R1-jin(config-if)#exit
R1-jin(config)#router rip
R1-jin(config-router)#network 10.0.0.0
R1-jin(config-router)#network 20.0.0.0
R1-jin(config-router)#end
R1-jin#
R1-jin#show ip route
R 50.0.0.0/8 [120/10] via 20.0.0.2, 00:00:21, FastEthernet1/0
C 20.0.0.0/8 is directly connected, FastEthernet1/0
R 40.0.0.0/8 [120/10] via 20.0.0.2, 00:00:21, FastEthernet1/0
C 10.0.0.0/8 is directly connected, FastEthernet0/0
R 60.0.0.0/8 [120/10] via 20.0.0.2, 00:00:21, FastEthernet1/0
R 30.0.0.0/8 [120/10] via 20.0.0.2, 00:00:21, FastEthernet1/0
②配置R2的接口f1/0为RIP协议,f0/0为OSPF协议,区域1;是ASBR路由器,对其设置路由重分发。
Router>
Router>enable
Router#config terminal
Router(config)#hostname R2-jin
R2-jin(config)#interface f1/0
R2-jin(config-if)#ip address 20.0.0.2 255.0.0.0
R2-jin(config-if)#no shutdown
R2-jin(config-if)#interface loopback 0
R2-jin(config-if)#ip address 2.2.2.2 255.255.255.255
R2-jin(config-if)#interface f0/0
R2-jin(config-if)#ip address 30.0.0.2 255.0.0.0
R2-jin(config-if)#no shutdown
R2-jin(config-if)#exit
R2-jin(config)#router rip
R2-jin(config-router)#network 20.0.0.0
R2-jin(config-router)#exit
R2-jin(config)#router ospf 1
R2-jin(config-router)#network 30.0.0.2 0.0.0.0 area 1
R2-jin(config-router)#end
R2-jin(config)#router rip ―――进入RIP―――-――――――――|意:重分发OSPF进程1中的路由信息到rip中,
R2-jin(config-router)#redistribute ospf 1 metric 10 ―重分发―| 度量值为10跳;
R2-jin(config-router)#router ospf 1 ―――进入OSPF――――――|思:重分发rip中的路由信息到OSPF进程1中,
R2-jin(config-router)#redistribute rip metric 200 subnets ――| 度量值为代价(cost值)200,连同子网。
R2-jin(config-router)#end
R2-jin#show ip route
O IA 50.0.0.0/8 [110/66] via 30.0.0.1, 00:05:45, FastEthernet0/0 (“O IA”:域间条目,3类;“110”:管理距离、“66”:cost值)
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0 (“C”:直连)
C 20.0.0.0/8 is directly connected, FastEthernet1/0
O IA 40.0.0.0/8 [110/2] via 30.0.0.1, 00:07:34, FastEthernet0/0
R 10.0.0.0/8 [120/1] via 20.0.0.1, 00:00:25, FastEthernet1/0 (“R”:rip学到)
O IA 60.0.0.0/8 [110/67] via 30.0.0.1, 00:03:55, FastEthernet0/0
C 30.0.0.0/8 is directly connected, FastEthernet0/0
R2-jin#
R2-jin#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 1) ――路由器LSA 1类 “Aeea 1”-区域1
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 614 0x80000003 0x00A33B 1
3.3.3.3 3.3.3.3 608 0x80000003 0x004692 1
Net Link States (Area 1) ――网络LSA 2类
Link ID ADV Router Age Seq# Checksum
30.0.0.2 2.2.2.2 614 0x80000001 0x00A25B
Summary Net Link States (Area 1) ――网络汇总LSA 3类
Link ID ADV Router Age Seq# Checksum
40.0.0.0 3.3.3.3 463 0x80000003 0x002BDA
50.0.0.0 3.3.3.3 354 0x80000001 0x002F8E
60.0.0.0 3.3.3.3 245 0x80000001 0x00B6FB
Type-5 AS External Link States ――AS外部LSA 5类
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 774 0x80000001 0x0038A1 0
20.0.0.0 2.2.2.2 776 0x80000001 0x00B51A 0
R2-jin#
③配置R3的接口f0/0为区域1,f1/0为区域0(骨干区域),是ABR路由器;并宣告相应的网段。
Router>
Router>enable
Router#config terminal
Router(config)#hostname R3-jin
R3-jin(config)#interface loopback 0
R3-jin(config-if)#ip address 3.3.3.3 255.255.255.255
R3-jin(config-if)#interface f0/0
R3-jin(config-if)#ip address 30.0.0.1 255.0.0.0
R3-jin(config-if)#no shutdown
R3-jin(config-if)#interface f1/0
R3-jin(config-if)#ip address 40.0.0.1 255.0.0.0
R3-jin(config-if)#no shutdown
R3-jin(config-if)#exit
R3-jin(config)#router ospf 1
R3-jin(config-router)#network 30.0.0.1 0.0.0.0 area 1
R3-jin(config-router)#network 40.0.0.1 0.0.0.0 area 0
R3-jin(config-router)#end
R3-jin#show ip route
O IA 50.0.0.0/8 [110/65] via 40.0.0.2, 00:05:13, FastEthernet1/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
O E2 20.0.0.0/8 [110/200] via 30.0.0.2, 00:05:13, FastEthernet0/0 (“O E2”:外部条目,5类(优先级比E1高))
C 40.0.0.0/8 is directly connected, FastEthernet1/0
O E2 10.0.0.0/8 [110/200] via 30.0.0.2, 00:05:13, FastEthernet0/0
O IA 60.0.0.0/8 [110/66] via 40.0.0.2, 00:03:23, FastEthernet1/0
C 30.0.0.0/8 is directly connected, FastEthernet0/0
R3-jin#
R3-jin#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 449 0x80000002 0x00F2D3 1
4.4.4.4 4.4.4.4 337 0x80000003 0x00B20A 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
40.0.0.1 3.3.3.3 449 0x80000001 0x006088
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 3.3.3.3 584 0x80000001 0x00B160
50.0.0.0 4.4.4.4 332 0x80000001 0x0007B3
60.0.0.0 4.4.4.4 222 0x80000001 0x008E21
Summary ASB Link States (Area 0) ――ASBR汇总LSA 4类 ,区域0
Link ID ADV Router Age Seq# Checksum
2.2.2.2 3.3.3.3 584 0x80000001 0x00CE58
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 594 0x80000003 0x00A33B 1
3.3.3.3 3.3.3.3 586 0x80000003 0x004692 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
30.0.0.2 2.2.2.2 595 0x80000001 0x00A25B
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
40.0.0.0 3.3.3.3 441 0x80000003 0x002BDA
50.0.0.0 3.3.3.3 333 0x80000001 0x002F8E
60.0.0.0 3.3.3.3 223 0x80000001 0x00B6FB
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 754 0x80000001 0x0038A1 0
20.0.0.0 2.2.2.2 755 0x80000001 0x00B51A 0
④配置R4的接口f1/0为骨干区域0,s0/0为区域2,是ABR路由器;并宣告相应的网段。
Router>
Router>enable
Router#config terminal
Router(config)#hostname R4-jin
R4-jin(config)#interface loopback 0
R4-jin(config-if)#ip address 4.4.4.4 255.255.255.255
R4-jin(config-if)#interface f1/0
R4-jin(config-if)#ip address 40.0.0.2 255.0.0.0
R4-jin(config-if)#no shutdown
R4-jin(config-if)#interface s0/0
R4-jin(config-if)#clock rate 128000
R4-jin(config-if)#ip address 50.0.0.1 255.0.0.0
R4-jin(config-if)#no shutdown
R4-jin(config-if)#exit
R4-jin(config)#router ospf 1
R4-jin(config-router)#network 40.0.0.2 0.0.0.0 area 0
R4-jin(config-router)#network 50.0.0.1 0.0.0.0 area 2
R4-jin(config-router)#end
R4-jin#show ip route
C 50.0.0.0/8 is directly connected, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
O E2 20.0.0.0/8 [110/200] via 40.0.0.1, 00:02:58, FastEthernet1/0
C 40.0.0.0/8 is directly connected, FastEthernet1/0
O E2 10.0.0.0/8 [110/200] via 40.0.0.1, 00:02:58, FastEthernet1/0
O 60.0.0.0/8 [110/65] via 50.0.0.2, 00:02:58, Serial0/0 ――(“O”:域内路由条目,1、2类)
O IA 30.0.0.0/8 [110/2] via 40.0.0.1, 00:02:58, FastEthernet1/0
R4-jin#
R4-jin#show ip ospf database
OSPF Router with ID (4.4.4.4) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 414 0x80000002 0x00F2D3 1
4.4.4.4 4.4.4.4 300 0x80000003 0x00B20A 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
40.0.0.1 3.3.3.3 415 0x80000001 0x006088
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 3.3.3.3 550 0x80000001 0x00B160
50.0.0.0 4.4.4.4 296 0x80000001 0x0007B3
60.0.0.0 4.4.4.4 186 0x80000001 0x008E21
Summary ASB Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
2.2.2.2 3.3.3.3 550 0x80000001 0x00CE58
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
4.4.4.4 4.4.4.4 202 0x80000003 0x00AE59 2
5.5.5.5 5.5.5.5 197 0x80000003 0x0012A4 3
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 4.4.4.4 303 0x80000001 0x009D6F
40.0.0.0 4.4.4.4 303 0x80000001 0x0011F2
Summary ASB Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
2.2.2.2 4.4.4.4 303 0x80000001 0x00BA67
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 719 0x80000001 0x0038A1 0
20.0.0.0 2.2.2.2 724 0x80000001 0x00B51A 0
⑤配置R5的接口,区域2,宣告网段
Router>
Router>enable
Router#config terminal
Router(config)#hostname R5-jin
R5-jin(config)#interface loopback 0
R5-jin(config-if)#ip address 5.5.5.5 255.255.255.255
R5-jin(config-if)#interface s0/0
R5-jin(config-if)#clock rate 128000
R5-jin(config-if)#ip address 50.0.0.2 255.0.0.0
R5-jin(config-if)#no shutdown
R5-jin(config)#interface f1/0
R5-jin(config-if)#ip address 60.0.0.2 255.0.0.0
R5-jin(config-if)#no shutdown
R5-jin(config-if)#interface f1/0
R5-jin(config-if)#no ip address 60.0.0.2 255.0.0.0
R5-jin(config-if)#ip address 60.0.0.1 255.0.0.0
R5-jin(config-if)#no shutdown
R5-jin(config-if)#exit
R5-jin(config)#router ospf 1
R5-jin(config-router)#network 50.0.0.2 0.0.0.0 area 2
R5-jin(config-router)#network 60.0.0.1 0.0.0.0 area 2
R5-jin(config-router)#end
R5-jin#show ip interface brief
R5-jin#show ip route
C 50.0.0.0/8 is directly connected, Serial0/0
O E2 20.0.0.0/8 [110/200] via 50.0.0.1, 00:02:38, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
O IA 40.0.0.0/8 [110/65] via 50.0.0.1, 00:02:38, Serial0/0
O E2 10.0.0.0/8 [110/200] via 50.0.0.1, 00:02:38, Serial0/0
C 60.0.0.0/8 is directly connected, FastEthernet1/0
O IA 30.0.0.0/8 [110/66] via 50.0.0.1, 00:02:38, Serial0/0
R5-jin#
R5-jin#show ip ospf database
OSPF Router with ID (5.5.5.5) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
4.4.4.4 4.4.4.4 174 0x80000003 0x00AE59 2
5.5.5.5 5.5.5.5 168 0x80000003 0x0012A4 3
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 4.4.4.4 276 0x80000001 0x009D6F
40.0.0.0 4.4.4.4 276 0x80000001 0x0011F2
Summary ASB Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
2.2.2.2 4.4.4.4 276 0x80000001 0x00BA67
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 692 0x80000001 0x0038A1 0
20.0.0.0 2.2.2.2 694 0x80000001 0x00B51A 0
★☆二、配置非纯末梢区域及完全末梢;并使用查看命令 分析路由表及链路状态库的变化。☆★
①在R2和R3上配置非纯末梢区域
R2
R2-jin#config terminal
R2-jin(config)#router ospf 1
R2-jin(config-router)#area 1 nssa ――非纯末梢区域
R2-jin#end
R2-jin#show ip route
O IA 50.0.0.0/8 [110/66] via 30.0.0.1, 00:01:08, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
C 20.0.0.0/8 is directly connected, FastEthernet1/0
O IA 40.0.0.0/8 [110/2] via 30.0.0.1, 00:01:08, FastEthernet0/0
R 10.0.0.0/8 [120/1] via 20.0.0.1, 00:00:13, FastEthernet1/0
C 30.0.0.0/8 is directly connected, FastEthernet0/0
R2-jin#
R2-jin#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 383 0x80000005 0x003B9C 1
3.3.3.3 3.3.3.3 383 0x80000005 0x00E3EB 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
30.0.0.1 3.3.3.3 384 0x80000001 0x0024D0
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
40.0.0.0 3.3.3.3 390 0x80000004 0x00CE30
50.0.0.0 3.3.3.3 390 0x80000002 0x00D2E3
60.0.0.0 3.3.3.3 293 0x80000001 0x005C50
Type-7 AS External Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 418 0x80000001 0x000BA4 0
20.0.0.0 2.2.2.2 420 0x80000001 0x00881D 0
R3
R3-jin#config terminal
R3-jin(config)#router ospf 1
R3-jin(config-router)#area 1 nssa
R3-jin(config-router)#end
R3-jin#show ip route
O IA 50.0.0.0/8 [110/65] via 40.0.0.2, 00:01:45, FastEthernet1/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
O N2 20.0.0.0/8 [110/200] via 30.0.0.2, 00:01:45, FastEthernet0/0 ――(“O N2”:外部条目,7类 (N1也是))
C 40.0.0.0/8 is directly connected, FastEthernet1/0
O N2 10.0.0.0/8 [110/200] via 30.0.0.2, 00:01:45, FastEthernet0/0
O IA 60.0.0.0/8 [110/66] via 40.0.0.2, 00:00:43, FastEthernet1/0
C 30.0.0.0/8 is directly connected, FastEthernet0/0
R3-jin#
R3-jin#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 169 0x80000003 0x00F6CC 1
50.0.0.1 50.0.0.1 398 0x80000003 0x0083F2 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
40.0.0.1 3.3.3.3 461 0x80000001 0x00CDF7
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 3.3.3.3 150 0x80000005 0x00A964
50.0.0.0 50.0.0.1 394 0x80000001 0x00B5E1
60.0.0.0 50.0.0.1 84 0x80000001 0x003D4F
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 159 0x80000005 0x003B9C 1
3.3.3.3 3.3.3.3 161 0x80000005 0x00E3EB 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
30.0.0.1 3.3.3.3 161 0x80000001 0x0024D0
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
40.0.0.0 3.3.3.3 172 0x80000004 0x00CE30
50.0.0.0 3.3.3.3 172 0x80000002 0x00D2E3
60.0.0.0 3.3.3.3 85 0x80000001 0x005C50
Type-7 AS External Link States (Area 1) ――NSSA外部LSA 7类
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 2.2.2.2 206 0x80000001 0x000BA4 0
20.0.0.0 2.2.2.2 206 0x80000001 0x00881D 0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 3.3.3.3 141 0x80000001 0x008134 0
20.0.0.0 3.3.3.3 142 0x80000001 0x00FEAC 0
R3-jin#
②在R4上配置完全末梢,R5上配置末梢
R4
R4-jin(config)#router ospf 1
R4-jin(config-router)#area 2 stub no-summary
R4-jin(config-router)#end
R4-jin#show ip route
C 50.0.0.0/8 is directly connected, Serial0/0
O E2 20.0.0.0/8 [110/200] via 40.0.0.1, 00:00:34, FastEthernet1/0
C 40.0.0.0/8 is directly connected, FastEthernet1/0
O E2 10.0.0.0/8 [110/200] via 40.0.0.1, 00:00:34, FastEthernet1/0
O 60.0.0.0/8 [110/65] via 50.0.0.2, 00:00:34, Serial0/0
O IA 30.0.0.0/8 [110/2] via 40.0.0.1, 00:00:34, FastEthernet1/0
R4-jin#
R4-jin#show ip ospf databas
OSPF Router with ID (50.0.0.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 186 0x80000003 0x00F6CC 1
50.0.0.1 50.0.0.1 414 0x80000003 0x0083F2 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
40.0.0.1 3.3.3.3 478 0x80000001 0x00CDF7
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
30.0.0.0 3.3.3.3 166 0x80000005 0x00A964
50.0.0.0 50.0.0.1 409 0x80000001 0x00B5E1
60.0.0.0 50.0.0.1 99 0x80000001 0x003D4F
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
5.5.5.5 5.5.5.5 113 0x80000005 0x00B2E0 3
50.0.0.1 50.0.0.1 133 0x80000005 0x009928 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 50.0.0.1 170 0x80000001 0x00E723
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.0.0.0 3.3.3.3 175 0x80000001 0x008134 0
20.0.0.0 3.3.3.3 175 0x80000001 0x00FEAC 0
R5
R5-jin(config)#router ospf 1
R5-jin(config-router)#area 2 stub
R5-jin(config-router)#end
R5-jin#show ip route
C 50.0.0.0/8 is directly connected, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
C 60.0.0.0/8 is directly connected, FastEthernet1/0
O*IA 0.0.0.0/0 [110/65] via 50.0.0.1, 00:00:28, Serial0/0 ――默认路由(包含区间和外部)
R5-jin#
R5-jin#show ip ospf database
OSPF Router with ID (5.5.5.5) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
5.5.5.5 5.5.5.5 161 0x80000005 0x00B2E0 3
50.0.0.1 50.0.0.1 161 0x80000005 0x009928 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 50.0.0.1 199 0x80000001 0x00E723
R5-jin#
三、配置PC,验证!
VPCS 1 >
VPCS 1 >show
VPCS 1 >ip 10.0.0.2 10.0.0.1 8
VPCS 1 >2
VPCS 2 >ip 60.0.0.2 60.0.0.1 8
VPCS 2 >show
NAME IP/CIDR GATEWAY LPORT RPORT
PC1 10.0.0.2/8 10.0.0.1 10001 11100
PC2 60.0.0.2/8 60.0.0.1 10002 11510
PC3 0.0.0.0/0 0.0.0.0 10003 30002
PC4 0.0.0.0/0 0.0.0.0 10004 30003
PC5 0.0.0.0/0 0.0.0.0 10005 30004
PC6 0.0.0.0/0 0.0.0.0 10006 30005
PC7 0.0.0.0/0 0.0.0.0 10007 30006
PC8 0.0.0.0/0 0.0.0.0 10008 30007
PC9 0.0.0.0/0 0.0.0.0 10009 30008
VPCS 2 >ping 10.0.0.2
10.0.0.2 icmp_seq=1 timeout
10.0.0.2 icmp_seq=2 time=219.000 ms
10.0.0.2 icmp_seq=3 time=219.000 ms
10.0.0.2 icmp_seq=4 time=218.000 ms
10.0.0.2 icmp_seq=5 time=219.000 ms
VPCS 2 >
OK!!! 成功完成!!!