mpls *** 的"hub and spoke “模型

 

今天做了很久的mpls ***的hub and spoke 模型的實驗,做到最後老發現,在R5上即使把bgp的路由導入到ospf的vrf a 中在ospf vrf中仍然無法看見遠端***的路由,但是lsa是可達的。在hub  R6中可以獲取***的路由。

R5#show ip route vrf b ospf 

 

Routing Table: b

 

O    192.168.3.0/24 [110/128] via 192.168.4.2, 00:01:16, Serial0/2

R5#show ip route vrf a ospf

 

Routing Table: a

 

O    192.168.4.0/24 [110/128] via 192.168.3.2, 00:01:11, Serial0/1

R5#

 

R5#show ip bgp ***v4 vrf a

BGP table version is 9, local router ID is 3.3.3.3

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

 

   Network          Next Hop            Metric LocPrf Weight Path

Route Distinguisher: 3:3 (default for vrf a)

*>i11.11.11.11/32   1.1.1.1                 65    100      0 ?

*>i22.22.22.22/32   1.1.1.1                 65    100      0 ?

*>i192.168.1.0      1.1.1.1                  0    100      0 ?

*>i192.168.2.0      1.1.1.1                  0    100      0 ?

R5#show ip bgp ***v4 vrf b

爲空

 

R5#show ip ospf 3 database 

 

            OSPF Router with ID (192.168.4.1) (Process ID 3)

 

                Router Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

192.168.3.1     192.168.3.1     1229        0x80000004 0x002852 2

192.168.4.1     192.168.4.1     1209        0x80000004 0x003246 2

192.168.4.2     192.168.4.2     1206        0x80000003 0x00DEB2 4

 

                Summary Net Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum

11.11.11.11     192.168.3.1     940         0x80000001 0x006B76

192.168.1.0     192.168.3.1     940         0x80000001 0x0028BB

 

                Type-5 AS External Link States

 

Link ID         ADV Router      Age         Seq#       Checksum Tag

22.22.22.22     192.168.3.1     925         0x80000001 0x00DA01 3489660929

192.168.2.0     192.168.3.1     925         0x80000001 0x008880 3489660929

 

R5#show ip ospf 2 database 

 

            OSPF Router with ID (192.168.3.1) (Process ID 2)

 

                Router Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

192.168.3.1     192.168.3.1     1393        0x80000004 0x002852 2

192.168.4.1     192.168.4.1     1375        0x80000004 0x003246 2

192.168.4.2     192.168.4.2     1371        0x80000003 0x00DEB2 4

 

                Summary Net Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum

11.11.11.11     192.168.3.1     1104        0x80000001 0x006B76

192.168.1.0     192.168.3.1     1104        0x80000001 0x0028BB

 

                Type-5 AS External Link States

 

Link ID         ADV Router      Age         Seq#       Checksum Tag

22.22.22.22     192.168.3.1     1089        0x80000001 0x00DA01 3489660929

192.168.2.0     192.168.3.1     1089        0x80000001 0x008880 3489660929

R5#show ip route vrf a ospf

 

Routing Table: a

 

O    192.168.4.0/24 [110/128] via 192.168.3.2, 00:23:14, Serial0/1

R5#

R5#show ip route vrf a

 

Routing Table: a

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

 

     22.0.0.0/32 is subnetted, 1 subnets

B       22.22.22.22 [200/65] via 1.1.1.1, 00:19:28

O    192.168.4.0/24 [110/128] via 192.168.3.2, 00:24:00, Serial0/1

     11.0.0.0/32 is subnetted, 1 subnets

B       11.11.11.11 [200/65] via 1.1.1.1, 00:19:43

B    192.168.1.0/24 [200/0] via 1.1.1.1, 00:19:43

B    192.168.2.0/24 [200/0] via 1.1.1.1, 00:19:28

C    192.168.3.0/24 is directly connected, Serial0/1

 

後面發現是少注意了一點技術要點

由於OSPF的防環機制下游比特位和域標,需要在R6配置

router ospf 200 vrf r6in
 log-adjacency-changes
 capability vrf-lite
 redistribute bgp 100 subnets
 network 192.168.100.0 0.0.0.255 area 0
!
router ospf 300 vrf r6out
 log-adjacency-changes
 capability vrf-lite
 redistribute bgp 100 subnets
 network 192.168.200.0 0.0.0.255 area 0
 
router bgp 1
address-family ipv4 vrf r6out
redistribute ospf 300 vrf r6out match internal external 1 external 2 nssa-external 1 nssa-external 2
 no synchronization
 exit-address-family

這是摘自高手的解釋:

支持多VRF的OSPF增加了防止路由環路的功能:如果一條路由曾被從MP-BGP往OSPF中分發的,則PE不允許該路由再從OSPF分發到MP-BGP中。有時如果某個PE與其他PE互聯的P-NETWORK端口都當掉了,唯一可用的是通過某臺CE連接到另外一臺PE的一條***內線路,這時就必須要在這兩臺PE上關閉環路檢測功能,以便OSPF路由順利傳遞,連通整個***。配置命令(OSPF 進程配置模式):capability vrf-lite

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章