注意 按照图分别从做到右
R1-R2-R3-R4-R5-R6
 
(R1-CE1)------(R2-PE1)------(R3-ASBR1)------(R4-ASBR2)-----(R5-PE2)-----(R6-CE2)
    |------rip2-----| |------ospf----------|                   |------------isis--------| |-----ospf------|
 
        跨域的MPLS,这个采用OptionA的方式互联,OptionA是采用VRF-to-VRF的方式,简单的说就是AS之间的ASBR路由器把对方相互看做是CE端,既然是VRF-TO-VRF所以必须为每个VRF创建一个连接,如果有100个VRF就的在域间创建100个VRF的连接,因此该方式的可扩展性有一定的限制,该方式主要的优点是配置和管理简单,为了满足大量的VRF,通常我们采用子接口的形式来实现域间互通。这里是采用最简化的实现方式,剔除了P路由器,呵呵我的小本本不能运行太多的路由器啊,整个PE与CE,PE与PE之间采用OSPF作为IGP协议。具体配置如下:
R1-CE1
hostname R1-CE
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
interface Serial1/1
 ip address 192.168.0.1 255.255.255.0
 serial restart-delay 0
router rip
 version 2
 network 1.0.0.0
 network 192.168.0.0
R2-PE1
hostname R2-PE1
ip vrf test1
 rd 1:1
 route-target export 1:1
 route-target import 1:1
interface Loopback0
 ip address 1.1.1.2 255.255.255.255
interface Serial1/0
 ip vrf forwarding test1
 ip address 192.168.0.2 255.255.255.0
 serial restart-delay 0
interface Serial1/1
 de.ion To R3-PE2
 ip address 10.1.1.1 255.255.255.252
 mpls label protocol ldp
 tag-switching ip
 serial restart-delay 0
router ospf 100
 log-adjacency-changes detail
 network 1.1.1.2 0.0.0.0 area 0
 network 10.1.1.1 0.0.0.0 area 0
!
router rip
 version 2
 !
 address-family ipv4 vrf test1
 redistribute bgp 100 metric transparent
 network 192.168.0.0
 no auto-summary
 version 2
 exit-address-family
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.3 remote-as 100
 neighbor 1.1.1.3 update-source Loopback0
 no auto-summary
 !
 address-family ***v4
 neighbor 1.1.1.3 activate
 neighbor 1.1.1.3 send-community both
 exit-address-family
 !
 address-family ipv4 vrf test1
 redistribute rip
 no auto-summary
 no synchronization
 exit-address-family
R3-ASBR1
hostname R3-ASBR1
ip vrf test1
 rd 1:1
 route-target export 1:1
 route-target import 1:1
interface Loopback0
 ip address 1.1.1.3 255.255.255.255
interface Serial1/0
 ip address 10.1.1.2 255.255.255.252
 mpls label protocol ldp
 tag-switching ip
 serial restart-delay 0
!
interface Serial1/1
 ip vrf forwarding test1
 ip address 192.168.3.1 255.255.255.0
router ospf 100
 log-adjacency-changes
 network 1.1.1.3 0.0.0.0 area 0
 network 10.1.1.2 0.0.0.0 area 0
 default-information originate always
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.2 remote-as 100
 neighbor 1.1.1.2 update-source Loopback0
 no auto-summary
 !
 address-family ***v4
 neighbor 1.1.1.2 activate
 neighbor 1.1.1.2 send-community both
 exit-address-family
 !
 address-family ipv4 vrf test1
 redistribute connected
 neighbor 192.168.3.2 remote-as 200
 neighbor 192.168.3.2 activate
 no auto-summary
 no synchronization
 exit-address-family
R4-ASBR2
hostname R4-PE4
ip vrf test1
 rd 1:1
 route-target export 1:1
 route-target import 1:1
interface Loopback0
 ip address 1.1.1.4 255.255.255.255
interface Serial1/1
 ip address 10.1.1.9 255.255.255.252
 ip router isis cncsz
 mpls label protocol ldp
 tag-switching ip
 serial restart-delay 0
