刘嘉福,EVPN 引入不同VPN的5类路由
组网及说明
虚拟机 VM 1 属于 VXLAN 10 、位于 VPN 实例 vpna ; VM 2 属于 VXLAN 20 、位于 VPN 实例 vpnb 。客户有需求需要两个VPN的部分流量可以互访。
配置步骤
可以通过发送扩展RT属性来实现,参考配置如下。
RTA 配置:
#
ip vpn-instance vpn1
route-distinguisher 1:1
#
address-family ipv4
vpn-target 1:1 3:3 import-extcommunity
vpn-target 1:1 export-extcommunity
#
address-family evpn
vpn-target 1:1 3:3 import-extcommunity
vpn-target 1:1 export-extcommunity
#
bgp 200
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
#
address-family ipv4 unicast
#
address-family l2vpn evpn
peer 4.4.4.4 enable
peer 4.4.4.4 route-policy test export
#
route-policy test permit node 10
if-match ip address prefix-list test
apply extcommunity rt 2:2
#
route-policy test permit node 20
#
ip prefix-list test index 10 permit 10.1.1.0 24
#
RTB 配置:
#
ip vpn-instance vpn1
route-distinguisher 2:2
#
address-family ipv4
vpn-target 2:2 3:3 import-extcommunity
vpn-target 2:2 export-extcommunity
#
address-family evpn
vpn-target 2:2 3:3 import-extcommunity
vpn-target 2:2 export-extcommunity
#
bgp 200
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
#
address-family l2vpn evpn
peer 4.4.4.4 enable
peer 4.4.4.4 route-policy test export
#
route-policy test permit node 10
if-match ip address prefix-list test
apply extcommunity rt 1:1 additive
#
route-policy test permit node 100
#
ip prefix-list test index 10 permit 10.1.2.0 24
#
配置后,可以学习到不同VPN的路由:
[RTA]dis ip routing-table vpn-instance vpn1 protocol bgp
Summary count : 3
BGP Routing table status : <Active>
Summary count : 3
Destination/Mask Proto Pre Cost NextHop Interface
10.1.2.0/24 BGP 255 0 2.2.2.2 Vsi3
10.1.3.0/24 BGP 255 0 3.3.3.3 Vsi4
10.1.3.10/32 BGP 255 0 3.3.3.3 Vsi4
[RTB]dis ip routing-table vpn-instance vpn1 protocol bgp
Summary count : 3
BGP Routing table status : <Active>
Summary count : 3
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 BGP 255 0 1.1.1.1 Vsi2
10.1.3.0/24 BGP 255 0 3.3.3.3 Vsi4
10.1.3.10/32 BGP 255 0 3.3.3.3 Vsi4