Skip to main content
开放网络的先行者与推动者—星融元
加入我们技术支持(Support)  TEL:(+86)4000989811
BGP-EVPN-VXLAN

配置指导:CX-N系列交换机部署BGP-EVPN-VXLAN

1 目标与物理网络拓扑

本文主要描述如何在Asterfusion CX308P-N和CX532P-N(以下简称CX308和CX532)搭建的网络上部署如下解决方案:

  • BGP EVPNVXLAN

在网络上承载VXLAN网络,将原本在服务器上进行的封装、去封装全部从Server端卸载到CX308内的VTEP上,并且在网络上启动BGP EVPN,自动化地创建VXLAN隧道、传递虚拟网络路由。

如上解决方案共用一个物理拓扑,如图1所示:

物理网络拓扑
图1:物理网络拓扑

部署过程中所涉及到的设备、接口及管理网口的IP地址如下表1所示:

设备名称设备型号IP地址备注
Spine1CX532-N10.230.1.7 
Spine2CX532-N10.230.1.8 
Leaf1CX308-N10.230.1.18 
Leaf2CX308-N10.230.1.19 
Servrr1X8610.230.1.11互联网口ens1f2
Server2X8610.230.1.12互联网口ens1f3
表1:设备管理口列表

2 硬件与软件环境

部署环境中涉及到的硬件和软件如表2和表3所示:

名称型号硬件指标数量备注
交换机CX532-N【参见产品彩页】2
交换机CX308-N【参见产品彩页】2
服务器X862本方案采用10G网卡
光模块10GSFP+4
光模块100GQSFP2812
光纤多模100G适用6
光纤多模10G/25G适用2
表2:硬件环境

名称版本备注
AFCV5.0.0
服务器系统CentOS Linux 7.9.2009
服务器内核3.10.0-1127.18.2.el7
表3:软件环境

3 解决方案:BGP EVPN和VXLAN

3.1 逻辑组网与配置思路

BGP EVPN和VXLAN方案网络拓扑与接口配置
图3:BGP EVPN和VXLAN方案网络拓扑与接口配置

配置思路:

1)配置各交换机的端口IP信息

2)配置Leaf1和Leaf2的VLAN信息

3)配置各交换机的BGP

4)配置Leaf1和Leaf2使能EVPN

5)Leaf1和Leaf2创建Vnet,绑定VLAN

6)Leaf1和Leaf2配置二层和三层VXLAN映射

7)配置Server1和Server2的IP和路由信息

8)测试Server1和Server2的连通性

9)查看Leaf1的路由信息

10)查看Leaf2的路由信息

3.2 配置步骤

3.2.1 配置各交换机的端口IP信息

Spine1:
Spine1# configure terminal
Spine1(config)# interface ethernet 0/4
Spine1(config-if-0/4)# ip address 10.0.10.2/24
Spine1(config)# interface ethernet 0/8
Spine1(config-if-0/8)# ip address 10.0.11.2/24

Spine2:
Spine2# configure terminal
Spine2(config)# interface ethernet 0/4
Spine2(config-if-0/4)# ip address 10.1.10.2/24
Spine2(config)# interface ethernet 0/8
Spine2(config-if-0/8)# ip address 10.1.11.2/24

Leaf1:
Leaf1# configure terminal
Leaf1(config)# interface ethernet 0/48
Leaf1(config-if-0/4)# ip address 10.0.10.1/24
Leaf1(config)# interface ethernet 0/52
Leaf1(config-if-0/8)# ip address 10.1.10.1/24

Leaf2:
Leaf2# configure terminal
Leaf2(config)# interface ethernet 0/48
Leaf2(config-if-0/4)# ip address 10.0.11.1/24
Leaf2(config)# interface ethernet 0/52
Leaf2(config-if-0/8)# ip address 10.1.11.1/24
sudo config interface ip add Ethernet52 10.1.11.1/24

3.2.2 配置Leaf1和Leaf2的VLAN信息并配置好网口速率

