首先配置是配通了的,拓扑如下
左边CE1和PE1之间运行的BGP,as为1,R2和R4运行的BGPAS号为2,CE2运行的BGPAS号为5.
这里CE1和PE1,CE2和PE2运行BGP协议,PE1和PE2上创建VRF,R2-R4间运行MPLS和IGP,PE1和PE2运行BGP互指邻居,这里吧CE1和PE1的配置贴上来,其他的类似
CE1:
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.12.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex half
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 10.1.12.2 remote-as 2
no auto-summary
PE1:
ip vrf cisco
rd 2:2
route-target export 2:2
route-target import 2:4
!
!
mpls label range 200 299
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding cisco
ip address 10.1.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.1.23.1 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet1/0
no ip address
shutdown
duplex half
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 10.1.23.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
neighbor 4.4.4.4 remote-as 2
no auto-summary
!
address-family vpnv4
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf cisco
neighbor 10.1.12.1 remote-as 1
neighbor 10.1.12.1 activate
no synchronization
network 2.2.2.2 mask 255.255.255.255
network 10.1.12.0 mask 255.255.255.0
exit-address-family
!
这里附上R3-R5的配置
R3:
mpls label range 300 399
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.23.2 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 10.1.34.1 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet1/0
no ip address
shutdown
duplex half
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 10.1.23.0 0.0.0.255 area 0
network 10.1.34.0 0.0.0.255 area 0
!
!
no ip http server
no ip http secure-server
!
!
!
!
mpls ldp router-id Loopback0
!
R4:
ip vrf cisco
rd 2:4
route-target export 2:4
route-target import 2:2
!
!
mpls label range 400 499
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.34.2 255.255.255.0
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip vrf forwarding cisco
ip address 10.1.45.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex half
!
router ospf 1
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 10.1.34.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
network 4.4.4.4 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf cisco
neighbor 10.1.45.2 remote-as 5
neighbor 10.1.45.2 activate
no synchronization
network 10.1.12.0 mask 255.255.255.0
network 10.1.45.0 mask 255.255.255.0
exit-address-family
!
!
no ip http server
no ip http secure-server
!
!
!
!
mpls ldp router-id Loopback0
!
!
R5:
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.45.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex half
!
router bgp 5
no synchronization
bgp log-neighbor-changes
network 5.5.5.5 mask 255.255.255.255
neighbor 10.1.45.1 remote-as 2
no auto-summary
!
!