router isis cncsz
 net 00.0001.0010.0100.1000.00
 is-type level-2-only
 passive-interface Loopback0
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.5 remote-as 200
 neighbor 1.1.1.5 update-source Loopback0
 no auto-summary
 !
 address-family ***v4
 neighbor 1.1.1.5 activate
 neighbor 1.1.1.5 send-community both
 exit-address-family
 !
 address-family ipv4 vrf test1
 redistribute connected
 neighbor 192.168.3.1 remote-as 100
 neighbor 192.168.3.1 activate
 neighbor 192.168.3.1 send-community both
 no auto-summary
 no synchronization
 exit-address-family
R5-PE2
hostname R5-PE5
ip vrf test1
 rd 1:1
 route-target export 1:1
 route-target import 1:1
interface Loopback0
 ip address 1.1.1.5 255.255.255.255
 ip router isis cncsz
interface Serial1/0
 ip address 10.1.1.10 255.255.255.252
 ip router isis cncsz
 mpls label protocol ldp
 tag-switching ip
 serial restart-delay 0
!
interface Serial1/1
 ip vrf forwarding test1
 ip address 192.168.2.1 255.255.255.0
 serial restart-delay 0
router ospf 1 vrf test1
 log-adjacency-changes
 redistribute bgp 200 subnets
 network 192.168.2.1 0.0.0.0 area 0
!
router isis cncsz
 net 00.0001.0010.0100.0002.00
 is-type level-2-only
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.4 remote-as 200
 neighbor 1.1.1.4 update-source Loopback0
 no auto-summary
 !
 address-family ***v4
 neighbor 1.1.1.4 activate
 neighbor 1.1.1.4 send-community both
 exit-address-family
 !
 address-family ipv4 vrf test1
 redistribute ospf 1
 no auto-summary
 no synchronization
 exit-address-family
R6-CE2
hostname R6-CE
interface Loopback0
 ip address 1.1.1.6 255.255.255.255
interface Serial1/0
 ip address 192.168.2.2 255.255.255.0
 serial restart-delay 0
router ospf 1
 log-adjacency-changes
 network 1.1.1.6 0.0.0.0 area 0
 network 192.168.2.2 0.0.0.0 area 0
相关 dy脚本
autostart = false
[localhost]
port = 7200
udp = 10000
workingdir = ..\tmp\
    `router R1`
    image = ..\ios\unzip-c7200-is-mz.122-37.bin
    model = 7200
    console = 3001
    npe = npe-400
    ram = 64
    confreg = 0x2142
    exec_area = 64
    mmap = false
    slot0 = PA-C7200-IO-FE
    slot1 = PA-4T
    slot2 = PA-4T
    f0/0 = SW1 1
    s1/1 = R2 s1/0
    s1/2 = R4 s1/1
    `router R2`
    image = ..\ios\unzip-c7200-is-mz.122-37.bin
    model = 7200
    console = 3002
    npe = npe-400
    ram = 64
    confreg = 0x2142
    exec_area = 64
    mmap = false 
    slot0 = PA-C7200-IO-FE
    slot1 = PA-4T
    slot2 = PA-4T
    f0/0 = SW1 2
    s1/1 = R3 S1/0
    s1/2 = R4 s1/2
    `router R3`
    image = ..\ios\unzip-c7200-is-mz.122-37.bin
    model = 7200
    console = 3003
    npe = npe-400
    ram = 64
    confreg = 0x2142
    exec_area = 64
    mmap = false
    slot0 = PA-C7200-IO-FE
    slot1 = PA-4T
    slot2 = PA-4T
    f0/0 = SW1 3
    s1/2 = R4 s1/3
    `router R4`
    image = ..\ios\unzip-c7200-is-mz.122-37.bin
    model = 7200
    console = 3004
    npe = npe-400
    ram = 64
    confreg = 0x2142
    exec_area = 64
    mmap = false
    slot0 = PA-C7200-IO-FE
    slot1 = PA-4T
    f0/0 = SW1 4
    `ethsw SW1`
    1 = dot1q 1
    2 = dot1q 1
    3 = dot1q 1
    4 = dot1q 1
    5 = access 1 NIO_gen_eth:\Device\NPF_{70DD1F0E-3BFC-4407-BC34-3956FAC819D2}