VxLAN 分布式对称 IRB 实验

一、拓扑

描述:

CE1 上的 VRF A 上开启用户A 的 vlan 10、20网关,CE2 的 VRF A 上开启用户 A 的 vlan 20、30 的网关

要求:

全域互访

二、配置思路:

1、网络侧配置 underlayer 底层互通

1)CE1、2 配置 IGP,让 loo0 互通

2)CE1、2 建立 BGP EVPN 邻居,建立 EVPN 路由传输通道(全局要先开启 evpn-overlay enable)

2、配置 overlayer 上层互通

1)网络侧:

a、配置 BD,配二层 vni 号,在 EVPN 地址族下分配 RD、RT
b、配置 VRF,配三层 vni 号,配置 evpn 地址族下的 RD、RT
c、配 VBDIF 三层网关,关联 VRF
d、配 NVE 接口,为 leaf 之间开通 vxlan 隧道,方法:头端复制,对端列表以 BGP 协议动态生成
e、由于 CE1 和 CE2 都有 BD 20,在两个 leaf 的 vbdif 20上,配置相同的 MAC 地址,开启任播网关功能:vxlan anycast-gateway enable

2)用户侧:

a、配置 VAP 接口,接入租户的二、三层 vlan 网络

3、此时架构完成,在 PC 端测试不通,还需要完成以下几点:

1)要产生 IRB 路由,并通告给对端:

a、产生:在 vbdif 下,收集 arp 主机路由:arp collect host enable

2)IRB 路由接收:

为了让 IRB 路由能够进入到对端的 EVPN 路由表中,需要把三层 VRF 的 ERT 写入到本端的 BD EVPN 的 ERT中,同时补完 IRB 路由(加上三层 vni),方法:两出一进,两个 ERT,一个 IRT

三、详细配置:

CE1:

复制代码
evpn-overlay enable
#
ip vpn-instance A
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity evpn
  vpn-target 1:1 import-extcommunity evpn
 vxlan vni 1000
#
bridge-domain 10
 vxlan vni 5010
 evpn
  route-distinguisher 5010:1
  vpn-target 5010:1 export-extcommunity
  vpn-target 1:1 export-extcommunity
  vpn-target 5010:1 import-extcommunity
#
bridge-domain 20
 vxlan vni 5020
 evpn
  route-distinguisher 5020:1
  vpn-target 5010:1 export-extcommunity
  vpn-target 1:1 export-extcommunity
  vpn-target 5010:1 import-extcommunity
#
interface Vbdif10
 ip binding vpn-instance A
 ip address 10.1.1.254 255.255.255.0
 arp collect host enable
#
interface Vbdif20
 ip binding vpn-instance A
 ip address 10.2.2.254 255.255.255.0
 mac-address 0001-0001-0001
 vxlan anycast-gateway enable
 arp collect host enable
#
interface GE1/0/0.10 mode l2
 encapsulation dot1q vid 10
 bridge-domain 10
#
interface GE1/0/0.20 mode l2
 encapsulation dot1q vid 20
 bridge-domain 20
#
interface GE1/0/1
 undo portswitch
 undo shutdown
 ip address 10.1.12.1 255.255.255.252
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
#
interface Nve1
 source 1.1.1.1
 vni 5010 head-end peer-list protocol bgp
 vni 5020 head-end peer-list protocol bgp
#
bgp 12
 router-id 1.1.1.1
 undo default ipv4-unicast
 peer 2.2.2.2 as-number 12
 peer 2.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo peer 2.2.2.2 enable
 #
 l2vpn-family evpn
  policy vpn-target
  peer 2.2.2.2 enable
  peer 2.2.2.2 advertise irb
#
ospf 1 router-id 1.1.1.1
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0
  network 10.1.12.0 0.0.0.3
#

CE2:

复制代码
evpn-overlay enable
#
ip vpn-instance A
 ipv4-family
  route-distinguisher 2:2
  vpn-target 1:1 export-extcommunity evpn
  vpn-target 1:1 import-extcommunity evpn
 vxlan vni 1000
#
bridge-domain 20
 vxlan vni 5020
 evpn
  route-distinguisher 5020:2
  vpn-target 1:1 export-extcommunity
  vpn-target 5010:1 export-extcommunity
  vpn-target 5010:1 import-extcommunity
#
bridge-domain 30
 vxlan vni 5030
 evpn
  route-distinguisher 5030:2
  vpn-target 1:1 export-extcommunity
  vpn-target 5010:1 export-extcommunity
  vpn-target 5010:1 import-extcommunity
#
interface Vbdif20
 ip binding vpn-instance A
 ip address 10.2.2.254 255.255.255.0
 mac-address 0001-0001-0001
 vxlan anycast-gateway enable
 arp collect host enable
#
interface Vbdif30
 ip binding vpn-instance A
 ip address 10.3.3.254 255.255.255.0
 arp collect host enable
#
interface GE1/0/0.20 mode l2
 encapsulation dot1q vid 20
 bridge-domain 20
#
interface GE1/0/0.30 mode l2
 encapsulation dot1q vid 30
 bridge-domain 30
#
interface GE1/0/1
 undo portswitch
 undo shutdown
 ip address 10.1.12.2 255.255.255.252
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
#
interface Nve1
 source 2.2.2.2
 vni 5020 head-end peer-list protocol bgp
 vni 5030 head-end peer-list protocol bgp
#
bgp 12
 router-id 2.2.2.2
 undo default ipv4-unicast
 peer 1.1.1.1 as-number 12
 peer 1.1.1.1 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo peer 1.1.1.1 enable
 #
 l2vpn-family evpn
  policy vpn-target
  peer 1.1.1.1 enable
  peer 1.1.1.1 advertise irb
#
ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 10.1.12.0 0.0.0.255
#

四、验证:

1、查看 bgp evpn 邻居关系是否建立:

2、查看 vxlan 隧道状态:

3、做 ping 通测试

相关推荐
幽络源小助理3 分钟前
如何从零开始学习黑客技术?网络安全入门指南
网络·学习·web安全
luck_lin1 小时前
linux添加新硬盘挂载分区和数据迁移
linux·运维·分区扩容
四时久成2 小时前
服务器认证系统
运维·服务器
徐子元竟然被占了!!2 小时前
Windows Server 2019 DateCenter搭建 FTP 服务器
运维·服务器·windows
-L72 小时前
进入docker中mysql容器的方法
运维·mysql·docker·容器
wayuncn4 小时前
影响服务器托管费用的因素
运维·服务器·数据中心·服务器托管·物理服务器租用·服务器机柜·idc机房托管
喜欢你,还有大家4 小时前
Linux笔记10——shell编程基础-4
linux·运维·服务器·笔记
司徒轩宇4 小时前
Python secrets模块:安全随机数生成的最佳实践
运维·python·安全
weixin_456904274 小时前
C# .NET Framework 4.0 网络编程完全指南
网络·c#·.net
wjm05194 小时前
jenkins使用publishover ssh 进行远程连接
运维·ssh·jenkins