实验拓扑图
实验描述:PE-R1、P-R2、PE-R3运行的IGP为OSPF,所属area 0,且运行MPLS,PE-R1、PE-R3配置MP-BGP,CE-R5、CE-R7路由器与PE路由器运行OSPF协议,且属于骨干区域0,配置MPLS ×××实现CE-R5与CE-R7互通;
一、PE-R1与PE-R3对于VRF Ting运行不同的OSPF进程时,对CE端的OSPF路由情况分析
部份配置如下:
PE-R1:
router ospf 12 vrf Ting
redistribute bgp 100 subnets
network 15.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:
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 vpnv4 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 vpnv4 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
2、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 vpnv4 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 vpnv4 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)。
3、在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 vpnv4 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路由属性。