可以通过发送扩展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
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作