ospf 動態路由協議 virtual link Cisco

1:OSPF虛鏈路的作用是什麼?在哪些路由器上需要建立虛鏈路?

     1:虛鏈路可以將不連續的區域0連接起來

     2:還可將區域通過中轉區域連接到區域0,兩個路由器有共同的非骨幹區域

2:OSPF協議的區域0是什麼?能不能沒有區域0?

     骨幹區域,不可以沒有

3:OSPF路由器的router-id如何查看?爲了OSPF網絡的穩定,應該如何指定

     Show ip ospf int

     分開指定

4:OSPF的路由表選擇的路徑是以帶寬和延遲爲依據還是以經過的路由器多少?

     帶寬和延遲爲依據

拓撲圖:

配置代碼:

R1
enable
config terminal
host r1
no ip domain-lookup
int g0/0
ip address 192.168.1.1 255.255.255.0
no shut
exit
router ospf 100 
!進程號,1-65535中任意數,且這個是路由器本地進程號,即其它路由器也可以設置一樣的進程號
network 192.168.1.0 0.0.0.255 area 1
router-id 192.168.1.1  
!這個路由器有多個接口,誰代表本區域跟別的交換鏈路狀態數據報呢?就是路由id是誰呢?指定路由id,不指定也會進行選舉(優先級一樣時,誰的ip地址大,就做)
end
Show ip route
Show ip ospf
!要查看某一路由器的ID,可以這樣查看show ip ospf

R2
enable
config terminal
host r2
no ip domain-lookup
int g0/0
ip address 192.168.1.2 255.255.255.0
no shut
int g0/1
ip address 192.168.2.1 255.255.255.0
no shut
exit
router ospf 100
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 0
router-id 192.168.2.1
end
Show ip route
Show ip ospf

R3
enable
config terminal
host r3
no ip domain-lookup
!下面設置接口的IP參數
int g0/0
ip address 192.168.2.2 255.255.255.0
no shut
int g0/1
ip address 192.168.3.1 255.255.255.0
no shut
int loopback 0
!環回口,一般常用環回口來做router-id
ip address 3.3.3.3 255.255.255.255
no shut
exit
router ospf 100
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 2
router-id 3.3.3.3
!一般常用環回口來做router-id
area 2 virtual-link 4.4.4.4
!在建立虛鏈路前先顯示路由表,然後建立虛鏈接時指定對端路由器ID
!R3(config-router)#area  2  virtual-link  4.4.4.4    //2爲要穿越的區域(R4-ID) 
!一定要記住區域編號爲穿越經過的區域,而不是需要連接的區域
!要查看某一路由器的ID,可以這樣查看show ip ospf
end
Show ip route
Show ip ospf

R4
enable
config terminal
host r4
no ip domain-lookup
int g0/0
ip address 192.168.3.2 255.255.255.0
no shut
int g0/1
ip address 192.168.4.1 255.255.255.0
no shut
int loopback 0
ip address 4.4.4.4 255.255.255.255
no shut
exit
router ospf 100
network 192.168.3.0 0.0.0.255 area 2
network 192.168.4.0 0.0.0.255 area 3
router-id 4.4.4.4
area 2 virtual-link 3.3.3.3
!在建立虛鏈路前先顯示路由表,然後建立虛鏈接時指定對端路由器ID
!R4(config-router)#area  2  virtual-link  3.3.3.3    //2爲要穿越的區域(R3-ID)  
!一定要記住區域編號爲穿越經過的區域,而不是需要連接的區域
!要查看某一路由器的ID,可以這樣查看show ip ospf
end
Show ip route
Show ip ospf

R5
enable
config terminal
host r5
no ip domain-lookup
int g0/0
ip address 192.168.4.2 255.255.255.0
no shut
int loopback 0
ip address 5.5.5.5 255.255.255.255
no shut
exit
router ospf 100
network 192.168.4.0 0.0.0.255 area 3
router-id 5.5.5.5
end
Show ip route
Show ip ospf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章