今天给大家介绍EVPN的相关内容。本文以华为eNSP模拟器为工具,设计并实现了一个典型的EVPN配置集中式网关的应用场景,并完成了相应的配置。
阅读本文,您需要对EVPN有一定的了解,如果您对此还存在困惑,欢迎查阅我博客内的其他文章,相信您一定会有所收获!
推荐阅读文章:
VXLAN详解(一)
VXLAN详解(二)
VXLAN详解(三)
VXLAN中EVPN技术详解(一)——EVPN实现VXLAN隧道控制
VXLAN中EVPN技术详解(二)——EVPN与VXLAN分布式网关
一、实验拓扑及要求
实验拓扑如上所示,现在要求使用配置如图所示的数据中心集中式网关,并要求VXLAN隧道使用EVPN技术实现。
二、实验配置命令
(一)开启EVPN路由协议相关配置命令
要使得CE设备开启EVPN相关协议,就必须在全局模式下使能EVPN,相关配置命令如下:
evpn-overlay enable
(二)BGP配置相关命令
在实现EVPN相关配置,就必须先配置BGP的EVPN对等体,与常见的BGP对等体配置和MPLS BGP配置类似,唯一区别的地方在于后面的l2vpn-family evpn下使能EVPN对等体,相关配置命令如下:
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
(三)BD域配置相关命令
要想配置EVPN,就必须给BD域配置RD和RT值,相关配置如下所示:
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 100:11
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 100:21
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
注意:同一个VXLAN对应的BD域中RT值应该配置的相同,这样才能实现Type 3路由的发送和接受正常。
(四)NVE隧道配置相关命令
与手动指定NVE隧道时的配置不同,在这里NVE隧道的配置我们使用的是EVPN传递Type 3路由,指导NVE隧道的建立,相关配置命令如下:
interface Nve1
source 1.1.1.1
vni 10 head-end peer-list protocol bgp
vni 20 head-end peer-list protocol bgp
#
三、实验效果
在理论上,按照上述配置,四台设备之间是可以互通的,但是还是由于华为eNSP对CE设备支持中的BUG,导致我们并不能实现预期的效果,但是我们可以看到VXLAN隧道和EVPN路由还是实现了正常传递的。
四、附录——CE1和CE2相关配置命令
CE1:
evpn-overlay enable
#
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 100:11
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 100:21
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
interface Vbdif10
ip address 192.168.10.254 255.255.255.0
#
interface Vbdif20
ip address 192.168.20.254 255.255.255.0
#
interface GE1/0/0
undo portswitch
undo shutdown
ip address 155.1.11.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Nve1
source 1.1.1.1
vni 10 head-end peer-list protocol bgp
vni 20 head-end peer-list protocol bgp
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 155.1.11.0 0.0.0.255
CE2:
evpn-overlay enable
#
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 100:12
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 100:22
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
interface GE1/0/0
undo portswitch
undo shutdown
ip address 155.1.12.2 255.255.255.0
#
interface GE1/0/1
undo shutdown
#
interface GE1/0/1.10 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface GE1/0/1.20 mode l2
encapsulation dot1q vid 20
bridge-domain 20
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Nve1
source 2.2.2.2
vni 10 head-end peer-list protocol bgp
vni 20 head-end peer-list protocol bgp
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 1.1.1.1 enable
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 1.1.1.1 enable
peer 3.3.3.3 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 155.1.12.0 0.0.0.255
原创不易,转载请说明出处:https://blog.csdn.net/weixin_40228200/article/details/119715560