• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

求Vxlan+EBGP EVPN的配置案例

2023-11-09提问
  • 0关注
  • 0收藏,459浏览
粉丝:0人 关注:0人

问题描述:

如图,目前设备没到货,在模拟器上搭建环境

两个千兆交换机配置同一网段

汇聚交换机和路由器之间配置ospf

路由器之间配置EBGP邻居

用vxlan和EVPN怎么做到两个千兆交换机互通,查了手册没有类似的案例,请求解决方法和配置方法


组网及组网描述:


最佳答案

粉丝:133人 关注:8人

如上图所示,leaf_01leaf_02作为VxLANVTEP设备,下挂VM1VM2VM3虚机或物理机。构建OVERLAY网络使各个主机间可以二三层互通。

同时Spine_01Spine_02作为Border连接外部网络,同时作为OVERlAYRR角色负责转发EVPN的路由信息。

Spine采用S6800H1设备,R2509P02版本。

Leaf 采用S6800H1设备,R2509P02版本。


UnderLay 地址规划:

Spine_01:

Loopback0

1.1.1.1/32

vtep ip

Ten-GigabitEthernet1/0/1

10.1.1.1/30

连接leaf_01

Ten-GigabitEthernet1/0/2

10.1.2.1/30

连接leaf_02

Ten-GigabitEthernet1/0/3

10.1.3.1/30

连接Router_外网

 

 

 

Spine_02:

Loopback0

2.2.2.2/32

vtep ip

Ten-GigabitEthernet1/0/1

10.1.4.1/30

连接leaf_01

Ten-GigabitEthernet1/0/2

10.1.5.1/30

连接leaf_02

Ten-GigabitEthernet1/0/3

10.1.6.1/30

连接Router_外网

Leaf_01:

Loopback0

3.3.3.3/32

vtep ip

Ten-GigabitEthernet1/0/1

10.1.1.2/30

连接Spine_01

Ten-GigabitEthernet1/0/2

10.1.4.2/30

连接Spine_02

 

Leaf_02:

Loopback0

4.4.4.4/32

vtep ip

Ten-GigabitEthernet1/0/1

10.1.2.2/30

连接Spine_01

Ten-GigabitEthernet1/0/2

10.1.5.2/30

连接Spine_02

 

Router_外网:

GigabitEthernet1/0/1

10.1.3.2/32

连接Spine_01

GigabitEthernet1/0/2

10.1.6.2/32

连接Spine_02

 

 

 

 

UnderLay 地址配置:

按上述表格配置IP地址,配置loopback口及连接leaf_01leaf_02互联接口的ip地址,下面以Spine_01为例,其他设备配置类似。

 

[Spine_01]interface LoopBack 0

[Spine_01-LoopBack0] ip address 1.1.1.1 32

 

[Spine_01]interface Ten-GigabitEthernet1/0/1

[Spine_01-Ten-GigabitEthernet1/0/1]port link-mode route

[Spine_01-Ten-GigabitEthernet1/0/1]ip address 10.1.1.1 30

 

[Spine_01]interface Ten-GigabitEthernet1/0/2

[Spine_01-Ten-GigabitEthernet1/0/1]port link-mode route

[Spine_01-Ten-GigabitEthernet1/0/1]ip address 10.1.2.1 30

 

UnderLay 路由配置:

通过OSPF打通underlay的路由,配置OSPF使能loopback口及连接leaf_01leaf_02端口的OSPF协议,下面以Spine_01为例,其他设备配置类似。

 

ospf 1 router-id 1.1.1.1    //router-id使用loopback地址

 silent-interface all

 undo silent-interface Ten-GigabitEthernet1/0/1

 undo silent-interface Ten-GigabitEthernet1/0/2

area 0.0.0.0

  network 10.1.1.1 0.0.0.0

  network 10.1.2.1 0.0.0.0

  network 1.1.1.1  0.0.0.0

 

EVPN 初始配置:

Spine_01:配置MP-IBGP的邻居,Spine_01 Spine_02作为BGPRRSpine_02的配置相同。

#

bgp 100

 graceful-restart

 group evpn internal

 peer evpn connect-interface LoopBack0

 peer 3.3.3.3 group evpn

 peer 4.4.4.4 group evpn

#

 address-family l2vpn evpn

  undo policy vpn-target

  peer evpn enable

  peer evpn reflect-client

 

