VRF-VRF解决方案技术上最简单的,没有在“AS内部的MPLS-×××”上作任何扩展,完全应用已有技术实现 。

ASBR对等体间,通过划分子接口方式,每个子接口分别绑定一个VRF,保证域间传播路由的私有性。

ASBR对等体间,只运行普通BGP,不运行LDP,交互IPV4路由。

每个PE-ASBR路由器都把对方PE-ASBR路由器当做CE路由器看待。

比较适合运用在AS域间交互×××(VRF)数量较少的情况。但是扩展性较差。

实验拓扑图:

mpls ***跨域,VRF-TO-VRF方式_第1张图片

1.路由器R1上lo0:1.1.1.1/32,路由器R2上lo0:2.2.2.2/32,路由器R3上lo0:3.3.3.3/32,路由器R4上lo0:4.4.4.4/32,路由器R5上lo0:5.5.5.5/32,路由器R6上lo0:6.6.6.6/32。

2.R5和R6是CE路由器,R1,R2,R3,R4是PE路由器,省去了P路由器,不影响实验。R1和R2之间IGP:OSPF,bgp为MBGP, R2和R3之间是EBGP,R3和R4之间,IGP是OSPF,bgp为MBGP,

3.一下为R1-R6的配置文件:

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

 speed auto

 duplex auto

 mpls ip

!

interface FastEthernet0/1

 ip vrf forwarding r5

 ip address 15.1.1.1 255.255.255.0

 speed auto

 duplex auto

!

router ospf 2 vrf r5

 redistribute bgp 12 subnets

 network 0.0.0.0 255.255.255.255 area 0

!

router ospf 1

 network 0.0.0.0 255.255.255.255 area 0

!

router bgp 12

 bgp log-neighbor-changes

 no bgp default ipv4-unicast

 neighbor 2.2.2.2 remote-as 12

 neighbor 2.2.2.2 update-source Loopback0

 !

 address-family ipv4

 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

  redistribute ospf 2 match internal external 1 external 2

 exit-address-family

!


路由器R2:


hostname R2

!

ip vrf r5

 rd 1:1

 route-target export 1:1

 route-target import 1:1

!

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

 speed auto

 duplex auto

 mpls ip

!

interface FastEthernet0/1

 ip vrf forwarding r5

 ip address 23.1.1.2 255.255.255.0

 speed auto

 duplex auto

!

router ospf 1

 network 2.2.2.2 0.0.0.0 area 0

 network 12.1.1.0 0.0.0.255 area 0

!

router bgp 12

 bgp log-neighbor-changes

 no bgp default ipv4-unicast

 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

 exit-address-family

 !

 address-family ***v4

  neighbor 1.1.1.1 activate

  neighbor 1.1.1.1 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf r5

  neighbor 23.1.1.3 remote-as 34

  neighbor 23.1.1.3 activate

 exit-address-family

!


路由器R3:

!

hostname R3

!

ip vrf r6

 rd 2:2

 route-target export 2:2

 route-target import 2:2

!

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

 speed auto

 duplex auto

 mpls ip

!

interface FastEthernet0/1

 ip vrf forwarding r6

 ip address 23.1.1.3 255.255.255.0

 speed auto

 duplex auto

!

router ospf 1

 network 3.3.3.3 0.0.0.0 area 0

 network 34.1.1.0 0.0.0.255 area 0

!

router bgp 34

 bgp log-neighbor-changes

 no bgp default ipv4-unicast

 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

 exit-address-family

 !

 address-family ***v4

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf r6

  neighbor 23.1.1.2 remote-as 12

  neighbor 23.1.1.2 activate

 exit-address-family


路由器R4:

!

hostname R4

!

!

ip vrf r6

 rd 2:2

 route-target export 2:2

 route-target import 2:2

!

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

 speed auto

 duplex auto

 mpls ip

!

interface FastEthernet0/1

 ip vrf forwarding r6

 ip address 46.1.1.4 255.255.255.0

 speed auto

 duplex auto

!

router ospf 2 vrf r6

 redistribute bgp 34 subnets

 network 0.0.0.0 255.255.255.255 area 0

!

router ospf 1

 network 4.4.4.4 0.0.0.0 area 0

 network 0.0.0.0 255.255.255.255 area 0

!

router bgp 34

 bgp log-neighbor-changes

 no bgp default ipv4-unicast

 neighbor 3.3.3.3 remote-as 34

 neighbor 3.3.3.3 update-source Loopback0

 !

 address-family ipv4

 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

  redistribute ospf 2 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/0

 no ip address

 shutdown

 speed auto

 duplex auto

!

interface FastEthernet0/1

 ip address 15.1.1.5 255.255.255.0

 speed auto

 duplex auto

!

router ospf 2

 network 0.0.0.0 255.255.255.255 area 0

!         


路由器R6:

!

hostname R6

!

interface Loopback0

 ip address 6.6.6.6 255.255.255.255

!

interface FastEthernet0/0

 no ip address

 shutdown

 speed auto

 duplex auto

!

interface FastEthernet0/1

 ip address 46.1.1.6 255.255.255.0

 speed auto

 duplex auto

!

router ospf 2

 network 0.0.0.0 255.255.255.255 area 0

!