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

到此实验结束

相关推荐
M78佐菲4 小时前
Linux学习笔记:TCP协议
linux·笔记·学习·tcp/ip·算法
Brilliantwxx4 小时前
【Linux】 进程(9)程序与进程地址空间(基础+进阶+面试题)
linux·运维·服务器·开发语言·c++
不怕犯错,就怕不做5 小时前
git prune 自动删除本地记录中那些远程已经不存在的分支引用
linux·服务器·git
richdata5 小时前
商品数字化不是先做大数据,而是先把数据变成可用决策
大数据·运维·数据治理·商品数字化·智能补货·ai商品决策
weixin_416667966 小时前
【无标题】
运维·服务器·网络
予昊6 小时前
从零实现“在线五子棋对战“:WebSocket 实时通信 + 段位匹配
java·开发语言·网络·websocket
一池秋_6 小时前
arm低配linux设备,桌面应用冷启动提速方法
linux·运维·arm开发
上海云盾-小余8 小时前
流量攻击复盘:为什么 WAF 完好,业务依旧瘫痪
运维·服务器·网络
IT大白鼠8 小时前
Docker 私有仓库管理:Harbor 企业级仓库搭建与镜像全生命周期管理
运维·docker·容器
戴西软件8 小时前
戴西iDWS.3DViz Suite数据轻量化可视化软件,从传统桌面软件向云端协同的重大突破
大数据·运维·网络·人工智能·机器学习·3d