leaf_01:配置MP-IBGP的邻居,leaf_01 leaf_02作为BGPclientleaf_02的配置相同。

bgp 100

 graceful-restart

 peer 1.1.1.1 as-number 100

 peer 1.1.1.1 connect-interface LoopBack0

 peer 2.2.2.2 as-number 100

 peer 2.2.2.2 connect-interface LoopBack0

 #

 address-family l2vpn evpn

  peer 1.1.1.1 enable

  peer 2.2.2.2 enable

 

设备Overlay预配置:

Spine_01/Spine_02:配置如下的两条命令,然后保存配置重启设备。

[Spine_01]hardware-resource switch-mode 4

Do you want to change the specified hardware resource working mode? [Y/N]:y

The hardware resource working mode is changed, please save the configuration and reboot the system to make it effective.

[Spine_01]hardware-resource vxlan border24k

Do you want to change the specified hardware resource working mode? [Y/N]:y

The hardware resource working mode is changed, please save the configuration and reboot the system to make it effective.

<Spine_01>reboot

Start to check configuration with next startup configuration file, please wait.........DONE!

This command will reboot the device. Continue? [Y/N]:Y

 

注意:仅仅S68H1作为SPINE的时候才需要上述配置。

 

使能Vtep功能,配置l2vpn及禁止tunnel接口自动学习arpmac地址。

[Spine_01]vtep enable

[Spine_01]l2vpn enable

[Spine_01]vxlan tunnel arp-learning disable

[Spine_01]vxlan tunnel mac-learning disable

 

Leaf_01/leaf_02:配置如下的两条命令,然后保存配置重启设备。

 

[leaf_01]hardware-resource switch-mode 4

Do you want to change the specified hardware resource working mode? [Y/N]:y

The hardware resource working mode is changed, please save the configuration and reboot the system to make it effective.

[leaf_01]hardware-resource vxlan border24k

Do you want to change the specified hardware resource working mode? [Y/N]:y

The hardware resource working mode is changed, please save the configuration and reboot the system to make it effective.

<leaf_01>reboot

Start to check configuration with next startup configuration file, please wait.........DONE!

This command will reboot the device. Continue? [Y/N]:Y

 

配置l2vpn及禁止tunnel接口自动学习arpmac地址。

 

[leaf_01]l2vpn enable

[leaf_01]vxlan tunnel arp-learning disable

[leaf_01]vxlan tunnel mac-learning disable

 

使能vtep功能,并配置接入服务器的接口,如1/0/5端口为trunk,且使能vtep access port功能。

 

[leaf_01]vtep enable

 

[leaf_01]interface Ten-GigabitEthernet1/0/5

[LA1-Ten-GigabitEthernet1/0/5]vtep access port

 

Overlay网络的部署:

 

完整的环境中VCFC可以对OVERLAY的配置自动下发,本次实验室环境不涉及VCFC,因此这些配置需手工配置。

Leaf1的配置:创建租户所在的VPN实例,并配置RDRTRD采用1:l3vniRT采用的是0:l3vni

#

ip vpn-instance vpn1

 route-distinguisher 1:24001

 description SDN_VRF_vpn1

 #

 address-family ipv4

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 #

 address-family evpn

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 

创建VLAN

#

vlan 601 to 602

#

配置VSI实例,分别指定l2vni601602,开启arp抑制功能,关闭广播泛洪,配置Vxlan RD RT自动生成。

vsi SDN_VSI_601

 statistics enable

 arp suppression enable

 flooding disable all

 vxlan 601

 evpn encapsulation vxlan

  route-distinguisher auto

  vpn-target auto export-extcommunity

  vpn-target auto import-extcommunity

 

vsi SDN_VSI_602

statistics enable

 arp suppression enable

 flooding disable all

 vxlan 602

 evpn encapsulation vxlan

  route-distinguisher auto

  vpn-target auto export-extcommunity

  vpn-target auto import-extcommunity

 

配置连接VM1的接口,将VM1划入vxlan 601的网络。注意端口pvid设置为601,并且vxlan的接入模式为ethernet

#

interface Ten-GigabitEthernet1/0/5

 port link-mode bridge

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 601

port trunk pvid vlan 601

 vtep access port

 service-instance 601

  encapsulation s-vid 601

  xconnect vsi SDN_VSI_601 access-mode ethernet

#

配置连接VM2的接口,将VM2划入vxlan 602的网络。

#

interface Ten-GigabitEthernet1/0/6

 port link-mode bridge

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 602