Leaf1:
Leaf1# configure terminal 
Leaf1(config)# vlan 10
Leaf1(config)# interface vlan 10
Leaf1(config-vlanif-10)# ip address 100.0.10.1/24
Leaf1(config-vlanif-10)# mac-address 18:17:25:55:17:69
Leaf1(config)# interface ethernet 0/2
Leaf1(config-if-0/2)# switchport access vlan 10
Leaf1(config-if-0/2)# speed 10000

Leaf2:
Leaf2# configure terminal 
Leaf2(config)# vlan 20
Leaf2(config)# interface vlan 20
Leaf2(config-vlanif-20)# ip address 100.0.20.1/24
Leaf2(config-vlanif-20)# mac-address 18:17:25:55:17:71
Leaf2(config)# interface ethernet 0/3
Leaf2(config-if-0/3)# switchport access vlan 20
Leaf2(config-if-0/3)# speed 10000

3.2.3 配置各交换机的BGP

Spine1:
Spine1# configure terminal
Spine1(config)# router bgp 65228
Spine1(config-router)# bgp router-id 10.10.0.100
Spine1(config)# interface loopback 0
Spine1(config-loif-0)# ip address 10.10.0.100/32
Loopback ip will be used as bgp router-id in frr
Spine1(config)# router bgp 65228
Spine1(config-router)# no bgp ebgp-requires-policy 
Spine1(config-router)# neighbor 10.0.10.1 remote-as 65230
Spine1(config-router)# neighbor 10.0.11.1 remote-as 65231
Spine1(config-router)# address-family ipv4 unicast
Spine1(config-router)# address-family l2vpn evpn
Spine1(config-router-af)# neighbor 10.0.10.1 activate
Spine1(config-router-af)# neighbor 10.0.11.1 activate
Spine1(config-router-af)# advertise-all-vni

Spine2:
Spine1# configure terminal
Spine1(config)# router bgp 65229
Spine1(config-router)# bgp router-id 10.10.0.110
Spine1(config)# interface loopback 0
Spine1(config-loif-0)# ip address 10.10.0.110/32
Loopback ip will be used as bgp router-id in frr
Spine1(config)# router bgp 65229
Spine1(config-router)# no bgp ebgp-requires-policy 
Spine1(config-router)# neighbor 10.1.10.1 remote-as 65230
Spine1(config-router)# neighbor 10.1.11.1 remote-as 65231
Spine1(config-router)# address-family ipv4 unicast
Spine1(config-router)# address-family l2vpn evpn
Spine1(config-router-af)# neighbor 10.1.10.1 activate
Spine1(config-router-af)# neighbor 10.1.11.1 activate
Spine1(config-router-af)# advertise-all-vni

Leaf1:
Leaf1# configure terminal 
Leaf1(config)# router bgp 65230
Leaf1(config-router)# bgp router-id 10.10.0.120
Leaf1(config)# interface loopback 0
Leaf1(config-loif-0)# ip address 10.10.0.120/32
Change Loopback0 ip from 10.1.0.1/32 to 10.10.0.120/32
Loopback ip will be used as bgp router-id in frr
Leaf1(config)# router bgp 65230
Leaf1(config-router)# no bgp ebgp-requires-policy
Leaf1(config-router)# neighbor 10.0.10.2 remote-as 65228
Leaf1(config-router)# neighbor 10.1.10.2 remote-as 65229
Leaf1(config-router)# address-family ipv4 unicast
Leaf1(config-router)# network 10.10.0.120/32
Leaf1(config-router)# address-family l2vpn evpn
Leaf1(config-router-af)# neighbor 10.0.10.2 activate
Leaf1(config-router-af)# neighbor 10.1.10.2 activate
Leaf1(config-router-af)# advertise-all-vni

Leaf2:
Leaf2# configure terminal
Leaf2(config)# router bgp 65231
Leaf2(config-router)# bgp router-id 10.10.0.130
Leaf2(config)# interface loopback 0
Leaf2(config-loif-0)# ip address 10.10.0.130/32
Change Loopback0 ip from 10.1.0.1/32 to 10.10.0.130/32
Loopback ip will be used as bgp router-id in frr
Leaf2(config)# router bgp 65231
Leaf2(config-router)# no bgp ebgp-requires-policy
Leaf2(config-router)# neighbor 10.0.11.2 remote-as 65228
Leaf2(config-router)# neighbor 10.1.11.2 remote-as 65229
Leaf2(config-router)# address-family ipv4 unicast
Leaf2(config-router)# network 10.10.0.130/32
Leaf2(config-router)# address-family l2vpn evpn
Leaf2(config-router-af)# neighbor 10.0.11.2 activate
Leaf2(config-router-af)# neighbor 10.1.11.2 activate
Leaf2(config-router-af)# advertise-all-vni

