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 通测试

相关推荐
xuanzdhc23 分钟前
Linux 基础IO
linux·运维·服务器
愚润求学28 分钟前
【Linux】网络基础
linux·运维·网络
m0_738120721 小时前
玄机——某学校系统中挖矿病毒应急排查
网络·安全·web安全
小和尚同志2 小时前
29.4k!使用 1Panel 来管理你的服务器吧
linux·运维
小米里的大麦9 天前
014 Linux 2.6内核进程调度队列(了解)
linux·运维·驱动开发
程序员的世界你不懂9 天前
Appium+python自动化(三十)yaml配置数据隔离
运维·appium·自动化
yenggd9 天前
动态ds-vnp之normal和shortcut两种方式配置案例
网络·华为
Cachel wood9 天前
Spark教程6:Spark 底层执行原理详解
大数据·数据库·分布式·计算机网络·spark
算法练习生9 天前
Linux文件元信息完全指南:权限、链接与时间属性
linux·运维·服务器
浩浩测试一下9 天前
渗透测试指南(CS&&MSF):Windows 与 Linux 系统中的日志与文件痕迹清理
linux·运维·windows·安全·web安全·网络安全·系统安全