配置设备之间部署BGPMPLS IP V P N实现互通

配置设备之间部署BGPMPLS IP  V P N实现互通
CE1、CE3属于v p na。

CE2、CE4属于v p nb。

v p na使用的v p n-target属性为111:1,v p nb为222:2。

不同v p n用户之间不能互相访问

结果如下:
配置设备之间部署BGPMPLS IP  V P N实现互通

配置设备之间部署BGPMPLS IP  V P N实现互通

配置如下:
PE1

sysname PE1
#
ip v p n-instance v p na
ipv4-family
route-distinguisher 100:1
v p n-target 111:1 export-extcommunity
v p n-target 111:1 import-extcommunity
ipv6-family
#
ip v p n-instance v p nb
ipv4-family
route-distinguisher 100:2
v p n-target 222:2 export-extcommunity
v p n-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip binding v p n-instance v p na
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip binding v p n-instance v p nb
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable

ipv4-family v p nv4
policy v p n-target
peer 3.3.3.9 enable
#
ipv4-family v p n-instance v p na
import-route direct
peer 10.1.1.1 as-number 65410
#
ipv4-family v p n-instance v p nb
import-route direct
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return

PE2

sysname PE2
#
ip v p n-instance v p na
ipv4-family
route-distinguisher 200:1
v p n-target 111:1 export-extcommunity
v p n-target 111:1 import-extcommunity
#
ip v p n-instance v p nb
ipv4-family
route-distinguisher 200:2
v p n-target 222:2 export-extcommunity
v p n-target 222:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding v p n-instance v p na
ip address 10.3.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip binding v p n-instance v p nb
ip address 10.4.1.2 255.255.255.0
#
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
import-route direct
peer 1.1.1.9 enable

ipv4-family v p nv4
policy v p n-target
peer 1.1.1.9 enable
#
ipv4-family v p n-instance v p na
import-route direct
peer 10.3.1.1 as-number 65430
#
ipv4-family v p n-instance v p nb
import-route direct
peer 10.4.1.1 as-number 65440
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
#

return

P
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip address 172.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/2
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return

CE1

sysname CE1
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
ipv6-family unicast
undo synchronization
#
return

CE2

sysname CE2

interface GigabitEthernet0/0/1
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
peer 10.2.1.2 enable
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
return

CE3

sysname CE3
#
interface GigabitEthernet0/0/1
ip address 10.3.1.1 255.255.255.0
#
bgp 65430
peer 10.3.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.3.1.2 enable
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
return

CE4
sysname CE4
#
interface GigabitEthernet0/0/2
ip address 10.4.1.1 255.255.255.0
#
bgp 65440
peer 10.4.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.4.1.2 enable
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
return

猜你喜欢

转载自blog.51cto.com/13452658/2450980