PE-ASBR对等体之间建立单跳的MP-EBGP邻接体,传递×××-IPV4路由,不运行IGP和LDP。

PE-ASBR对等体之间传递私网路由时,因为EBGP邻居关系,需要改变路由的下一跳,所以需要交换内层标签。

接收端PE-ASBR,可以使用next-hop-local命令,强制修改路由的下一跳,同时再次交换内层标签,通告给MP-IBGP邻居。如果没有配置next-hop-local命令,需要把direct路由重分布(import-route)到IGP中。

PE-ASBR路由器上需要保存所有域间的私网路由。对于ASBR路由器来说,压力较大。

和VRF-VRF方式相比,具有更好的扩展性。

实验拓扑图:

mpls-***跨域技术-单跳MBGP_第1张图片

说明:IGP运行OSPF,R2和R3之间运行MBGP,R5和R6上的lo0口作为测试接口

路由器配置:

R1:

hostname R1

!

!         

ip vrf r5

 rd 1:1

 route-target export 1:1

 route-target import 1:1

!

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

 !

!

interface FastEthernet0/0

 ip address 12.1.1.1 255.255.255.0

 duplex auto

 speed auto

 mpls ip

 !

!

interface FastEthernet0/1

 ip vrf forwarding r5

 ip address 15.1.1.1 255.255.255.0

 duplex auto

 speed auto

 !

!

router ospf 2 vrf r5

 log-adjacency-changes

 redistribute bgp 12 subnets

 network 15.1.1.1 0.0.0.0 area 0

!

router ospf 1

 log-adjacency-changes

 network 1.1.1.1 0.0.0.0 area 0

 network 12.1.1.1 0.0.0.0 area 0

!

router bgp 12

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor 2.2.2.2 remote-as 12

 neighbor 2.2.2.2 update-source Loopback0

 !

 address-family ipv4

  no synchronization

  no auto-summary

 exit-address-family

 !

 address-family ***v4

  neighbor 2.2.2.2 activate

  neighbor 2.2.2.2 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf r5

  no synchronization

  redistribute ospf 2 vrf r5 match internal external 1 external 2

 exit-address-family

!

ip forward-protocol nd

no ip http server

no ip http secure-server

!

!



R2配置:

hostname R2

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

 !

!

interface FastEthernet0/0

 ip address 12.1.1.2 255.255.255.0

 duplex auto

 speed auto

 mpls ip

 !

!

interface FastEthernet0/1

 ip address 23.1.1.2 255.255.255.0

 duplex auto

 speed auto

 mpls bgp forwarding

 !

!

router ospf 1

 log-adjacency-changes

 passive-interface FastEthernet0/1

 network 2.2.2.2 0.0.0.0 area 0

 network 12.1.1.2 0.0.0.0 area 0

 network 23.1.1.2 0.0.0.0 area 0

!

router bgp 12

 no bgp default ipv4-unicast

 no bgp default route-target filter

 bgp log-neighbor-changes

 neighbor 1.1.1.1 remote-as 12

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 23.1.1.3 remote-as 34

 !

 address-family ipv4

  no synchronization

  no auto-summary

 exit-address-family

 !

 address-family ***v4

  neighbor 1.1.1.1 activate

  neighbor 1.1.1.1 send-community extended

  neighbor 1.1.1.1 next-hop-self

  neighbor 23.1.1.3 activate

  neighbor 23.1.1.3 send-community extended

 exit-address-family

!


R3配置:

hostname R3

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.255

 !

!

interface FastEthernet0/0

 ip address 34.1.1.3 255.255.255.0

 duplex auto

 speed auto

 mpls ip

 !

!

interface FastEthernet0/1

 ip address 23.1.1.3 255.255.255.0

 duplex auto

 speed auto

 mpls bgp forwarding

 !

!

router ospf 1

 log-adjacency-changes

 passive-interface FastEthernet0/1

 network 3.3.3.3 0.0.0.0 area 0

 network 23.1.1.3 0.0.0.0 area 0

 network 34.1.1.3 0.0.0.0 area 0

!

router bgp 34

 no bgp default ipv4-unicast

 no bgp default route-target filter

 bgp log-neighbor-changes

 neighbor 4.4.4.4 remote-as 34

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 23.1.1.2 remote-as 12

 !

 address-family ipv4

  no synchronization

  no auto-summary

 exit-address-family

 !

 address-family ***v4

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 send-community extended

  neighbor 4.4.4.4 next-hop-self

  neighbor 23.1.1.2 activate

  neighbor 23.1.1.2 send-community extended

 exit-address-family

!



R4配置:

hostname R4

!

!         

ip vrf r6

 rd 2:2

 route-target export 1:1

 route-target import 1:1

!


!

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

 !

!

interface FastEthernet0/0

 ip address 34.1.1.4 255.255.255.0

 duplex auto

 speed auto

 mpls ip

 !

!

interface FastEthernet0/1

 ip vrf forwarding r6

 ip address 46.1.1.4 255.255.255.0

 duplex auto

 speed auto

 !

!

router ospf 2 vrf r6

 log-adjacency-changes

 redistribute bgp 34 subnets

 network 46.1.1.4 0.0.0.0 area 0

!

router ospf 1

 log-adjacency-changes

 network 4.4.4.4 0.0.0.0 area 0

 network 34.1.1.4 0.0.0.0 area 0

!

router bgp 34

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor 3.3.3.3 remote-as 34

 neighbor 3.3.3.3 update-source Loopback0

 !

 address-family ipv4

  no synchronization

  no auto-summary

 exit-address-family

 !

 address-family ***v4

  neighbor 3.3.3.3 activate

  neighbor 3.3.3.3 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf r6

  no synchronization

  redistribute ospf 2 vrf r6 match internal external 1 external 2

 exit-address-family

!


R5配置:

hostname R5

!

interface Loopback0

 ip address 5.5.5.5 255.255.255.255

 !

!

interface FastEthernet0/1

 ip address 15.1.1.5 255.255.255.0

 duplex auto

 speed auto

 !

!

router ospf 1

 log-adjacency-changes

 network 5.5.5.5 0.0.0.0 area 0

 network 15.1.1.5 0.0.0.0 area 0

!


R6配置:

hostname R6

!

interface Loopback0

 ip address 6.6.6.6 255.255.255.255

 !

!

interface FastEthernet0/1

 ip address 46.1.1.6 255.255.255.0

 duplex auto

 speed auto

 !

!

router ospf 1

 log-adjacency-changes

 network 6.6.6.6 0.0.0.0 area 0

 network 46.1.1.6 0.0.0.0 area 0

!



测试:

R6#ping 5.5.5.5 source 6.6.6.6


Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:

Packet sent with a source address of 6.6.6.6 

!!!!.

Success rate is 80 percent (4/5), round-trip min/avg/max = 84/110/128 ms



R6#traceroute 5.5.5.5 source 6.6.6.6


Type escape sequence to abort.

Tracing the route to 5.5.5.5


  1 46.1.1.4 36 msec 52 msec 52 msec

  2 34.1.1.3 [MPLS: Label 20 Exp 0] 100 msec 92 msec 92 msec

  3 23.1.1.2 [MPLS: Label 18 Exp 0] 148 msec 116 msec 76 msec

  4 15.1.1.1 [MPLS: Label 18 Exp 0] 96 msec 136 msec 88 msec

  5  * 

    15.1.1.5 108 msec 96 msec