产生背景:
mpls vpn组网时,可能出现位于不同地理位置或者不同AS的站点存在着跨域互联的情况。
解决方案:
OptionA,OptionB,OptionC,本文介绍的是A。每个方案有各自特点,以及使用场景。这些跨域方案是可以结合Hub spoke,intrance,mce等使用的。
传统mpls vpn原理回顾:
![](https://img-blog.csdnimg.cn/direct/3ec1078a4f564147bbad3bb6f3c67917.png)
- CE2发送一个目的地址为Net1的IPv4报文。
- PE2收到报文后进行MPLS标签的封装,先封装VPN标签V1,再封装外层标签T2,然后将此报文发送给P。
- P进行标签交换,把外层标签T2换成T1,然后将此报文发送给PE1。
- PE1收到后去掉所有标签,将IPv4报文转发给CE1。
跨域的问题:
两个处于不同AS的路由器ASBR之间怎么传递站点之间的数据?
AS之间不会运行LDP协议,因此AS之间无法建立外层隧道LDPLSP。
PE之间没有运行IGP协议,缺省情况下无法建立BGP邻居关系,进而无法直接传递VPNv4路由。
A方案原理:
两个ASBR都把对端ASBR看作自己的CE设备,ASBR用的协议可以是BGP,IGP。或者2个单域实验,最后把它们拼在一块。
实验拓扑:
准备工作:
IGP互通
可以是ospf,isis,静态路由。最终效果是1.1.1.1 互通 2.2.2.2,2.2.2.2互通3.3.3.3, 3.3.3.互通4.4.4.4,4.4.4.4互通7.7.7.7。
AS内:R2ibgp邻居为R1
R2BGP配置:
bgp 12
undo default ipv4-unicast
peer 1.1.1.1 as-number 12
peer 1.1.1.1 connect-interface LoopBack0
ipv4-family vpnv4
peer 1.1.1.1 enable
AS内:R4ibgp邻居为R3
bgp 34
undo default ipv4-unicast
peer 3.3.3.3 as-number 34
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family vpnv4
peer 3.3.3.3 enable
实施
ASBR建立EBGP邻居
R2和R3配置互联ip
ip vpn-instance 5
route-distinguisher 5:5
vpn-target 52:51 export-extcommunity
vpn-target 51:52 import-extcommunityASBR可能有多个,所以是子接口绑定实例,R3同理。
interface GigabitEthernet0/0/1.10
dot1q termination vid 10
ip binding vpn-instance 5
ip address 192.168.23.2 255.255.255.0
arp broadcast enable
R3:
ip vpn-instance 7
route-distinguisher 7:7
vpn-target 71:72 export-extcommunity
vpn-target 72:71 import-extcommunityinterface GigabitEthernet0/0/0.10
dot1q termination vid 10
ip binding vpn-instance 7
ip address 192.168.23.3 255.255.255.0
arp broadcast enable
bgp 配置
R2:
ipv4-family vpn-instance 5
peer 192.168.23.3 as-number 34
R3
ipv4-family vpn-instance 7
peer 192.168.23.2 as-number 12
R3 查看ASBR之间的bgp邻居状态
CE发布路由
R5通过bgp向CE也就是R1,发布5.5.5.5/32
bgp 5
network 5.5.5.5 255.255.255.255
R1:dis bgp vpnv4 vpn-instance 5 routing-table
接下来5.5.5.5这条路由会传给R2,因为R2和R3是实例EBGP邻居,所以R3也会收到。最后R3把路由传给CE R7。R7 同理把7.7.7.7 32 传给R5,两个站点完成互访。
验证
最终两个站点互通
总结
只是ASBR之间增加示例下的EBGP邻居即可完成跨域,要提前规划RD、RT、实例名字。
可能有多个站点,所以ASBR用了子接口且绑定实例,用子接口和对方建立EBGP邻居。
缺点:
ASBR配置会随着站点数量的增加而增加配置,效率低,适用于站点少的情况