华为Cloud campus BGP EVPN 实验

BGP EVPN 基础实验

实验要求:

BGP EVPN 建立同子网互访

配置思路:

1.配置underlay 各loopback口互通。

2.开启BGP EVPN功能

[CE1]evpn-overlay enable

3.CE1,CE3建立BGP evpn peer

bgp 100

 peer 10.1.3.3 as-number 100

 peer 10.1.3.3 connect-interface LoopBack0

 #

 ipv4-family unicast

  peer 10.1.3.3 enable

 #

 l2vpn-family evpn

  policy vpn-target

  peer 10.1.3.3 enable

3.CE1配置BD,VNI,BGP evpn的RD,RT值,CE3类似

bridge-domain 100

 vxlan vni 100

 evpn

  route-distinguisher 100:10

  vpn-target 100:100 export-extcommunity

  vpn-target 100:100 import-extcommunity

bridge-domain 200

 vxlan vni 200

 evpn

  route-distinguisher 200:10

  vpn-target 200:200 export-extcommunity

  vpn-target 200:200 import-extcommunity

4.配置子接口,CE3类推配置

interface GE1/0/1

 undo shutdown

#

interface GE1/0/1.100 mode l2

 encapsulation dot1q vid 10

 bridge-domain 100

#

interface GE1/0/1.200 mode l2

 encapsulation dot1q vid 20

 bridge-domain 200

5.配置NVE,VNI,BGP 建立VXLAN隧道

interface Nve1

 source 10.1.1.1

 vni 100 head-end peer-list protocol bgp

 vni 200 head-end peer-list protocol bgp

配置验证检查:

可以看到收到了对方的路由,RD值是100:10,200:10的路由

并且建立NVE接口后EVPN会自动建立EVPNinstance 100和200的实例。通过EVPN instance相互建立VXLAN隧道,

查看详细的路由:

正常能看出来是VXLAN数据,但是wires hark需要升级。升级后可以看到完整数据包!

BGP EVPN集中式网关实验

BGP EVPN 集中式网关,配置步骤如下:

1.配置underlay网络互联,环口互通

2.网关和各子网的环口建立BGP连接

[CE1-bgp]dis this

#

bgp 100

 peer 10.1.1.1 as-number 100

 peer 10.1.1.1 connect-interface LoopBack0

 peer 10.1.3.3 as-number 100

 peer 10.1.3.3 connect-interface LoopBack0

3.建立bgp evpn连接,网关为RR,使得EVPN路由可以互相传递。

 l2vpn-family evpn

  policy vpn-target

  peer 10.1.1.1 enable

  peer 10.1.1.1 reflect-client

  peer 10.1.3.3 enable

  peer 10.1.3.3 reflect-client

4.建立BD域和vni值,关联RD RT值,设置VBDIF ip地址

interface Vbdif100

 ip address 10.1.10.254 255.255.255.0

#

interface Vbdif200

 ip address 10.1.20.254 255.255.255.0

5.建立VXLAN的NVE接口,并source接口,vni采用BGP对等体

interface Nve1

 source 10.1.2.2

 vni 100 head-end peer-list protocol bgp

 vni 200 head-end peer-list protocol bgp

6.配置子接口封装vlan,并关联vlan和BD域,网关不需要配

interface GE1/0/1

 undo shutdown

#

interface GE1/0/1.100 mode l2

 encapsulation dot1q vid 10

 bridge-domain 100

#

interface GE1/0/1.200 mode l2

 encapsulation dot1q vid 20

 bridge-domain 200

7.配置两侧二层交换机trunk口和access口互联

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 10 20

#

interface GigabitEthernet0/0/2

 port link-type access

 port default vlan 10

#

interface GigabitEthernet0/0/3

 port link-type access

 port default vlan 20

8.正常配置完成后,模拟器的bug,无法ping通。删除NVE,保留一条VNI即可不同VNI互通

9.总结,集中式网关,仅仅比二层BGP EVPN多了个VBDIF ip地址,作为vni的网关而已。

可以看到数据在VXLAN的隧道里传输到对端。解封VXLAN隧道得到内部MAC,IP地址进行通信。

