H3C-对称IRB分布式EVPN-VXLAN实验

1.首先配置IP地址,配置OSPF形成三台设备环回口可达(省略)

2.配置MP-BGP

VTEP1和VTEP2一样的配置

复制代码
bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0
 #
 address-family l2vpn evpn    #配置l2vpn中的EVPN地址族
  peer 2.2.2.2 enable

Spine设备

复制代码
bgp 100
 group evpn internal
 peer evpn connect-interface LoopBack0
 peer 1.1.1.1 group evpn
 peer 3.3.3.3 group evpn
 #
 address-family l2vpn evpn
  undo policy vpn-target    #取消对RT值检查
  peer evpn enable
  peer evpn reflect-client    #配置反射器,将VTEP1和2配位客户端

3.配置VXLAN相关

VTEP1和VTEP2一样的配置无需修改

复制代码
ip vpn-instance user1    #创建实例隔离租户数据
 route-distinguisher 1:1    #该RD用于区分RT5路由
 #
 address-family ipv4    #该RT影响RT5路由学习
  vpn-target 2:2 import-extcommunity
  vpn-target 2:2 export-extcommunity
 #
 address-family evpn    #该RT影响RT2的MAC/IP路由学习
  vpn-target 1:1 import-extcommunity
  vpn-target 1:1 export-extcommunity
  
开启L2VPN功能与关闭VXLAN的APR和MAC地址学习
 l2vpn enable
 vxlan tunnel arp-learning disable
 vxlan tunnel mac-learning disable 
 
配置VSI
vsi vpna
 vxlan 10    #配置VNI为10
 evpn encapsulation vxlan    #封装类型为VXLAN
  route-distinguisher auto    #该 RD 用于区分 RT2 MAC 路由,RT2 MAC/IP 路由与不同 VXLAN 隧道
  vpn-target auto        #该 RT 影响 RT2 MAC 路由与 RT2 MAC/IP 路由学习与 VXLAN 隧道建立

#
vsi vpnb
 vxlan 20
 evpn encapsulation vxlan
  route-distinguisher auto
  vpn-target auto export-extcommunity
  vpn-target auto import-extcommunity
#

配置VSI端口,实现三层跨VXLAN访问
interface Vsi-interface1
 ip binding vpn-instance user1    #绑定VPN实例
 ip address 192.168.1.254 255.255.255.0    #配置网关
 mac-address 0001-0001-0001    #配置IP地址
 distributed-gateway local    #配置VSI虚接口为分布式网关接口
#
interface Vsi-interface2
 ip binding vpn-instance user1
 ip address 192.168.2.254 255.255.255.0
 mac-address 0002-0002-0002
 distributed-gateway local
#
interface Vsi-interface3
 ip binding vpn-instance user1
 l3-vni 1000    #配置L3-VNI

在这里解释一下VSI-interface接口的作用

L3VNI的作用有:

  • 对称 IRB 中引入的概念,用于标识属于同一租户,能够进行三层互通的流量
  • 一个 L3 VNI关联一个 VPN 实例,但可关联多个 L2 VNI
  • L3 VNI无需配置 IP 地址,系统会自动产生 MAC 地址,即 Router MAC

命令到这个时候已经可以完成VM之间的互访了,但是还不能完成访问VXLAN网络之外的网络。所以再进行下方命令

4.配置Spine引入外部路由

复制代码
ip vpn-instance user1
 route-distinguisher 1:1
 #
 address-family ipv4
  vpn-target 2:2 import-extcommunity
  vpn-target 2:2 export-extcommunity
 #
 address-family evpn
  vpn-target 1:1 import-extcommunity
  vpn-target 1:1 export-extcommunity
 #
interface GigabitEthernet1/0/3    #配置与外网相连的端口绑定实例

 ip binding vpn-instance user1
 ip address 20.0.0.1 255.255.255.0
 #
开启L2VPN功能与关闭VXLAN的APR和MAC地址学习
 l2vpn enable
 vxlan tunnel arp-learning disable
 vxlan tunnel mac-learning disable 
 
配置VSI
vsi vpna
 vxlan 10    #配置VNI为10
 evpn encapsulation vxlan    #封装类型为VXLAN
  route-distinguisher auto    #该 RD 用于区分 RT2 MAC 路由,RT2 MAC/IP 路由与不同 VXLAN 隧道
  vpn-target auto        #该 RT 影响 RT2 MAC 路由与 RT2 MAC/IP 路由学习与 VXLAN 隧道建立

#
vsi vpnb
 vxlan 20
 evpn encapsulation vxlan
  route-distinguisher auto
  vpn-target auto export-extcommunity
  vpn-target auto import-extcommunity
  
配置VSI接口并绑定L3-VNI 1000
interface Vsi-interface3
 ip binding vpn-instance user1
 l3-vni 1000

bgp 100
 group in internal
 peer in connect-interface LoopBack0
 peer 1.1.1.1 group in
 peer 3.3.3.3 group in
 #
 address-family l2vpn evpn
  undo policy vpn-target
  peer in enable
  peer in reflect-client
 #
 ip vpn-instance user1    #在实例中引入缺省路由发布到其他IBGP
  #
  address-family ipv4 unicast
   default-route imported
   import-route static
   
ip route-static vpn-instance user1 0.0.0.0 0 20.0.0.2    #配置缺省路由

5.R1配置静态路由和NAT(省略)

6.实验测试

VTEP1设备查看自动隧道建立情况

VTEP1查看mac地址查看情况,可以发现每个地址都在对应的Vsi接口中学习到了

VM1与另外三台VM测试

VM1与外网测试地址互访

到此实验结束

相关推荐
砚凝霜23 分钟前
软考网络工程师|第 5 章 广域网基础技术完整备考笔记
网络·笔记
国科安芯26 分钟前
卫星星务计算机数据管理中SEU容错机制的技术实现研究——以AS32S601存储器ECC架构为例
网络·单片机·算法·fpga开发·架构·云计算·risc-v
兵bing1 小时前
Docker Compose 配置文件归纳总结-千问
运维·docker·容器
Lust Dusk1 小时前
记一次web渗透做题思路解析
网络·安全·web安全·网络安全
IT小盘1 小时前
17-构建Prompt测试集-提示词优化不再凭感觉
服务器·windows·prompt
INNOVIX稳石机器人1 小时前
从“存得下”到“管得活”:稳石四向穿梭车如何重塑密集仓储新逻辑?
大数据·运维
2401_858286112 小时前
OS81.【Linux】基于环形队列的多生产者-多消费者模型
linux·运维·服务器·环形队列
U-Mail邮件系统2 小时前
企业邮箱搭建用自建还是租用?合规、成本与安全性对比解析
服务器·网络·企业邮箱系统
X1A0RAN2 小时前
Jenkins Pipeline 变量打印指南
运维·servlet·jenkins
七夜zippoe2 小时前
DolphinDB 能耗优化实战:节能策略设计、效果评估与 ROI 分析
网络·dolphindb·roi·效果评估·能耗优化·策略设计