實驗拓撲圖redis
實驗描述:PE-R一、P-R二、PE-R3運行的IGP爲OSPF,所屬area 0,且運行MPLS,PE-R一、PE-R3配置MP-BGP,CE-R五、CE-R7路由器與PE路由器運行OSPF協議,且屬於骨幹區域0,配置MPLS ×××實現CE-R5與CE-R7互通;網絡
1、PE-R1與PE-R3對於VRF Ting運行不一樣的OSPF進程時,對CE端的OSPF路由狀況分析dom
部份配置以下:ide
PE-R1:
oop
router ospf 12 vrf Tingspa
redistribute bgp 100 subnetsrouter
network 15.1.1.0 0.0.0.3 area 0blog
router bgp 100接口
no bgp default ipv4-unicast進程
address-family ipv4 vrf Ting
redistribute ospf 12 match internal external 1 external 2
CE-R5:
router ospf 12
router-id 5.5.5.5
network 5.5.5.5 0.0.0.0 area 0
network 15.1.1.0 0.0.0.3 area 0
PE-R3:
router ospf 13 vrf Ting
redistribute bgp 100 subnets
network 37.1.1.0 0.0.0.3 area 0
router bgp 100
no bgp default ipv4-unicast
address-family ipv4 vrf Ting
redistribute ospf 13 match internal external 1 external 2
CE-R7:
router ospf 13
router-id 7.7.7.7
redistribute static subnets
network 7.7.7.7 0.0.0.0 area 0
network 37.1.1.0 0.0.0.3 area 0
ip route 77.1.1.1 255.255.255.255 Null0
CE-R5查看路由:
R5#show ip route
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
7.0.0.0/32 is subnetted, 1 subnets
O E2 7.7.7.7 [110/2] via 15.1.1.1, 00:05:56, FastEthernet0/0
15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 15.1.1.0/30 is directly connected, FastEthernet0/0
L 15.1.1.2/32 is directly connected, FastEthernet0/0
37.0.0.0/30 is subnetted, 1 subnets
O E2 37.1.1.0 [110/1] via 15.1.1.1, 00:05:56, FastEthernet0/0
77.0.0.0/32 is subnetted, 1 subnets
O E2 77.1.1.1 [110/20] via 15.1.1.1, 00:05:56, FastEthernet0/0
CE-R7過來的OSPF路由爲E2(外部路由)
CE-R7查看路由:
R7#show ip route
5.0.0.0/32 is subnetted, 1 subnets
O E2 5.5.5.5 [110/2] via 37.1.1.1, 00:09:16, FastEthernet0/0
7.0.0.0/32 is subnetted, 1 subnets
C 7.7.7.7 is directly connected, Loopback0
15.0.0.0/30 is subnetted, 1 subnets
O E2 15.1.1.0 [110/1] via 37.1.1.1, 00:09:16, FastEthernet0/0
37.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 37.1.1.0/30 is directly connected, FastEthernet0/0
L 37.1.1.2/32 is directly connected, FastEthernet0/0
77.0.0.0/32 is subnetted, 1 subnets
S 77.1.1.1 is directly connected, Null0
在R1上查看5.5.5.5與7.7.7.7的BGP ×××V4路由詳細信息
R1#show ip bgp ***v4 all 5.5.5.5
BGP routing table entry for 100:11:5.5.5.5/32, version 6
Paths: (1 available, best #1, table Ting)
Advertised to update-groups:
1
Refresh Epoch 1
Local
15.1.1.2 from 0.0.0.0 (1.1.1.1)
Origin incomplete, metric 2, localpref 100, weight 32768, valid, sourced, best
Extended Community: RT:100:14 OSPF DOMAIN ID:0x0005:0x0000000C0200
OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:15.1.1.1:0
mpls labels in/out 105/nolabel
R1#show ip bgp ***v4 all 7.7.7.7
BGP routing table entry for 100:11:7.7.7.7/32, version 13
Paths: (1 available, best #1, table Ting)
Not advertised to any peer
Refresh Epoch 1
Local
3.3.3.3 (metric 3) from 3.3.3.3 (3.3.3.3)
Origin incomplete, metric 2, localpref 100, valid, internal, best
Extended Community: RT:100:13 OSPF DOMAIN ID:0x0005:0x0000000D0200
OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:37.1.1.1:0
mpls labels in/out nolabel/305
在R1上查看5.5.5.5與7.7.7.7的BGP ×××V4詳細信息,可知兩條路由的DOMAIN ID不相同,也就是進程號不一樣,可用show ip ospf 查看
R1#show ip ospf 12
Routing Process "ospf 12" with ID 15.1.1.1
Domain ID type 0x0005, value 0.0.0.12
R3#show ip ospf 13
Routing Process "ospf 13" with ID 37.1.1.1
Domain ID type 0x0005, value 0.0.0.13
總結:PE路由器將CE端OSPF路由重分佈至MP-BGP中時,其可以承載OSPF的屬性值,當兩PE路由器中的同一VRF中的OSPF DOMAIN ID(進程號)不一樣時,進行重分佈後,在CE端查看到的OSPF路由爲E2類型(不一樣進程之間重分佈屬於外部路由)。
PS:DOMAIN ID能夠配置修改
R3(config)#router ospf 12 vrf Ting
R3(config-router)#domain-id 0.0.0.12
二、PE-R1與PE-R3對於VRF Ting運行相同的OSPF進程時,對CE端的OSPF路由狀況分析
在上述狀況下修改PE-R3的配置,其它設備配置不變,以下:
PE-R3:
router ospf 12 vrf Ting //與PE-R1相同
redistribute bgp 100 subnets
network 37.1.1.0 0.0.0.3 area 0
router bgp 100
no bgp default ipv4-unicast
address-family ipv4 vrf Ting
redistribute ospf 12 match internal external 1 external 2
查看CE端路由
R5#show ip route
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
7.0.0.0/32 is subnetted, 1 subnets
O IA 7.7.7.7 [110/3] via 15.1.1.1, 00:00:22, FastEthernet0/0
15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 15.1.1.0/30 is directly connected, FastEthernet0/0
L 15.1.1.2/32 is directly connected, FastEthernet0/0
37.0.0.0/30 is subnetted, 1 subnets
O IA 37.1.1.0 [110/2] via 15.1.1.1, 00:00:22, FastEthernet0/0
77.0.0.0/32 is subnetted, 1 subnets
O E2 77.1.1.1 [110/20] via 15.1.1.1, 00:00:22, FastEthernet0/0
//在CE-R7重分佈靜態,在OSPF路由中將會顯示爲外部路由,其屬性值通過MP-BGP承載至CE-R5
R7#show ip route
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/3] via 37.1.1.1, 00:03:32, FastEthernet0/0
7.0.0.0/32 is subnetted, 1 subnets
C 7.7.7.7 is directly connected, Loopback0
15.0.0.0/30 is subnetted, 1 subnets
O IA 15.1.1.0 [110/2] via 37.1.1.1, 00:03:32, FastEthernet0/0
37.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 37.1.1.0/30 is directly connected, FastEthernet0/0
L 37.1.1.2/32 is directly connected, FastEthernet0/0
77.0.0.0/32 is subnetted, 1 subnets
S 77.1.1.1 is directly connected, Null0
以上路由可知,CE端查看到的路由爲域間路由;
在R1上查看5.5.5.5與7.7.7.7的BGP ×××V4路由詳細信息
R1#show ip bgp ***v4 all 5.5.5.5
BGP routing table entry for 100:11:5.5.5.5/32, version 6
Paths: (1 available, best #1, table Ting)
Advertised to update-groups:
1
Refresh Epoch 1
Local
15.1.1.2 from 0.0.0.0 (1.1.1.1)
Origin incomplete, metric 2, localpref 100, weight 32768, valid, sourced, best
Extended Community: RT:100:14 OSPF DOMAIN ID:0x0005:0x0000000C0200
OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:15.1.1.1:0
mpls labels in/out 105/nolabel
R1#show ip bgp ***v4 all 7.7.7.7
BGP routing table entry for 100:11:7.7.7.7/32, version 40
Paths: (1 available, best #1, table Ting)
Not advertised to any peer
Refresh Epoch 1
Local
3.3.3.3 (metric 3) from 3.3.3.3 (3.3.3.3)
Origin incomplete, metric 2, localpref 100, valid, internal, best
Extended Community: RT:100:13 OSPF DOMAIN ID:0x0005:0x0000000C0200
OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:37.1.1.1:0
mpls labels in/out nolabel/308
從以上輸出信息,可知兩條路由的DOMAIN ID相同,也就是進程號相同都爲12,
可用show ip ospf 12查看
R1#show ip ospf 12
Routing Process "ospf 12" with ID 15.1.1.1
Domain ID type 0x0005, value 0.0.0.12
R3#show ip ospf 12
Routing Process "ospf 12" with ID 37.1.1.1
Domain ID type 0x0005, value 0.0.0.12
總結:PE路由器將CE端OSPF路由重分佈至MP-BGP中時,其可以承載OSPF的屬性值,當兩PE路由器中的同一VRF中的OSPF DOMAIN ID(進程號)相同時,進行重分佈後,在CE端查看到的OSPF路由爲域間路由;
當PE路由器鏈接多個OSPF區域,MPLS ×××骨幹網絡被認爲是高於OSPF骨幹區域的一個附加層面,超級骨幹網絡(Super Backbone)。
三、在R7的上配置一個loopback 100,將其接口劃在OSPF區域1中;
R7(config-if)#router ospf 13
R7(config-router)#network 99.9.9.9 0.0.0.0 area 1
R1#show ip bgp ***v4 all 99.9.9.9
BGP routing table entry for 100:11:99.9.9.9/32, version 44
Paths: (1 available, best #1, table Ting)
Not advertised to any peer
Refresh Epoch 1
Local
3.3.3.3 (metric 3) from 3.3.3.3 (3.3.3.3)
Origin incomplete, metric 2, localpref 100, valid, internal, best
Extended Community: RT:100:13 OSPF DOMAIN ID:0x0005:0x0000000C0200
OSPF RT:0.0.0.0:3:0 OSPF ROUTER ID:37.1.1.1:0 //路由屬於OSPF 3 LSA
mpls labels in/out nolabel/306
R5#show ip rout
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
7.0.0.0/32 is subnetted, 1 subnets
O IA 7.7.7.7 [110/3] via 15.1.1.1, 00:17:53, FastEthernet0/0
15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 15.1.1.0/30 is directly connected, FastEthernet0/0
L 15.1.1.2/32 is directly connected, FastEthernet0/0
37.0.0.0/30 is subnetted, 1 subnets
O IA 37.1.1.0 [110/2] via 15.1.1.1, 00:17:53, FastEthernet0/0
77.0.0.0/32 is subnetted, 1 subnets
O E2 77.1.1.1 [110/20] via 15.1.1.1, 00:17:53, FastEthernet0/0
99.0.0.0/32 is subnetted, 1 subnets
O IA 99.9.9.9 [110/3] via 15.1.1.1, 00:06:01, FastEthernet0/0
R1查看99.9.9.9的MP-BGP路由信息,可知該路由爲域間路由,重分佈至OPSF中時,其路由屬性未發生變化,今後可知MP-BGP可以承載OSPF路由屬性。