网关通告mac路由,

CE1有到达网关的路由

BGP EVPN 分布式网关实验

分布式网关EVPN实验

配置步骤:

1.配置全网互联,串口互联

2.配置开启evpn,配置bgp ,配置evpn peer,配置RR,取消策略RT,

3.配置BD,EVPN RT,VNI, 再配置一下三层RTexport,子接口vlan,绑定bd

4.配置VRF,配置三层vni,三层RT

5.配置VBDif接口,绑定VRF,配置IP,mac,arp主机收集,开启VXLAN 网关功能

6.配置NVE ,头端列表,

详细步骤:

1.    CE1,AR1,CE2,CE3 三层互联,环口互联,下面交换机vlan互联

2.    CE1,CE2,CE3开启EVPN功能,配置BGP协议,CE2作为EVPN RR,不作为VXLAN 网关,

CE1,CE3只需跟CE2建立BGP邻居,并通告IRB路由,CE2需要关闭RT策略过滤

[CE1-bgp]dis this   (CE3与CE1相同都与CE2J建立EVPN对等体)

#

bgp 100

 peer 10.1.2.2 as-number 100

 peer 10.1.2.2 connect-interface LoopBack0

 #

 ipv4-family unicast

  peer 10.1.2.2 enable

 #

 l2vpn-family evpn

  policy vpn-target

  peer 10.1.2.2 enable

  peer 10.1.2.2 advertise irb

[CE2-bgp]dis this

#

bgp 100

 peer 10.1.1.1 as-number 100

 peer 10.1.1.1 connect-interface LoopBack0

 peer 10.1.3.3 as-number 100

 peer 10.1.3.3 connect-interface LoopBack0

 #

 ipv4-family unicast

  peer 10.1.1.1 enable

  peer 10.1.2.2 enable

  peer 10.1.3.3 enable

 #

 l2vpn-family evpn

  undo policy vpn-target

  peer 10.1.1.1 enable

  peer 10.1.1.1 advertise irb

  peer 10.1.1.1 reflect-client

  peer 10.1.3.3 enable

  peer 10.1.3.3 advertise irb

  peer 10.1.3.3 reflect-client

3.    CE1,CE3上配置BD域100,200,配置VNI,开启EVPN,配置RD,RT值,创建子接口,将子接口放入不同BD域内(CE3略,与CE1相同)

[CE1-bd100]dis this

#

bridge-domain 100

 vxlan vni 100

 evpn

  route-distinguisher 100:10

  vpn-target 100:100 export-extcommunity

  vpn-target 100:100 import-extcommunity

  vpn-target 100:200 export-extcommunity  //增加3层RT值,交叉生成路由

#

bridge-domain 200

 vxlan vni 200

 evpn

  route-distinguisher 200:20

  vpn-target 200:200 export-extcommunity

  vpn-target 200:200 import-extcommunity

  vpn-target 100:200 export-extcommunity  //增加3层RT值,交叉生成路由

[CE1-bgp]int g 1/0/1

[CE1-GE1/0/1]undo shut

interface GE1/0/1.100 mode l2

 encapsulation dot1q vid 10

 bridge-domain 100

interface GE1/0/1.200 mode l2

 encapsulation dot1q vid 20

 bridge-domain 200

4.    CE1,CE3上配置三层vpn实例和三层VNI,并配置分布式网关,

配置VBD接口IP地址和MAC地址,开启VXLAN分布式网关,并绑定VRF,使能主机ARP收集(CE3可直接复制)

[CE1-vpn-instance-yeslab]dis this

#

ip vpn-instance yeslab

 ipv4-family

  route-distinguisher 100:200

  vpn-target 100:200 export-extcommunity

  vpn-target 100:200 export-extcommunity evpn

  vpn-target 100:200 import-extcommunity

  vpn-target 100:200 import-extcommunity evpn

 vxlan vni 1000     //配置三层VNI

interface Vbdif100         //配置VBD接口和VRF绑定

 ip binding vpn-instance yeslab

 ip address 10.1.10.254 255.255.255.0

 mac-address 0000-005e-0001    //CE3可配置相同mac

 vxlan anycast-gateway enable

 arp collect host enable

