Option B的优势在于取消了的VRF相关的配置,减少了很多表项,减轻了ASBR的负载,通过MP-eBGP在ASBR之间交换***v4的路由,由于取消了VRF,就需要在ASBRs上关掉route-target的过滤:no bgp default route-target filter 。


wKiom1RZxQeAIBU3AAI_SR3DOso214.jpg



每改变一次下一跳,标签就会被重新分配。

R4和R5之间的标签通过BGP来分配。neighbor 45.1.1.5 send-label,在ASBR互联的接口上自动启用mpls bgp forwarding 。R4可以对R2进行next-hop-self,也可以把互联接口的IP重分发进IGP。使得R2的下一跳可达。在ASBR上配置:no bgp default route-target filter


配置步骤:

AS 100 和 AS 200 的IGP和LDP

PE-CE protocol

AS100 和AS200 内的MP-BGP邻居

R4和R7的MP-BGP邻居

ASBRs之间的MP-eBGP,激活之后自动产生mpls bgp forwarding,跟IOS版本有关。有的不需要额外配置。


R2的配置:

ip vrf A

 rd 100:2

 route-target export 100:2

 route-target import 100:2

 route-target import 200:9

 

mpls label range 200 299

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

!

interface FastEthernet0/0

 ip address 23.1.1.2 255.255.255.0

 mpls ip  

!

interface FastEthernet0/1

 ip vrf forwarding A

 ip address 12.1.1.2 255.255.255.0


router eigrp 90

 network 2.2.2.2 0.0.0.0

 network 23.1.1.0 0.0.0.255

 no auto-summary

!

router ospf 110 vrf A

 router-id 2.2.2.2

 log-adjacency-changes

 redistribute bgp 100 subnets

 network 12.1.1.0 0.0.0.255 area 0

!

router bgp 100

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor 4.4.4.4 remote-as 100

 neighbor 4.4.4.4 update-source Loopback0

 !

 address-family ***v4

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf A

  redistribute ospf 110 vrf A match internal external 1 external 2 nssa-external 1 nssa-external 2

  no synchronization

 exit-address-family

!


R4的配置:


!

mpls label range 400 499

!

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

!

interface FastEthernet0/1

 ip address 34.1.1.4 255.255.255.0

 mpls ip

!         

interface Serial1/0

 ip address 47.1.1.4 255.255.255.0


!

router eigrp 90

 network 4.4.4.4 0.0.0.0

 network 34.1.1.0 0.0.0.255

 no auto-summary

!

router bgp 100

 no bgp default ipv4-unicast

 no bgp default route-target filter

 bgp log-neighbor-changes

 neighbor 2.2.2.2 remote-as 100

 neighbor 2.2.2.2 update-source Loopback0

 neighbor 47.1.1.7 remote-as 200

 !

 address-family ***v4

  neighbor 2.2.2.2 activate

  neighbor 2.2.2.2 send-community extended

  neighbor 2.2.2.2 next-hop-self

  neighbor 47.1.1.7 activate

  neighbor 47.1.1.7 send-community extended

 exit-address-family

!

!

R1#traceroute 10.1.1.1 source l0


Type escape sequence to abort.

Tracing the route to 10.1.1.1


  1 12.1.1.2 120 msec 44 msec 28 msec

  2 23.1.1.3 [MPLS: Labels 300/407 Exp 0] 236 msec 228 msec 296 msec

  3 34.1.1.4 [MPLS: Label 407 Exp 0] 252 msec 260 msec 104 msec

  4 47.1.1.7 [MPLS: Label 704 Exp 0] 284 msec 152 msec 216 msec

  5 78.1.1.8 [MPLS: Labels 802/905 Exp 0] 232 msec 184 msec 272 msec

  6 19.1.1.9 [MPLS: Label 905 Exp 0] 148 msec 140 msec 228 msec

  7 19.1.1.10 164 msec *  304 msec

R1#

R2#show bgp ***v4 un all labels 

   Network          Next Hop      In label/Out label

Route Distinguisher: 100:2 (A)

   1.1.1.1/32       12.1.1.1        203/nolabel

   10.1.1.1/32      4.4.4.4         nolabel/407

   12.1.1.0/24      0.0.0.0         204/aggregate(A)

   19.1.1.0/24      4.4.4.4         nolabel/406

Route Distinguisher: 200:9

   10.1.1.1/32      4.4.4.4         nolabel/407

   19.1.1.0/24      4.4.4.4         nolabel/406


R4#sh bgp ***v4 un all labels 

   Network          Next Hop      In label/Out label

Route Distinguisher: 100:2

   1.1.1.1/32       2.2.2.2         404/203

   12.1.1.0/24      2.2.2.2         405/204

Route Distinguisher: 200:9

   10.1.1.1/32      47.1.1.7        407/704

   19.1.1.0/24      47.1.1.7        406/705


R9#sh bgp ***v4 un all labels 

   Network          Next Hop      In label/Out label

Route Distinguisher: 100:2

   1.1.1.1/32       47.1.1.4        nolabel/404

   12.1.1.0/24      47.1.1.4        nolabel/405

Route Distinguisher: 200:9 (A)

   1.1.1.1/32       47.1.1.4        nolabel/404

   10.1.1.1/32      19.1.1.10       905/nolabel

   12.1.1.0/24      47.1.1.4        nolabel/405

   19.1.1.0/24      0.0.0.0         906/aggregate(A)