1. 程式人生 > >OSPF虛擬鏈路實驗

OSPF虛擬鏈路實驗

one outer ip地址 configure 1.0 connected 51cto sha rec

技術分享圖片
實驗OSPF虛擬鏈路
當非主幹區域不能直接和主幹區域相連的情況下,需要通過中間的過度區域建立虛擬連接。在ABR之間建立,使用對方的route-ID 做標識。
配置思路:
1、 配置ip地址
2、 配置ospf路由
3、 配置虛擬鏈路
4、 查看路由驗證結果

R0配置參考
Router #conf t
Router(config)#hostname R0
R0(config)#interface FastEthernet0/0
R0(config-if)#ip address 200.1.1.1 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#exit
R0(config)#interface loopback 0

R0(config-if)#ip add 192.168.1.1 255.255.255.0
R0(config-if)#exit

配置OSPF路由
R0(config)#router ospf 1
R0(config-router)#network 192.168.1.0 0.0.0.255 area 0
R0(config-router)#network 200.1.1.0 0.0.0.255 area 1
R0(config-router)#end
R0#show ip route
C 192.168.1.0/24 is directly connected, Loopback0
C 200.1.1.0/24 is directly connected, FastEthernet0/0

O 200.1.2.0/24 [110/2] via 200.1.1.2, 00:00:14, FastEthernet0/0
查看路由沒有區域2的路由條目

R0#show ip protocols 查看router-ID

Router ID 192.168.1.1
R0#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R0(config)#router ospf 1
R0(config-router)#area 1 virtual-link 172.16.1.1
R0(config-router)#end
R0#
R0#show ip route
172.16.0.0/32 is subnetted, 1 subnets

O IA 172.16.1.1 [110/3] via 200.1.1.2, 00:00:00, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Loopback0
C 200.1.1.0/24 is directly connected, FastEthernet0/0
O 200.1.2.0/24 [110/2] via 200.1.1.2, 00:03:13, FastEthernet0/0

R1配置參考
Router>
Router>en
Router#conf t
Router(config)#hostname R1

R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 200.1.1.2 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface FastEthernet0/1
R1(config-if)#ip address 200.1.2.1 255.255.255.0
R1(config-if)#no shutdown

R1(config-if)#
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-R1)#network 200.1.1.0 0.0.0.255 area 1
R1(config-R1)#network 200.1.2.0 0.0.0.255 area 1
R1(config-R1)#

R2配置參考

Router>enable
Router#configure terminal
Router(config)#hostname R2

Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 200.1.2.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface loopback 0
Router(config-if)#ip add 172.16.1.1 255.255.255.0
Router(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#network 172.16.1.0 0.0.0.255 area 2
R2(config-router)#network 200.1.2.0 0.0.0.255 area 1
R2#show ip protocols 查看ROUTER-ID

Routing Protocol is "ospf 1"
Router ID 172.16.1.1

配置虛擬鏈路
R2#conf t
R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 192.168.1.1

OSPF虛擬鏈路實驗