本实验是在GNS3环境进行的。在实验中EVPN做为控制面,负责通知各PE建立VXLAN隧道。VXLAN做为转发平面,负责转发二层流量。拓扑很简单,有一台P设备兼做路由反射器,P设备下联了三台PE。每台PE下接了一台VPC用于测试联通性。
PE1--vpc1
|
P-------PE2--vpc2
|
PE3--vpc3
三台vpc配置了同一网段的地址。实验结果是三台vpc可以互相ping通
基础的配置这里面就忽略了,主要是接口地址配置的ISIS配置。保证环回地址互通。P设备的环回地址为9.9.9.9。另外三台PE的环回地址为:1.1.1.1,2.2.2.2,3.3.3.3
P设备关键配置如下:
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
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
#
l2vpn-family evpn
peer 2.2.2.2 enable
peer 2.2.2.2 advertise irb
peer 2.2.2.2 reflect-client
peer 2.2.2.2 advertise encap-type vxlan
peer 1.1.1.1 enable
peer 1.1.1.1 advertise irb
peer 1.1.1.1 reflect-client
peer 1.1.1.1 advertise encap-type vxlan
peer 3.3.3.3 enable
peer 3.3.3.3 advertise irb
peer 3.3.3.3 reflect-client
peer 3.3.3.3 advertise encap-type vxlan
主要是跟三台PE建立evpn邻居,注意要加下encap-type vxlan 表明EVPN使用vxlan做为转发平面。PE设备的BGP的重点配置如下:
bgp 100
peer 9.9.9.9 as-number 100
#
ipv4-family unicast
undo peer 9.9.9.9 enable
#
l2vpn-family evpn
peer 9.9.9.9 enable
peer 9.9.9.9 advertise irb
peer 9.9.9.9 advertise encap-type vxlan
9.9.9.9是路由反射器的环回地址。这里面只列也了PE1的配置,另外两台基本一样。
PE上再配置evpn实例和bd二层域,注意要启用bd模式。这里二层域统一使用vxlan的vni为1000
evpn vpn-instance vpn1 bd-mode
route-distinguisher 1.1.1.1:100
vpn-target 1.1.1.1:100 export-extcommunity
vpn-target 1.1.1.1:100 import-extcommunity
#
bridge-domain 10
vxlan vni 1000 split-horizon-mode
evpn binding vpn-instance vpn1
interface Ethernet1/0/9.10 mode l2
encapsulation untag
bridge-domain 10
这里注意在bd下配置vxlan要配置水平分割split-horizon-mod。这样从vxlan隧道学习到的mac不会发给其它隧道,避免环路产生。但这也要求每台PE都要跟其它PE建立VXLAN隧道,即要求全互联模式。
下联端口是Ethernet1/0/9,由于是直接接vpc的,不需要配置VLAN,所以使用了untag模式。
最后配置nve接口,使得各pe之前可通过bgp evpn的通知,建立VXLAN隧道
interface Nve1
source 1.1.1.1
vni 1000 head-end peer-list protocol bgp
其它两台PE的配置基本一样,只是要把source更改为自己的环回地址。配置完成之后查看vxlan隧道:disp vxlan tun
会发现每台PE都跟另外两台PE建立了vxlan隧道了,而且下联的vpc二层互联,彼此都能互相ping通!
华三的VSI就相当于华为的BD,华为需要通过NVE发现对端VTEP,华三不需要,华三的VSI-IF接口就是三层接口
1、华三设备配置
1)配置ISIS,使环回地址互通
2)配置BGP,使能l2vpn evpn邻居
3)配置VSI,关键配置如下:
l2vpn enable
vsi vpna
vxlan 1000
evpn encapsulation vxlan
route-distinguisher 100:1000
vpn-target 100:1000 export-extcommunity
vpn-target 100:1000 import-extcommunity
interface GigabitEthernet1/0/2
port link-mode route
combo enable fiber
xconnect vsi vpna
bgp 100
peer 9.9.9.9 as-number 100
peer 9.9.9.9 connect-interface LoopBack0
address-family l2vpn evpn
undo policy vpn-target
peer 9.9.9.9 enable