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与外网测试地址互访

到此实验结束

相关推荐
一氧化二氢.h2 小时前
通俗解释redis高级:redis持久化(RDB持久化、AOF持久化)、redis主从、redis哨兵、redis分片集群
redis·分布式·缓存
知星小度S2 小时前
系统核心解析:深入操作系统内部机制——进程管理与控制指南(一)【进程/PCB】
linux·运维·服务器·进程
编码浪子5 小时前
趣味学RUST基础篇(异步)
服务器·rust·负载均衡
爱睡觉的圈圈5 小时前
分布式IP代理集群架构与智能调度系统
分布式·tcp/ip·架构
九河云6 小时前
华为云 GaussDB:金融级高可用数据库,为核心业务保驾护航
网络·数据库·科技·金融·华为云·gaussdb
独行soc6 小时前
2025年渗透测试面试题总结-66(题目+回答)
java·网络·python·安全·web安全·adb·渗透测试
码农101号6 小时前
运维安全05 - iptables规则保存与恢复
运维·网络·安全
Empty_7776 小时前
SELinux安全上下文
linux·服务器·安全
bug攻城狮7 小时前
解决Ubuntu中apt-get -y安装时弹出交互提示的问题
linux·运维·ubuntu
夜阑珊夭夭8 小时前
linux自定义网卡名字
linux·运维