port trunk pvid vlan 602

 vtep access port

 service-instance 602

  encapsulation s-vid 602

  xconnect vsi SDN_VSI_602 access-mode ethernet

#

 

创建VSI接口作为VM的网关。

interface Vsi-interface601

 description SDN_VSI_Interface_601

 ip binding vpn-instance vpn1

 ip address 10.1.2.1 255.255.255.0 sub

 mac-address 6805-ca21-d6e5

 distributed-gateway local

#

interface Vsi-interface602

 description SDN_VSI_Interface_602

 ip binding vpn-instance vpn1

 ip address 10.1.3.1 255.255.255.0 sub

 mac-address 6805-ca21-d6e5

 distributed-gateway local

#

将网关和对应的VSI实例绑定

 

vsi SDN_VSI_601

 gateway vsi-interface 601

#

vsi SDN_VSI_602

 gateway vsi-interface 602

 

创建L3VIN的三层接口,并绑定L3VNI

 

interface Vsi-interface24001

 description SDN_VRF_VSI_Interface_24001

 ip binding vpn-instance vpn1

 l3-vni 24001

#

配置BGPOVERLAY的路由发布出去

#

bgp 100

 ip vpn-instance vpn1

  address-family ipv4 unicast

   balance 4

   network 10.1.2.0 255.255.255.0

   network 10.1.2.1 255.255.255.255

   network 10.1.3.0 255.255.255.0

   network 10.1.3.1 255.255.255.255

#

此时leaf的配置配置结束,可以验证跨网段同leaf两个VM直接的互访了。

 

Leaf2的配置:

创建租户所在的VPN实例,并配置RDRTRD采用1:l3vniRT采用的是0:l3vni

#

ip vpn-instance vpn1

 route-distinguisher 1:24001

 description SDN_VRF_vpn1

 #

 address-family ipv4

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 #

 address-family evpn

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 

创建VLAN

#

vlan 601

#

配置VSI实例,分别指定l2vni601,开启arp抑制功能,关闭广播泛洪,配置Vxlan RD RT自动生成。

vsi SDN_VSI_601

 statistics enable

 arp suppression enable

 flooding disable all

 vxlan 601

 evpn encapsulation vxlan

  route-distinguisher auto

  vpn-target auto export-extcommunity

  vpn-target auto import-extcommunity

 

配置连接VM3的接口,将VM3划入vxlan 601的网络。注意端口pvid设置为601,并且vxlan的接入模式为ethernet

#

interface Ten-GigabitEthernet1/0/5

 port link-mode bridge

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 601

port trunk pvid vlan 601

 vtep access port

 service-instance 601

  encapsulation s-vid 601

  xconnect vsi SDN_VSI_601 access-mode ethernet

#

 

创建VSI接口作为VM的网关。

interface Vsi-interface601

 description SDN_VSI_Interface_601

 ip binding vpn-instance vpn1

 ip address 10.1.2.1 255.255.255.0 sub

 mac-address 6805-ca21-d6e5

 distributed-gateway local

#

将网关和对应的VSI实例绑定

 

vsi SDN_VSI_601

 gateway vsi-interface 601

 

创建L3VIN的三层接口,并绑定L3VNI

 

interface Vsi-interface24001

 description SDN_VRF_VSI_Interface_24001

 ip binding vpn-instance vpn1

 l3-vni 24001

#

配置BGPOVERLAY的路由发布出去

#

bgp 100

 ip vpn-instance vpn1

  address-family ipv4 unicast

   balance 4

   network 10.1.2.0 255.255.255.0

   network 10.1.2.1 255.255.255.255

#

至此leaf2的配置完毕,配置VM1VM2VM3IP地址验证三个VM直接的互通性。

 

OVERLAY网络VM间主机互访验证

 

主机

IP

GW

VM1

10.1.2.2

10.1.2.1

VM2

10.1.3.2

10.1.3.1

VM3

10.1.2.3

10.1.2.1

 

按照上述表格配置VM的地址,测试VM间互通性,并查看设备上学习的本端及远端主机的表项信息(具体命令见后文)。

 

部署SpineBorderOverlay与外部网络互通

 

Spine_01&Spine_02在两个核心设备上创建vpn实例,配置RD属性:100024001Spine_01),100124001Spine_02),RT属性:0:24001,并配置L3VNI接口。

 

