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

到此实验结束

相关推荐
小马爱打代码7 分钟前
SpringBoot原生实现分布式MapReduce计算
spring boot·分布式·mapreduce
欧先生^_^10 分钟前
OSPF网络协议
网络·网络协议·智能路由器
悻运33 分钟前
如何配置Spark
大数据·分布式·spark
懒惰的橘猫44 分钟前
Spark集群搭建之Yarn模式
大数据·分布式·spark
光而不耀@lgy1 小时前
C++初登门槛
linux·开发语言·网络·c++·后端
joker_zsl1 小时前
docker的安装和简单使用(ubuntu环境)
运维·docker·容器
2401_824256861 小时前
Spark-Streaming
大数据·分布式·spark
Run1.1 小时前
深入解析 Linux 中动静态库的加载机制:从原理到实践
linux·运维·服务器
VI8664956I261 小时前
全链路自动化AIGC内容工厂:构建企业级智能内容生产系统
运维·自动化·aigc
合新通信 | 让光不负所托1 小时前
【合新通信】浸没式液冷光模块与冷媒兼容性测试技术报告
大数据·网络·光纤通信