MPLS-L3VPN

实验环境:

配置R1 R2 R3 接口:

r1:
sys
sysn r1
int g0/0/0
ip add 10.250.0.254 24
int g0/0/1
ip add 192.168.100.2 24
int lo 0 
ip add 1.1.1.1 32

ospf 1 router-id 1.1.1.1
a 0
net 10.250.0.0 0.0.0.255
net 1.1.1.1 0.0.0.0
r2:
sys
sysn r2
int g0/0/0
ip add 10.250.0.11 24
int g0/0/1
ip add 10.251.20.1 28
int lo 0 
ip add 2.2.2.2 32

ospf 1 router-id 2.2.2.2
a 0
net 10.250.0.0 0.0.0.255
net 10.251.20.0 0.0.0.255
net 2.2.2.2 0.0.0.0
r3:
sys
sysn r3
int g0/0/1
ip add 10.251.20.14 28
int g0/0/0
ip add 192.168.200.2 24
int lo 0 
ip add 3.3.3.3 32

ospf 1 router-id 3.3.3.3
a 0
net 3.3.3.3 0.0.0.0
net 10.251.20.0 0.0.0.255

开启R1 R2 R3 的MPLS:

r1:
mpls lsr-id 1.1.1.1
mpls
mpls ldp
int g0/0/0
mpls 
mpls ldp
r2:
mpls lsr-id 2.2.2.2
mpls
mpls ldp
int g0/0/0
mpls 
mpls ldp
int g0/0/1
mpls 
mpls ldp
r3:
mpls lsr-id 3.3.3.3
mpls
mpls ldp
int g0/0/1
mpls 
mpls ldp

配置R1 R3的BGP对等体邻居,VPN-IPV4地址族:

r1:
bgp 123
router-id 1.1.1.1
peer 3.3.3.3 as-number 123
peer 3.3.3.3 connect-interface loopback 0

ipv4-family vpnv4 unicast
peer 3.3.3.3 enable
r3:
bgp 123
router-id 3.3.3.3
peer 1.1.1.1 as-number 123
peer 1.1.1.1 connect-interface loopback 0

ipv4-family vpnv4 unicast
peer 1.1.1.1 enable

R4 R5 接口和BGP配置:

r4:
int lo 0
ip add 4.4.4.4 32
int g0/0/1
ip add 192.168.100.1 24
int g0/0/2
ip add 192.168.1.1 24
q
bgp 100
router-id 3.3.3.3
peer 192.168.100.2 as 123
net 192.168.1.0 24
r5:
int lo 0
ip add 5.5.5.5 32
int g0/0/0
ip add 192.168.200.1 24
int g0/0/2
ip add 192.168.2.1 24
q
bgp 200
router-id 5.5.5.5
peer 192.168.200.2 as 123
net 192.168.2.0 24

在R1 R3上配置VPN实例,BGP和OSPF双向引入:

r1:
ip vpn-instance VPNX
route-distinguisher 100:1
vpn-target 100:321 import-extcommunity
vpn-target 100:123 export-extcommunity

int g0/0/1
ip binding vpn-instance VPNX
ip add 192.168.100.2 24
q
ospf 2 vpn-instance VPNX
a 0
net 192.168.100.0 0.0.0.255

ospf 2 vpn-instance VPNX
import-route bgp
q
bgp 123
ipv4-family vpn-instance VPNX
import-route ospf 2
r3:
ip vpn-instance VPNX
route-distinguisher 100:1
vpn-target 100:123 import-extcommunity
vpn-target 100:321 export-extcommunity

int g0/0/0
ip binding vpn-instance VPNX
ip add 192.168.200.2 24
q
ospf 2 vpn-instance VPNX
a 0
net 192.168.200.0 0.0.0.255

ospf 2 vpn-instance VPNX
import-route bgp
q
bgp 123
ipv4-family vpn-instance VPNX
import-route ospf 2
r1:
bgp 123
ipv4-family vpn-instance VPNX
peer 192.168.100.1 as 100
r3:
bgp 123
ipv4-family vpn-instance VPNX
peer 192.168.200.1 as 200

查看R1 BGP VPN-IPV4邻居:

PC1 PING PC2:

隧道间抓包:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值