ip vpn-instance vpn1

 route-distinguisher 1000:24001

 #

 address-family ipv4

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 #

 address-family evpn

  vpn-target 0:24001 import-extcommunity

  vpn-target 0:24001 export-extcommunity

 

创建L3VIN的三层接口,并绑定L3VNI

interface Vsi-interface24001

 description SDN_VRF_VSI_Interface_24001

 ip binding vpn-instance vpn1

 l3-vni 24001

#

配置Spine_01& Spine_02连接Router_外网的互联接口:

 

[Spine_01]interface Ten-GigabitEthernet1/0/3

[Spine_01-Ten-GigabitEthernet1/0/1]port link-mode route

[Spine_01-Ten-GigabitEthernet1/0/1]ip binding vpn-instance vpn1

[Spine_01-Ten-GigabitEthernet1/0/1]ip address 10.1.3.1 30

 

[Spine_02]interface Ten-GigabitEthernet1/0/2

[Spine_02-Ten-GigabitEthernet1/0/1]port link-mode route

[Spine_02-Ten-GigabitEthernet1/0/1]ip binding vpn-instance vpn1

[Spine_02-Ten-GigabitEthernet1/0/1]ip address 10.1.6.1 30

 

配置基于vpn实例的OSPF进程,与Router_外网建立邻居关系,接收Router_外网发布外部路由,并且引入BGP的路由。

Spine_01:

ospf 3 vpn-instance vpn1

 import-route bgp 100 allow-ibgp

 area 0.0.0.0

  network 10.1.3.1 0.0.0.0

#

Spine_02:

ospf 3 vpn-instance vpn1

 import-route bgp 100 allow-ibgp

 area 0.0.0.0

  network 10.1.6.1 0.0.0.0

#

 

配置Spine_01&Spine_02上的BGP,引入OSPF路由。

 

bgp 65205 instance SDN_INSTANCE_BGP

 ip vpn-instance vpn1

  address-family ipv4 unicast

   import-route ospf 3

 

至此与外网互通的工作配置完毕。

 

测试overlay与传统网络的互通

 

配置Router_外网连接Spine_01& Spine_02的互联接口:

 

[Router_外网]interface Ten-GigabitEthernet1/0/1

[Router_外网-Ten-GigabitEthernet1/0/1]port link-mode route

[Router_外网-Ten-GigabitEthernet1/0/1]ip address 10.1.3.2 30

 

[Router_外网]interface Ten-GigabitEthernet1/0/2

[Router_外网-Ten-GigabitEthernet1/0/1]port link-mode route

[Router_外网-Ten-GigabitEthernet1/0/1]ip address 10.1.6.2 30

 

配置Loopback,并发布在OSPF

interface LoopBack0

 ip address 220.1.1.1 255.255.255.255

#

ospf 1

area 0.0.0.0

  network 10.1.3.2 0.0.0.0

  network 10.1.6.2 0.0.0.0

  network 220.1.1.1 0.0.0.0

 

至此Router_外网设备的配置完毕,可以测试VM 220.1.1.1的互通性。

 

实验中涉及到的一些查看命令

 

查看设备的路由表:

 

<leaf_01>display ip routing-table vpn-instance vpn1

 

Destinations : 21       Routes : 21

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

220.1.1.1/32       BGP     255 2           2.2.2.1         Vsi24001

 

查看邻居信息:

 

<LA1>display bgp peer l2vpn evpn 

 

 BGP local router ID: 2.2.2.6

 Local AS number: 65205

 Total number of peers: 2                 Peers in established state: 2

 

  * - Dynamically created peer

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  2.2.2.4              65205     2184     1901    0      13 0030h02m Established

  2.2.2.5              65205     2109     1844    0      13 0030h02m Established

 

查看EVPN的路由表

 

<LA1>display  bgp  l2vpn evpn 

 

 BGP local router ID is 2.2.2.6

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

               Origin: i - IGP, e - EGP, ? - incomplete

 

 Total number of routes from all PEs: 27

 

 Route distinguisher: 1:601

 Total number of routes: 1

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >  [3][0][32][2.2.2.6]/80

                        0.0.0.0         0          100        32768   i

 

 Route distinguisher: 1:24001(vpn1)

 Total number of routes: 26

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >i [5][0][32][220.1.1.1]/80

                        2.2.2.1         2          100        0       ?

*  i                     2.2.2.1         2          100        0       ?

暂无评论

0 个回答

该问题暂时没有网友解答

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明