R1
#
sysname R1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 300:1
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 300:2
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
mpls lsr-id 10.0.1.1
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip address 10.0.12.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance vpna
ip address 10.0.14.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip binding vpn-instance vpnb
ip address 10.0.15.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
bgp 100
peer 10.0.3.3 as-number 100
peer 10.0.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.0.3.3 enable
peer 10.0.3.3 next-hop-local
#
ipv4-family vpnv4
policy vpn-target
peer 10.0.3.3 enable
peer 10.0.3.3 advertise-community
#
ipv4-family vpn-instance vpna
peer 10.0.14.4 as-number 10
#
ipv4-family vpn-instance vpnb
import-route static
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.0.12.0 0.0.0.255
network 10.0.1.1 0.0.0.0
#
ip route-static vpn-instance vpnb 10.0.5.5 255.255.255.255 10.0.15.5
#
R2
#
sysname R2
#
mpls lsr-id 10.0.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip address 10.0.12.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 10.0.23.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
bgp 100
#
ipv4-family unicast
undo synchronization
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.12.0 0.0.0.255
network 10.0.23.0 0.0.0.255
network 10.0.2.2 0.0.0.0
#
R3
#
sysname R3
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 300:1
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 300:2
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
mpls lsr-id 10.0.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip binding vpn-instance vpna
ip address 10.0.36.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.23.3 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/2
ip binding vpn-instance vpnb
ip address 10.0.37.3 255.255.255.0
#
interface GigabitEthernet0/0/3
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
bgp 100
peer 10.0.1.1 as-number 100
peer 10.0.1.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.0.1.1 enable
peer 10.0.1.1 next-hop-local
#
ipv4-family vpnv4
policy vpn-target
peer 10.0.1.1 enable
peer 10.0.1.1 advertise-community
#
ipv4-family vpn-instance vpna
peer 10.0.36.6 as-number 20
#
ipv4-family vpn-instance vpnb
import-route ospf 2 route-policy 10
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.23.0 0.0.0.255
network 10.0.3.3 0.0.0.0
#
ospf 2 vpn-instance vpnb
import-route bgp
area 0.0.0.0
network 10.0.37.0 0.0.0.255
#
route-policy 10 permit node 10
if-match ip-prefix 1
#
ip ip-prefix 1 index 10 deny 10.0.37.0 24
ip ip-prefix 1 index 20 permit 0.0.0.0 32
#
R4
#
sysname R4
#
interface GigabitEthernet0/0/0
ip address 10.0.14.4 255.255.255.0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
bgp 10
peer 10.0.14.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 10.0.4.4 255.255.255.255
peer 10.0.14.1 enable
#
R5
#
sysname R5
#
interface GigabitEthernet0/0/0
ip address 10.0.15.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
ip route-static 0.0.0.0 0.0.0.0 10.0.15.1
#
R6
#
sysname R6
#
interface GigabitEthernet0/0/0
ip address 10.0.36.6 255.255.255.0
#
interface LoopBack0
ip address 10.0.6.6 255.255.255.255
#
bgp 20
peer 10.0.36.3 as-number 100
#
ipv4-family unicast
undo synchronization
network 10.0.6.6 255.255.255.255
peer 10.0.36.3 enable
#
R7
#
sysname R7
#
interface GigabitEthernet0/0/0
ip address 10.0.37.7 255.255.255.0
#
interface LoopBack0
ip address 10.0.7.7 255.255.255.255
#
ospf 2 router-id 10.0.7.7
area 0.0.0.0
network 10.0.37.0 0.0.0.255
network 10.0.7.7 0.0.0.0
#