interface Vbdif200

 ip binding vpn-instance yeslab

 ip address 10.1.20.254 255.255.255.0

mac-address 0000-005e-0002

 vxlan anycast-gateway enable

 arp collect host enable

5.    CE1,CE3上配置头端列表(CE3略)

interface Nve1

 source 10.1.1.1

 vni 100 head-end peer-list protocol bgp

 vni 200 head-end peer-list protocol bgp

6.检查命令

BGP EVPN外部路由引入(采用type5路由通告外部路由)

配置任务:

1.CE1,2,3是VXLAN组网,AR2是出口设备,PC1-4可以通过BGP EVPN访问AR2。

2.要求CE2通过BGPevpn引入外部路由通告到EVPN网络中。(采用type5路由通告外部路由)

(拓扑中的BGPevpn已经建立基础上做此实验。)

  1. 配置步骤

建立vpn instance,配置RD,RT,VXLAN VNI,(有多少个租户,就有多少RT,但这种情况下适合多个租户共享同样的网络,如果PC1要访问出口,但PC2不想访问出口,可以建立多个vpn instance,单独建立RT给PC2,BGP evpn vpn instance里单独引入路由。),下面是一个vpn实例里配置多个RT,

[CE2-vpn-instance-yeslab]dis this

#

ip vpn-instance yeslab

 ipv4-family

  route-distinguisher 1:1

  vpn-target 100:200 export-extcommunity  (三层RT值)

  vpn-target 100:200 export-extcommunity evpn (如果不加EVPN,无法接收到其他设备的instance的主机ip路由。)

         vpn-target 100:200 import-extcommunity (三层RT值)

  vpn-target 100:200 import-extcommunity evpn (如果不加EVPN,无法接收到其他设备的instance的主机ip路由。)

 vxlan vni 5000  (因为instance内的路由是引入到BGP evpn中,所以VNI不需要相同,这个三层的VNI是用来封装)

  1.  把需要引入的接口放到vpn instance里

interface LoopBack1

 ip binding vpn-instance yeslab

 ip address 22.22.22.22 255.255.255.255

interface GE1/0/1

 undo portswitch

 undo shutdown

 ip binding vpn-instance yeslab

 ip address 192.168.1.1 255.255.255.252

  1.  出口设备必须要有回包路由

[AR2]ip route-static 10.1.10.0 24 192.168.1.1

[AR2]ip route-static 10.1.20.0 24 192.168.1.1

[CE2]ip route-static 0.0.0.0 0 vpn-instance yeslab 192.168.1.2(这条是错的,不能部署到全局路由表,要部署到VPN instance路由表)

[CE2]ip route-static vpn-instance yeslab 0.0.0.0 0 vpn-instance yeslab 192.168.1

.2

  1.  BGP引入vpn instance 中的直连,静态路由,并通告到EVPN中

[CE2-bgp]dis this

#

bgp 100

 peer 10.1.1.1 as-number 100

 peer 10.1.1.1 connect-interface LoopBack0

 peer 10.1.3.3 as-number 100

 peer 10.1.3.3 connect-interface LoopBack0

 #

 ipv4-family unicast

  peer 10.1.1.1 enable

  peer 10.1.3.3 enable

 #

 ipv4-family vpn-instance yeslab

  import-route direct

  import-route static

  advertise l2vpn evpn

 #

 l2vpn-family evpn

  undo policy vpn-target

  peer 10.1.1.1 enable

  peer 10.1.1.1 advertise irb

  peer 10.1.1.1 reflect-client

  peer 10.1.3.3 enable

  peer 10.1.3.3 advertise irb

  peer 10.1.3.3 reflect-client

  1.  配置NVE接口,否则BGP不会把type5路由传送给其他EVPN设备

[CE2-Nve1]dis this

#

interface Nve1

 source 10.1.2.2

 vni 100 head-end peer-list protocol bgp

 vni 200 head-end peer-list protocol bgp

  1. 检查BGP evpn type5路由

再检查其他CE是否收到type5

  1.  检查PCping出口路由

  1.  查看抓包,发现去的包VNI是用的vni5000,回包用的是vni1000,

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值