交换机MPLS L3VPN Hub&Spoke配置
一 组网需求:
PE1与PE2建立eBGP,CE1和CE2分别是vpn1和vpn2的分布站点接入PE2,要求vpn1与vpn2能够互通,且CE1和CE2之间的VPN流量都需要经PE1转发。
二 组网图:
三 配置步骤:
适用设备:S5800交换机。
软件版本:Version 5.20,Release 1211以后软件版本
配置PE1设备:
1. 在PE1上创建VPN-instance,允许引入VPN-target属性为1:100的VPN路由,发布的VPN路由的VPN-target属性为1:100。
ip vpn-instance vpn_hub
route-distinguisher 100:100
vpn-target 1:100 export-extcommunity
vpn-target 1:100 import-extcommunity
2. PE1与PE2之间建立eBGP邻居,并在VPNv4子地址族视图下激活MP-eBGP对等体。
bgp 1
peer 10.1.1.2 as-number 2
peer 11.1.1.2 as-number 2
#
ipv4-family vpnv4
peer 10.1.1.2 enable
peer 11.1.1.2 enable
配置PE2设备:
1. 在PE2上配置两个VPN-instance,允许引入VPN-target属性为1:100的VPN路由,发布的VPN路由的VPN-target属性为100:1。
ip vpn-instance vpn1
route-distinguisher 1:1
vpn-target 100:1 export-extcommunity
vpn-target 1:100 import-extcommunity
#
ip vpn-instance vpn2
route-distinguisher 2:2
vpn-target 100:1 export-extcommunity
vpn-target 1:100 import-extcommunity
2. 将PE2与CE1、CE2相连的VLAN虚接口绑定到不同的VPN-instance。
interface Vlan-interface100
ip binding vpn-instance vpn1
ip address 100.1.1.1 255.255.255.0
#
interface Vlan-interface200
ip binding vpn-instance vpn2
ip address 200.1.1.1 255.255.255.0
3. PE1与PE2之间建立eBGP邻居,将学到的CE1、CE2内部VPN路由引入VPN实例子地址族。
bgp 2
peer 10.1.1.1 as-number 1
peer 11.1.1.1 as-number 1
ipv4-family vpn-instance vpn1
import-route direct
ipv4-family vpn-instance vpn2
import-route direct
4. 建立并下发路由策略,用于修改发布路由的VPN-target属性。
ip ip-prefix RT_vpn1 index 10 permit 100.1.1.0 24 less-equal 32
ip ip-prefix RT_vpn2 index 10 permit 200.1.1.0 24 less-equal 32
#
route-policy RT_vpn1 permit node 10
if-match ip-prefix RT_vpn1
apply extcommunity rt 1:100
route-policy RT_vpn1 deny node 20
route-policy RT_vpn2 permit node 10
if-match ip-prefix RT_vpn2
apply extcommunity rt 1:100
route-policy RT_vpn2 deny node 20
#
bgp 2
ipv4-family vpnv4
peer 10.1.1.1 route-policy RT_vpn1 export
peer 11.1.1.1 route-policy RT_vpn2 export
5. 在VPNv4子地址族视图下激活MP-eBGP对等体,同时配置接受环路路由功能。
bgp 2
ipv4-family vpnv4
peer 10.1.1.1 enable
peer 10.1.1.1 allow-as-loop
peer 11.1.1.1 enable
peer 11.1.1.1 allow-as-loop
四 配置关键点:
1. 在作为Spoke的PE2上,需要互通的VPN-instance的VPN-target属性要相同,以便于引入新增VPN-instance的路由;
2. PE2上每个VPN-instance的引入VPN-target属性和发布VPN-target属性不能相同,以阻止本地VPN-instance路由的相互学习;
3. 允许接收环路路由,使PE2能够接收PE1发送的含本AS号的路由更新;
4. PE1需要与PE2建立2条eBGP连接,且VPNv4子地址族视图下激活;
5. Spoke上的各VPN-instance不能包含相同网段的路由。
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作