OSPF routing protocol - virtual link configuration (practical operation!)

Experimental topology structure:

Screenshot micro-channel _20190916010339.png

Purpose:

AREA0 is the backbone of the region, AREA1, AREA2 standard area

Ospf need to connect the region with the Central African Backbone backbone area, or can not communicate, but the interface to the backbone area is limited only by setting the virtual link before establishing communication is not connected with the backbone area.

Environment settings:

R1:

f0 / 0 (192.168.10.1/24)

f0 / 1 (192.168.20.1/24)

R2:

f0 / 0 (192.168.20.2/24)

f0 / 1 (192.168.30.1/24)

R3:

f0 / 0 (192.168.30.2/24)

f0 / 1 (192.168.40.1/24)

R4:

f0 / 0 (192.168.40.2/24)

f0 / 1 (192.168.50.1/24)

PC1:192.168.10.2/24

PC2:192.168.50.2/24

(A) R1 router configuration

R1#conf t 全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0  配置接口f0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0/1  配置接口f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#int loopback 0  设置本地的回环网卡固定IP
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#router ospf 1   设置ospf并宣告网段
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 2
R1(config-router)#network 192.168.20.0 0.0.0.255 area 2

Screenshot micro-channel _20190916010339.png

(二)配置R2路由器

R2#conf t 全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/0  配置f0/0接口
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/1  配置f0/1接口
R2(config-if)#ip add 192.168.30.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#int lo 0 设置本地的回环网卡固定IP
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#router ospf 1 设置ospf并宣告网段
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.20.0 0.0.0.255 area 2
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1

Screenshot micro-channel _20190916014130.png

(三)配置R3路由器

R3#conf t  全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int f0/0  配置接口f0/0
R3(config-if)#ip add 192.168.30.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f0/1  配置接口f0/1
R3(config-if)#ip add 192.168.40.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#int lo 0  配置本地的回环网卡固定IP
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router ospf 1  设置ospf并宣告网段
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.30.0 0.0.0.255 area 1
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0

Screenshot micro-channel _20190916014612.png

(四)配置R4路由器

R4#conf t  全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#int f0/0  配置f0/0接口
R4(config-if)#ip add 192.168.40.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int f0/1  配置f0/1接口
R4(config-if)#ip add 192.168.50.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#int lo 0  设置本地回环网卡固定IP
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#router ospf 1   设置ospf并宣告网段
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 192.168.40.0 0.0.0.255 area 0
R4(config-router)#network 192.168.50.0 0.0.0.255 area 0

Screenshot micro-channel _20190916015021.png

(五)配置PC1,PC2的地址和网关

pc1:

PC1> ip 192.168.10.2 192.168.10.1

Screenshot micro-channel _20190916015201.png

pc2:

PC2> ip 192.168.50.2 192.168.50.1

Screenshot micro-channel _20190916015221.png

(Vi) the test is not set virtual link, pc1 pc2 can ping

Screenshot micro-channel _20190916020914.png

(Vii) disposed in virtual link R2 and R3

R2:

R2 (config) #router ospf 1 process into the ospf. 1 
R2 (config-Router). 1 #area 3.3.3.3 Virtual Link Set-link to the virtual R3

Screenshot micro-channel _20190916015412.png

R3:

R3 (config) #router ospf 1 process into the ospf. 1 
R3 (config-Router). 1 #area 2.2.2.2 Virtual Link Set-link to the virtual R2

Screenshot micro-channel _20190916015537.png

(H) At this point we can see two pc machine interoperability

Screenshot micro-channel _20190916021250.png

OSPF backbone in the Central African region is not directly connected to the backbone area, we can achieve interoperability by providing a virtual link mode.


thanks for reading! ! !

Guess you like

Origin blog.51cto.com/14080162/2438100