本文主要是介绍H3C EVPN 网关配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、H3C集中式EVPN网关配置
1、需求:
使用Router A、Router B为与服务器连接的VTEP设备;
Router C为与广域网连接的集中式EVPN网关设备;
Router D为RR,负责在路由器之间反射BGP路由。
虚拟机VM 1和VM 3属于VXLAN 10;VM 2和VM 4属于VXLAN 20。
相同VXLAN之间可以二层互通,不同VXLAN之间、VXLAN与广域网之间可以通过集中式EVPN网关互通。
2、实验步骤:
1、配置IP地址和单播路由协议
2、配置VXLAN与VSI,创建EVPN实例
3、配置BGP L2VPN EVPN
4、接口关联VSI实例
3、拓扑架构:
4、配置命令:
Device-RTD:
#sysname RTD#ip vpn-instance vpn1 //创建VPN实例route-distinguisher 1:1 //赋予RD值,RD是本地PE路由器上VPN的唯一标识#address-family ipv4 //创建RIB IPv4地址族,并进入RIB IPv4地址族视图vpn-target 2:2 import-extcommunity //配置入方向的RT值vpn-target 2:2 export-extcommunity //配置出方向的RT值#address-family evpn //进入IPV4 EVPN视图vpn-target 1:1 import-extcommunity //配置入方向的RT值vpn-target 1:1 export-extcommunity //配置出方向的RT值#vxlan tunnel mac-learning disable //命令用来关闭远端MAC地址自动学习功能,如果网络中存在攻击,为了避免学习到错误的远端MAC地址,可以通过本命令手工关闭远端MAC地址自动学习功能。#ospf 1 //配置OSPF路由area 0.0.0.0#l2vpn enable //全局开启l2vpn能力vxlan tunnel arp-learning disable //命令用来关闭远端ARP自动学习功能#vsi vpna //VXLAN与VSI绑定gateway vsi-interface 1vxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 4.4.4.4 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0ip address 11.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/1ip address 12.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/2ip address 13.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#interface Vsi-interface1 //创建VSI接口并绑定VPN实例ip binding vpn-instance vpn1ip address 10.1.1.1 255.255.255.0mac-address 0001-0001-0001distributed-gateway local //命令用来配置VSI虚接口为分布式网关接口。在分布式VXLAN IP网关组网中,多个网关上同一VXLAN的VSI虚接口需要配置相同的IP地址。为了避免IP地址冲突,需要在VSI虚接口上执行本命令,以防止VSI虚接口上报地址冲突,导致VSI虚接口不可用。#interface Vsi-interface2ip binding vpn-instance vpn1l3-vni 1000 //配置L3VPN的VXLAN ID,分布式网关组网中,需要在网关上配置L3VNI。在网关之间通过VXLAN隧道转发流量时,属于同一租户的流量通过L3VNI来标识。#bgp 200group evpn internalpeer evpn connect-interface LoopBack0peer 1.1.1.1 group evpnpeer 2.2.2.2 group evpnpeer 3.3.3.3 group evpn#address-family l2vpn evpnundo policy vpn-targetpeer evpn enablepeer evpn reflect-client#
Device-RTA:
#sysname RTA#vxlan tunnel mac-learning disable#ospf 1area 0.0.0.0#l2vpn enable#vsi vpnaarp suppression enablevxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#vsi vpnbarp suppression enablevxlan 20evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 1.1.1.1 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0ip address 11.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable#Device-RTB:#sysname RTB#vxlan tunnel mac-learning disable#ospf 1area 0.0.0.0#l2vpn enable#vsi vpnaarp suppression enablevxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#vsi vpnbarp suppression enablevxlan 20evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 2.2.2.2 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0ip address 12.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/1xconnect vsi vpna //将三层接口与VSI关联后,从该接口接收到的报文,将通过查找关联VSI的MAC地址表进行转发。#interface GigabitEthernet0/2xconnect vsi vpnb#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable#
Device-RTC:
#sysname RTC#vxlan tunnel mac-learning disable#ospf 1default-route-advertise always //将缺省路由引入到OSPF路由区域,使用import-route命令不能引入缺省路由,如果要引入缺省路由,必须使用该命令。当本地路由器的路由表中没有缺省路由时,要产生一个描述缺省路由的Type-5 LSA应使用always关键字area 0.0.0.0l2vpn enable#vsi vpnagateway vsi-interface 1vxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#vsi vpnbgateway vsi-interface 2vxlan 20evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 3.3.3.3 255.255.255.255ospf 1 area 0.0.0.0#interface LoopBack1ip address 20.1.1.1 255.255.255.255#interface GigabitEthernet0/0ip address 13.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#interface Vsi-interface1ip address 10.1.1.1 255.255.255.0#interface Vsi-interface2ip address 10.1.2.1 255.255.255.0#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable
5、VM配置截图:
6、测试结果:
查看Router C上的EVPN路由信息,可以看到Router C发送了网关的MAC/IP路由和IMET(Inclusive multicast Ethernet tag route集成多播以太标记路由)路由,并接收到Router A和Router B发送的MAC/IP路由和IMET路由。
查看Router C上的Tunnel接口信息,可以看到VXLAN模式的Tunnel接口处于up状态。
查看Router C上的VSI虚接口信息,可以看到VSI虚接口处于up状态。
查看Router C上的VSI信息,可以看到VSI内创建的VXLAN、与VXLAN关联的VXLAN隧道、与VSI关联的VSI虚接口等信息。
查看Router C上VSI的EVPN ARP表项信息,可以看到已学习到了虚拟机的ARP信息。
查看Router C上FIB表项信息,可以看到已学习到了虚拟机的转发表项信息。
虚拟机VM 1、VM 2、VM 3、VM 4之间互访测试。
二、H3C 分布式EVPN网关配置
1、拓扑说明:
Router A、Router B为分布式EVPN网关设备;
Router C为与外部网络(广域网)连接的边界网关设备;
Router D为RR(反射器),负责在路由器之间反射BGP路由;
虚拟机VM 1和VM 3属于VXLAN 10;
VM 2和VM 4属于VXLAN 20;
相同VXLAN之间可以二层互通;
不同VXLAN之间通过分布式EVPN网关实现三层互通;
VXLAN与广域网之间通过边界网关实现三层互通。
2、配置命令:
RTA:
RTA:#sysname RTA#ip vpn-instance vpn1route-distinguisher 1:1#address-family ipv4vpn-target 2:2 import-extcommunityvpn-target 2:2 export-extcommunity#address-family evpnvpn-target 1:1 import-extcommunityvpn-target 1:1 export-extcommunity#vxlan tunnel mac-learning disable#ospf 1area 0.0.0.0#l2vpn enablevxlan tunnel arp-learning disable#vsi vpnagateway vsi-interface 1arp suppression enablevxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#vsi vpnbgateway vsi-interface 2arp suppression enablevxlan 20evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 1.1.1.1 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 11.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/1port link-mode routecombo enable copperxconnect vsi vpna#interface GigabitEthernet0/2port link-mode routecombo enable copperxconnect vsi vpnb#interface Vsi-interface1ip binding vpn-instance vpn1ip address 10.1.1.1 255.255.255.0mac-address 0001-0001-0001local-proxy-arp enabledistributed-gateway local#interface Vsi-interface2ip binding vpn-instance vpn1ip address 10.1.2.1 255.255.255.0mac-address 0002-0002-0002local-proxy-arp enabledistributed-gateway local#interface Vsi-interface3ip binding vpn-instance vpn1l3-vni 1000#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable#
RTB:
#sysname RTB#ip vpn-instance vpn1route-distinguisher 1:2#address-family ipv4vpn-target 2:2 import-extcommunityvpn-target 2:2 export-extcommunity#address-family evpnvpn-target 1:1 import-extcommunityvpn-target 1:1 export-extcommunity#vxlan tunnel mac-learning disable#ospf 1area 0.0.0.0#vlan 1#l2vpn enablevxlan tunnel arp-learning disable#vsi vpnagateway vsi-interface 1arp suppression enablevxlan 10evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#vsi vpnbgateway vsi-interface 2arp suppression enablevxlan 20evpn encapsulation vxlanroute-distinguisher autovpn-target auto export-extcommunityvpn-target auto import-extcommunity#interface LoopBack0ip address 2.2.2.2 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 12.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/1port link-mode routecombo enable copperxconnect vsi vpna#interface GigabitEthernet0/2port link-mode routecombo enable copperxconnect vsi vpnb#interface Vsi-interface1ip binding vpn-instance vpn1ip address 10.1.1.1 255.255.255.0mac-address 0001-0001-0001local-proxy-arp enabledistributed-gateway local#interface Vsi-interface2ip binding vpn-instance vpn1ip address 10.1.2.1 255.255.255.0mac-address 0002-0002-0002local-proxy-arp enabledistributed-gateway local#interface Vsi-interface3ip binding vpn-instance vpn1l3-vni 1000#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable#
RTC:
#sysname RTC#ip vpn-instance vpn1route-distinguisher 1:3#address-family ipv4vpn-target 2:2 import-extcommunityvpn-target 2:2 export-extcommunity#address-family evpnvpn-target 1:1 import-extcommunityvpn-target 1:1 export-extcommunity#vxlan tunnel mac-learning disable#ospf 1default-route-advertise alwaysarea 0.0.0.0#l2vpn enablevxlan tunnel arp-learning disable#interface LoopBack0ip address 3.3.3.3 255.255.255.255ospf 1 area 0.0.0.0#interface LoopBack1ip binding vpn-instance vpn1ip address 20.1.1.1 255.255.255.255#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 13.1.1.2 255.255.255.252ospf 1 area 0.0.0.0#interface Vsi-interface3ip binding vpn-instance vpn1l3-vni 1000#bgp 200peer 4.4.4.4 as-number 200peer 4.4.4.4 connect-interface LoopBack0#address-family l2vpn evpnpeer 4.4.4.4 enable#ip vpn-instance vpn1#address-family ipv4 unicastimport-route direct#
RTD:
#sysname RR#ospf 1area 0.0.0.0#interface LoopBack0ip address 4.4.4.4 255.255.255.255ospf 1 area 0.0.0.0#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 11.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/1port link-mode routecombo enable copperip address 12.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#interface GigabitEthernet0/2port link-mode routecombo enable copperip address 13.1.1.1 255.255.255.252ospf 1 area 0.0.0.0#bgp 200group evpn internalpeer evpn connect-interface LoopBack0peer 1.1.1.1 group evpnpeer 2.2.2.2 group evpnpeer 3.3.3.3 group evpn#address-family l2vpn evpnundo policy vpn-targetpeer evpn enablepeer evpn reflect-client#
3、VM配置
VM1:
VM2:
VM3:
VM4:
4、查看配置结果:
查看EVPN网关设备的VXLAN隧道状态,以RTA为例:
查看VSI接口状态信息,以RTA为例:
继续查看VSI的详细信息:
查看VSI的ARP表项(本地VM的ARP信息):
查看VSI的EVPN ARP表项:
5、VM之间通信互访测试:
VM1访问VM2、VM3的路径:
VM1访问VM3、外部网络的路径:
转载:H3C集中式EVPN网关配置
H3C 分布式EVPN网关配置
这篇关于H3C EVPN 网关配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!