實驗等級:Professional
實驗拓撲:
實驗分析:
上面這個網絡的設計在OSPF中是比較失敗的,因為OSPF建議所有的非骨幹區域都和骨幹區域直連。上面這個網絡的設計将會導緻Area2的資料和Area0無法通信。為了解決這個問題,一種方法可以在R3和R1上增加一條實體鍊路。還有一種過渡的方法就是使用虛鍊路。
實驗基本配置:
R1:
interface Loopback0
ip address 1.1.1 .1 255.255.255.0
ip ospf network point-to-point
!
interface Serial1/0
ip address 10.1.1 .1 255.255.255.0
serial restart-delay 0
!
router ospf 10
router-id 1.1.1 .1
log-adjacency-changes
network 10.1.1 .0 0.0.0.255 area 0
R2:
interface Loopback0
ip address 2.2.2 .2 255.255.255.0
!
interface Serial1/0
ip address 10.1.1 .2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 11.1.1 .1 255.255.255.0
serial restart-delay 0
!
router ospf 10
router-id 2.2.2 .2
log-adjacency-changes
network 10.1.1 .0 0.0.0.255 area 0
network 11.1.1 .0 0.0.0.255 area 1
R3:
interface Loopback0
ip address 3.3.3 .3 255.255.255.0
!
interface Serial1/0
ip address 11.1.1 .2 255.255.255.0
serial restart-delay 0
!
router ospf 10
router-id 3.3.3 .3
log-adjacency-changes
network 3.3.3 .0 0.0.0.255 area 2
network 11.1.1 .0 0.0.0.255 area 1
我們在R1上檢視路由表,發現沒有R3的Loopback接口路由:
R1#sho 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
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.1 .0 is directly connected, Loopback0
10.0.0 .0/24 is subnetted, 1 subnets
C 10.1.1 .0 is directly connected, Serial1/0
11.0.0 .0/24 is subnetted, 1 subnets
O IA 11.1.1 .0 [110/128] vi a 10.1.1 .2, 00:04:50, Serial1/0
為了讓R1學習到R3的路由,我們配置虛鍊路。
虛鍊路的配置:
虛鍊路必須配置在ABR上,在這個網絡中ABR是R2和R3。
虛鍊路的配置使用的指令是area transit-area-id virtual-link router-id。我們現在在R2和R3上進行配置。
R2(config)#router ospf 10
R2(config-router)#area 1 virtual-link 3.3.3 .3
R3(config)#router ospf 10
R3(config-router)#area 1 virtual-link 2.2.2 .2
等虛鍊路起來後,我們檢視其狀态:
R2#sho ip ospf virtual-links
Virtual Link OSPF_VL0 to router 3.3.3 .3 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface Serial1/1, Cost of using 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Adjacency State FULL (Hello suppressed)
Index 2/3, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransmission scan time is 0 msec, maximum is 0 msec
在上面的資訊中我們可以看到。虛鍊路在邏輯上是等同于一條實體的按需鍊路,既隻有在兩端路由器的配置有變動的時候才進行更新,并且使用的是不老化(DoNotAge)LSA,既虛鍊路是無須Hello包控制的。
R1#sho 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
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.1 .0 is directly connected, Loopback0
3.0.0 .0/32 is subnetted, 1 subnets
O IA 3.3.3 .3 [110/129] vi a 10.1.1 .2, 00:03:02, Serial1/0
10.0.0 .0/24 is subnetted, 1 subnets
C 10.1.1 .0 is directly connected, Serial1/0
11.0.0 .0/24 is subnetted, 1 subnets
O IA 11.1.1 .0 [110/128] vi a 10.1.1 .2, 00:03:02, Serial1/0
這時看到R1已經學習到了R3環回口的路由。Metric值為129,虛鍊路的Metric等同于所經過的全部鍊路開銷之和,在這個網絡中,Metric=1(Loopback)+64+64=129。
在R1上檢視OSPF資料庫:
R1#show ip ospf database
OSPF Router with ID ( 1.1.1 .1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1 .1 1.1.1 .1 797 0x80000002 0x00B 9C 0 2
2.2.2 .2 2.2.2 .2 369 0x80000004 0x00DD29 3
3.3.3 .3 3.3.3 .3 6 (DNA) 0x80000002 0x008B35 1
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
3.3.3 .3 3.3.3 .3 12 (DNA) 0x80000001 0x00AE75
11.1.1 .0 2.2.2 .2 789 0x80000001 0x0029BE
11.1.1 .0 3.3.3 .3 12 (DNA) 0x80000001 0x000BD8
這裡的(DNA)就是DoNotAge。
總結:
虛鍊路被看成網絡設計失敗的一種補救手段,它不僅可以讓沒有和骨幹區域直連的非骨幹區域在邏輯上建立一條鍊路,還可以連接配接兩個分離的骨幹區域。但是由于虛鍊路的配置會造成日後維護和排錯的困難。是以在進行網絡設計的時候,不能将虛鍊路考慮進去。