OSPF之虛鏈路(內有配套實驗詳細過程)

OSPF虛鏈路bash

虛鏈路:app

指一條經過一個非骨幹區域鏈接到骨幹區域的鏈路ide

虛鏈路的目的:oop

經過一個非骨幹區域鏈接一個區域到骨幹區域學習

經過一個非骨幹區域鏈接一個分段的骨幹區域測試

配置虛鏈路的規則及特色:spa

虛鏈路必須配置在兩臺ABR路由器之間3d

傳送區域不能是一個末梢區域code

虛鏈路的穩定性取決於其通過的區域的穩定性router

虛鏈路有助於提供邏輯冗餘

虛鏈路的配置命令:

Router(config-router)# area area-id vritual-link router-id

OSPF虛鏈路配置實驗:

實驗拓撲圖以下:

image.png

實驗環境準備:GNS三、CRT

實驗內容:

一、四臺pc路由器、兩臺pc機,

二、設置一個area0爲骨幹區域,一個area1和一個area2爲標準區域。

三、R2爲ABR

實驗步驟:

一、配置路由IP及宣告網段

R1:

R1#conf t                        進入全局模式
R1(config)#int f0/0     進入接口F0/0
R1(config-if#ip add 192.168.10.1 255.255 255.0  配置IP
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  配置IP地址
R1(config-if)#no shut  開啓
R1(config-if#ex    
R1(config)#int lo 0
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
R1(config-router)#router-id 1.1.1.1                   配置router ID
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

image.png

image.png

R2:

R2#conft   進入全家模式
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
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
R2(config-router)#router-id 2.2.2.2             配置router id
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
R2(config-router)#ex

image.png

image.png

R3:

R3#conf t  進入全局模式
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  配置接口0/1
R3(config-if)#ip add 192.16840.1 255 255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#int lo 0
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
R3(config-router)#router-id 3.3.3.3    配置router id
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

image.png

image.png

R4:

R4#conft進入全局模式
R4(config)#int f0/O  配置接口F0/0
R4(config-if)#ip add 192. 16840.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
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   
R4(config-router)#router-id 4.4.4.4    配置router id
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

image.png

image.png

二、檢查各個路由器之間網段的學習狀況

R1:

R1(config #do show ip route     查看RI網段學習狀況
...此處省略部分
        1.0.0.0/32 is subnetted, 1 subnets
C         1.1.1.1 is directly connected, Loopbacke
C       192.168.10.0/24 is directly connected, FastEthernete/0
C       192.168.20.0/24 is directly connected, FastEthernete/1

image.png

R2:

R2(config)#do show ip route            查看R2網段學習狀況
.....處省略部分
           2.0.0.0/32 is subnetted, 1 subnets
C               2.2.2.2 is directly connected, Loopbacke
C         192.168.30.0/24 is directly connected, FastEthernet8/1
C         192.168.10.0/24 [110/20] via 192.168.20.1, 00:15:57, FastEthernet0/0
0 IA 192.168 40.0/24 [110/20] via 192.168.30.2, 00:08:28, FastEthernet8/1
C         192 168.20.0/24 is directly connected, FastEthernete/0
0 IA 192.168.50.0/24 [110/30] via 192.168.30.2, 00:03:29, FastEthernet0/1

image.png

R3:

R3( config)#do show ip route            查看R3網段學習狀況
.... 此處省略部分
          3.0.0.0/32 is subnetted, 1 subnets
C             3.3.3.3 is directly connected, Loopbacke
C        192.168.30.0/24 is directly connected, FastEthernete/0
C        192.168. 40.0/24 is directly connected, FastEthernet0/1
0         192.168. 50.0/24 [110/20] via 192.168 40.2, 00:10:35, FastEthernete/1

image.png

R4:

R4(config )#do show ip route            查看R4網段學習狀況
....處省略部分
0 IA 192.16830.0/24 [110/20] via 192.168.40.1, 00:12:42, FastEthernet0/0
        4.0.0.0/32 is subnetted, 1 subnets
C     192.168.40.0/24 is directly connected, FastEthernete/0
C     192.168.50.0/24 is directly connected, FastEthernet8/1

image.png

三、配置兩臺pc機的IP地址和網關,並測試兩臺pc機間的互聯互通狀態

PC1>ip 192.168.10.2 192.168.10.1    配置pc1IP地址
PC2>ip 192 168.50.2 192.168.50.1    配置pc2IP地址
PC1> ping 192.168.50.2              用pc1去ping。失敗。
*192.168.10.1 icmp seq=1 tt1=255 time=19.999 ms (ICMP type:3, code:1, Destination host unreachable)

//沒法ping通。這個時候就須要來作虛鏈路,進而達到互聯互通的目的

image.png

image.png

image.png

四、配置虛鏈路

R2:

R2(config)#router ospf 1
R2(config-router)#area 1 vitual-link 3.3.3.3 //area1爲穿越區域, 寫上R3的router-id

image.png

R3:

R3(config)#router ospf 1
R3(config-router)#area 1 vitual-link 2.2.2.2 //area1爲穿越區域, 寫上R2的router-id

image.png

五、再次檢查兩臺pc機間的互聯互通狀態,已檢測虛鏈路的配置結果

PC1> ping 192.168.50.2
192.168.50.2 icmp_ seq=1 timeout
84 bytes from 192.168.50.2 icmp_ seq=2 tt1-60 time=82.984 ms
//顯示狀態連通

image.png

ping通,實驗成功。

經過實驗咱們能夠得出結論:

虛鏈路的設置能夠讓與骨幹區域相隔的標準區域在非直連狀態下與之達成互通

相關文章
相關標籤/搜索