OSPF
虚链路实验报告
1.
实验拓扑:
2.
实验目的:
2.1
按照拓扑图正确连接三台路由器。
2.2
正确配置相应的接口
IP
地址
2.3
配置
OSPF
虚链路把不与主干区域相连的区域逻辑连接
( Config-router)#area
区域号
virtual-link
对方路由
ID
3.
详细配置步骤:
Setp 1.
配置路由器
BJ1,SH1.GZ1
相应的接口
IP
地址
BJ1
配置如下
:
BJ1(config)#int loop0
BJ1(config-if)#ip
BJ1(config-if)#ip add 192.168.1.3 255.255.255.0
BJ1(config-if)#int f0/0
BJ1(config-if)#ip add 192.168.224.2 255.255.255.0
BJ1(config-if)#no shut
BJ1(config-if)#
GZ1
配置如下:
GZ1(config)#int loop0
GZ1(config-if)#ip add 192.168.3.1 255.255.255.0
GZ1(config-if)#int f0/0
GZ1(config-if)#ip add 192.168.224.1 255.255.255.0
GZ1(config-if)#no shut
GZ1(config-if)#int s1/0
GZ1(config-if)#ip add 192.168.240.1 255.255.255.252
GZ1(config-if)#no shut
GZ1(config-if)#
路由器
SH1
配置如下
:
SH1(config)#int loop0
SH1(config-if)#ip add 192.168.252.1 255.255.255.0
SH1(config-if)#int f0/0
SH1(config-if)#ip add 192.168.248.1 255.255.255.0
SH1(config-if)#no shut
SH1(config-if)#int s1/0
SH1(config-if)#ip add 192.168.240.2 255.255.255.252
SH1(config-if)#no shut
SH1(config-if)#
step2 .
配置
OSPF
路由协议
BJ1
配置如下
:
BJ1(config)#router ospf 7
BJ1(config-router)#net 192.168.1.0 0.0.0 .255 area 0
BJ1(config-router)#net 192.168.224.0 0.0.0 .255 area 51
BJ1#config-router)#
GZ1
配置如下:
GZ1(config)#router ospf 7
GZ1(config-router)#net 192.168.3.0 0.0.0 .255 area 51
GZ1(config-router)#net 192.168.224.0 0.0.0 .255 area 51
GZ1(config-router)#net 192.168.240.0 0.0.0 .3 area 3
GZ1(config-router)#end
路由器
SH1
配置如下
:
SH1(config)#router ospf 7
SH1(config-router)#net 192.168.240.0 0.0.0 .3 area 3
SH1(config-router)#
查看
SH1
路由表
SH1#show 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
192.168.240.0/30 is subnetted, 1 subnets
C 192.168.240.0 is directly connected, Serial1/0
C 192.168.248.0/24 is directly connected, FastEthernet0/0
C 192.168.252.0/24 is directly connected, Loopback0
Step3
配置
OSPF
虚链路
BJ1
配置如下
:
BJ1#ping 192.168.240.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.240.2, timeout is 2 seconds:
…..
//
此时
BJ1
不能与
SH1
通信
Success rate is 80 percent (4/5), round-trip min/avg/max = 76/84/92
ms
查看邻居列表:
BJ1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.3.1 1 FULL/DR 00:00:30 192.168.224.1
FastEthernet0/
BJ1(config-router)#area 51 virtual-link 192.168.3.1
BJ1(config-router)#
GZ1
配置如下:
查看邻居列表:
GZ1#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
192.168.252.1 0 FULL/ - 00:00:32 192.168.240.2 Serial1/0
192.168.1.3 1 FULL/BDR 00:00:39 192.168.224.2 FastEthernet0/0
GZ1(config)#router ospf 7
GZ1(config-router)#area 51 virtual-link 192.168.1.3
GZ1(config-router)#
验证:
查看
BJ1
路由表
BJ1#show 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
C 192.168.224.0/24 is directly connected, FastEthernet0/0
192.168.240.0/30 is subnetted, 1 subnets
O IA 192.168.240.0 [110/65] via 192.168.224.1, 00:00:05, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Loopback0
192.168.3.0/32 is subnetted, 1 subnets
O 192.168.3.1 [110/2] via 192.168.224.1, 00:00:15, FastEthernet0/0
BJ1#ping 192.168.240.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.240.2, timeout is 2 seconds:
!!!!!
//
此时
BJ1
与
SH1
通信
Success rate is 80 percent (4/5), round-trip min/avg/max = 76/84/92
ms
查看
GZ1
路由表
GZ1#show 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
C 192.168.224.0/24 is directly connected, FastEthernet0/0
192.168.240.0/30 is subnetted, 1 subnets
C 192.168.240.0 is directly connected, Serial1/0
192.168.1.0/32 is subnetted, 1 subnets
O IA 192.168.1.3 [110/2] via 192.168.224.2, 00:00:01, FastEthernet0/0
C 192.168.3.0/24 is directly connected, Loopback0
查看
SH1
路由表
SH1#show 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
O IA 192.168.224.0/24 [110/65] via 192.168.240.1, 00:01:33, Serial1/0
192.168.240.0/30 is subnetted, 1 subnets
C 192.168.240.0 is directly connected, Serial1/0
C 192.168.248.0/24 is directly connected, FastEthernet0/0
C 192.168.252.0/24 is directly connected, Loopback0
192.168.3.0/32 is subnetted, 1 subnets
O IA 192.168.3.1 [110/65] via 192.168.240.1, 00:01:33, Serial1/0
试验总结:
OSPF
虚链路:使把
不与主干区域相连的区域逻辑连接。
条件:
必须在两个
ABR
之间配置,且至少一个
ABR
和主干区域相连
不可以在末梢区域配置虚链路
(
config-router
)
#area
区域号
vritual-link
对方路由
ID