EVPN配置实例(⼆)——EVPN分布式⽹关
今天给⼤家介绍EVPN的相关内容。本⽂以华为eNSP模拟器为⼯具,设计并实现了⼀个典型的EVPN配置分布式⽹关的应⽤场景,并完成了相应的配置。
阅读本⽂,您需要对EVPN有⼀定的了解,如果您对此还存在困惑,欢迎查阅我博客内的其他⽂章,相信您⼀定会有所收获!
推荐阅读⽂章:
强烈推荐您阅读下列⽂章:
⼀、实验拓扑及要求
实验拓扑如上所⽰,现在要求配置EVPN实现分布式⽹关。
⼆、实验配置命令
(⼀)BGP相关配置
BGP的配置与EVPN配置集中式⽹关的场景⼤致相似,但是由于在EVPN集中式⽹关配置场景下,EVPN所起到的作⽤只是知道VXLAN隧道的建⽴,⽽不⽤传递Type 2的路由,因此在EVPN实现分布式⽹关配置中,必须在BGP视图下⼿⼯发布Type 2的路由。相关配置命令如下:
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
#
ipv4-family unicast
peer 2.2.2.2 enable
#
l2vpn-family evpn
undo policy vpn-target
peer 2.2.2.2 enable
peer 2.2.2.2 advertise irb
#
(⼆)分布式⽹关Vbdif接⼝相关配置
在分布式⽹关场景下,每个CE设备上都需要配置Vbdif接⼝,以作为下游虚拟机的⽹关,在分布式⽹关场景下,必须开启ARP相关设置,配置命令如下:
interface Vbdif10
ip binding vpn-instance A
ip address 192.168.10.254 255.255.255.0
arp broadcast-detect enable
arp collect host enable
#
(三)VPN实例配置相关命令
为了实现租户之间的隔离与EVPN路由的正常传递,我们需要配置VPN实例,并配置RD和RT的值,相关配置如下:
ip vpn-instance A
ipv4-family
route-distinguisher 100:2
vpn-target 100:100 export-extcommunity evpn
vpn-target 100:100 import-extcommunity evpn
vxlan vni 100
#
(四)BD域相关配置
BD域的配置与EVPN集中式⽹关下的配置⼤致相同,相关配置代码如下:
peerbridge-domain 10
vxlan vni 10
evpn
route-distinguisher 100:10
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
三、实验效果
(⼀)PC与⽹关互通
(⼆)PC1与PC3、PC4互通
四、附录——CE1相关代码evpn-overlay enable
#
ip vpn-instance A
ipv4-family
route-distinguisher 100:2
vpn-target 100:100 export-extcommunity evpn vpn-target 100:100 import-extcommunity evpn vxlan vni 100
#
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 100:10
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 100:20
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
interface Vbdif10
ip binding vpn-instance A
ip address 192.168.10.254 255.255.255.0
arp broadcast-detect enable
arp collect host enable
#
interface Vbdif20
ip binding vpn-instance A
ip address 192.168.20.254 255.255.255.0
ip address 192.168.20.254 255.255.255.0 arp broadcast-detect enable
arp collect host enable
#
interface GE1/0/0
undo portswitch
undo shutdown
ip address 155.1.11.1 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 1.1.1.1 255.255.255.255
#
interface Nve1
source1.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 #
ipv4-family unicast
peer 2.2.2.2 enable
#
l2vpn-family evpn
undo policy vpn-target
peer 2.2.2.2 enable
peer 2.2.2.2 advertise irb
#
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
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论