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

到此实验结束

相关推荐
机器学习之心16 分钟前
基于双向时序卷积网络(BiTCN)与支持向量机(SVM)混合模型的时间序列预测代码Matlab源码
网络·支持向量机·matlab
躲猫猫的喵喵1 小时前
Ubuntu2204降内核版本
linux·运维·服务器·ubuntu
zdslovezy1 小时前
CentOS 系统升级 OpenSSH 和 OpenSSL 的完整方案
linux·运维·centos
止水编程 water_proof2 小时前
Java-HTTP响应以及HTTPS(下)
网络·网络协议·http
HIT_Weston2 小时前
18、【Ubuntu】【远程开发】技术方案分析:私网ip掩码
linux·tcp/ip·ubuntu
cccccc语言我来了2 小时前
(Linux (6):从包管理到工具探索,构建系统操作基础认知)
linux·运维·服务器
好望角雾眠2 小时前
第四阶段C#通讯开发-9:网络协议Modbus下的TCP与UDP
网络·笔记·网络协议·tcp/ip·c#·modbus
网安小白的进阶之路2 小时前
A模块 系统与网络安全 第四门课 弹性交换网络-5
网络·安全·web安全
8K超高清2 小时前
高校巡展:中国传媒大学+河北传媒学院
大数据·运维·网络·人工智能·传媒
Sirius Wu3 小时前
Rclone实战技巧
分布式