3.2.4 配置Leaf1和Leaf2使能EPVN

Leaf1:
Leaf1# configure terminal
Leaf1(config)# interface vxlan 0
Leaf1(config-vxlanif-0)# source 10.10.0.120
Leaf1(config)# evpn-overlay enable

Leaf2:
Leaf2# configure terminal
Leaf2(config)# interface vxlan 0
Leaf2(config-vxlanif-0)# source 10.10.0.130
Leaf2(config)# evpn-overlay enable

3.2.5 Leaf1和Leaf2创建Vnet,绑定VLAN

Leaf1:
Leaf1(config)# vrf 123
Leaf1(config-vrf)# mac 18:17:25:55:17:69
Leaf1(config-vrf)# interface vlan 10
Leaf1(config-vlanif-10)# vrf 123

Leaf2:
Leaf2(config)# vrf 456
Leaf2(config-vrf)# mac 18:17:25:55:17:71
Leaf2(config-vrf)# interface vlan 20
Leaf2(config-vlanif-20)# vrf 456

3.2.6 Leaf1和Leaf2配置二层和三层VXLAN映射

Leaf1:
Leaf1(config)# vlan 10
Leaf1(config-vlan-10)# vni 10
Leaf1(config)# vrf 123
Leaf1(config-vrf)# vni 1000

Leaf2:
Leaf2(config)# vlan 20
Leaf2(config-vlan-20)# vni 20
Leaf2(config)# vrf 456
Leaf2(config-vrf)# vni 1000

3.2.7 保存配置并重新加载

sonic# write
sonic# reload

3.2.8 配置Server1和Server2的IP和路由信息

Server1:


[root@server1 ~]# ifconfig ens1f2
配置Server1 IP和路由信息
[root@server1 ~]# route add -net 100.0.20.0 netmask 255.255.255.0 gw 100.0.10.1 dev ens1f2

Server2:

配置Server2 IP和路由信息
[root@server1 ~]# route add -net 100.0.10.0 netmask 255.255.255.0 gw 100.0.20.1 dev ens1f3

3.2.9 测试Server1和Server2的连通性

[root@server1 ~]# ping 100.0.20.3
ping 100.0.20.3
[root@server1 ~]# ping 100.0.10.2
ping 100.0.10.2

3.2.10 查看Leaf1的路由信息

查看VTEP信息
admin@Leaf1:~$ show evpn status
查看VTEP信息
交换机路由信息
admin@Leaf1:~$ ip route show
交换机路由信息
下面信息显示Server2的路由转发到了Leaf1
admin@Leaf1:~$ ip neigh show nud all | grep Vlan
Server2的路由转发到了Leaf1
admin@Leaf1:~$ sudo bridge fdb |grep vxlan
 sudo bridge fdb |grep vxlan
admin@Leaf1:~$ show ip route vrf Vnet123
show ip route vrf Vnet123

3.2.11 查看Leaf2的路由信息

查看VTEP信息
admin@Leaf2:~$ show evpn status
查看VTEP信息
交换机路由信息
admin@Leaf2:~$ ip route show
交换机路由信息
下面信息显示Server2的路由转发到了Leaf1
admin@Leaf2:~$ ip neigh show nud all | grep Vlan
Server2的路由转发到了Leaf1
admin@Leaf2:~$ sudo bridge fdb |grep vxlan
sudo bridge fdb |grep vxlan
admin@Leaf2:~$ show ip route vrf Vnet123
show ip route vrf Vnet123

A-lab-云网络, A-lab-部署验证

对星融元产品感兴趣?

立即联系!

返回顶部

© 星融元数据技术(苏州)有限公司 苏ICP备17070048号-2