拓扑:

 

跨运营商的MPLS ×××解决方案2

配置:

R1(PE):

interface Loopback0
ip address 1.1.1.1 255.255.255.255
!

interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
router rip
 version 2
 network 1.0.0.0
 network 192.168.12.0
 no auto-summary

R2(PE):

ip vrf a
rd 1:1
route-target export 1:1
route-target export 2:2
route-target import 1:1
route-target import 2:2

mpls label range 200 299
mpls label protocol ldp

interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding a
ip address 192.168.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.23.2 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 192.168.23.0 0.0.0.255 area 0
!
router rip
!
address-family ipv4 vrf a
redistribute bgp 100 metric transparent
network 192.168.12.0
no auto-summary
version 2
exit-address-family
!
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
!
address-family ipv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-label
no auto-summary
no synchronization
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 a
redistribute rip
no synchronization
exit-address-family
mpls ldp router-id Loopback0

R3(RR):

mpls label range 300 399
mpls label protocol ldp
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.34.3 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 192.168.23.3 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 192.168.23.0 0.0.0.255 area 0
network 192.168.34.0 0.0.0.255 area 0
!
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 update-source Loopback0
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 ebgp-multihop 255
neighbor 6.6.6.6 update-source Loopback0
!
address-family ipv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 route-reflector-client
neighbor 2.2.2.2 send-label
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 send-label
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
neighbor 2.2.2.2 route-reflector-client
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 send-community extended
neighbor 6.6.6.6 next-hop-unchanged
exit-address-family
mpls ldp router-id Loopback0

R4(PE-ASBR):

mpls label range 400 499
mpls label protocol ldp
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.34.4 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 192.168.45.4 255.255.255.0
duplex auto
speed auto
!
router ospf 100
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 192.168.34.0 0.0.0.255 area 0
!
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
neighbor 192.168.45.5 remote-as 200
!
address-family ipv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 next-hop-self
neighbor 3.3.3.3 send-label
neighbor 192.168.45.5 activate
neighbor 192.168.45.5 send-label
no auto-summary
no synchronization
network 2.2.2.2 mask 255.255.255.255
network 3.3.3.3 mask 255.255.255.255
exit-address-family

mpls ldp router-id Loopback0

R5(PE-ASBR):

mpls label range 500 599
mpls label protocol ldp
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.56.5 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 192.168.45.5 255.255.255.0
duplex auto
speed auto
!
router ospf 200
router-id 5.5.5.5
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 192.168.56.0 0.0.0.255 area 0
!
router bgp 200
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source Loopback0
neighbor 192.168.45.4 remote-as 100
!
address-family ipv4
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 next-hop-self
neighbor 6.6.6.6 send-label
neighbor 192.168.45.4 activate
neighbor 192.168.45.4 send-label
no auto-summary
no synchronization
network 6.6.6.6 mask 255.255.255.255
network 7.7.7.7 mask 255.255.255.255
exit-address-family

mpls ldp router-id Loopback0

R6(RR):

mpls label range 600 699
mpls label protocol ldp

interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.56.6 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 192.168.67.6 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 200
router-id 6.6.6.6
log-adjacency-changes
network 6.6.6.6 0.0.0.0 area 0
network 192.168.56.0 0.0.0.255 area 0
network 192.168.67.0 0.0.0.255 area 0
!
router bgp 200
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 ebgp-multihop 255
neighbor 3.3.3.3 update-source Loopback0
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 update-source Loopback0
neighbor 7.7.7.7 remote-as 200
neighbor 7.7.7.7 update-source Loopback0
!
address-family ipv4
neighbor 5.5.5.5 activate
neighbor 5.5.5.5 send-label
neighbor 7.7.7.7 activate
neighbor 7.7.7.7 route-reflector-client
neighbor 7.7.7.7 send-label
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community extended
neighbor 3.3.3.3 next-hop-unchanged
neighbor 7.7.7.7 activate
neighbor 7.7.7.7 send-community extended
neighbor 7.7.7.7 route-reflector-client
exit-address-family
mpls ldp router-id Loopback0

R7(PE):

ip vrf b
rd 2:2
route-target export 2:2
route-target export 1:1
route-target import 2:2
route-target import 1:1
!
mpls label range 700 799
mpls label protocol ldp

interface Loopback0
ip address 7.7.7.7 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding b
ip address 192.168.78.7 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.67.7 255.255.255.0
duplex auto
speed auto
mpls ip
!
router ospf 200
router-id 7.7.7.7
log-adjacency-changes
network 7.7.7.7 0.0.0.0 area 0
network 192.168.67.0 0.0.0.255 area 0
!
router rip
!
address-family ipv4 vrf b
redistribute bgp 200 metric transparent
network 192.168.78.0
no auto-summary
version 2
exit-address-family
!
router bgp 200
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source Loopback0
!
address-family ipv4
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 send-label
no auto-summary
no synchronization
exit-address-family
!
address-family ***v4
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 send-community extended
exit-address-family
!
address-family ipv4 vrf b
redistribute rip
no synchronization
exit-address-family
!
mpls ldp router-id Loopback0

R8(CE):

interface Loopback0
ip address 8.8.8.8 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.78.8 255.255.255.0
duplex auto
speed auto
!
router rip
version 2
network 8.0.0.0
network 192.168.78.0
no auto-summary

验证:

跨运营商的MPLS ×××解决方案2