跨云平台与物理专线使用Vxlan实现两地二层互通,并使用ospf与bgp做底层链路主备

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

跨云平台与物理专线使⽤Vxlan实现两地⼆层互通,并使⽤ospf
与bgp做底层链路主备
Vxlan基础,已掌握可略过
VXLAN⽹络架构
VXLAN是NVO3中的⼀种⽹络虚拟化技术,通过将原主机发出的数据包封装在UDP中,并使⽤物理⽹络的IP、MAC作为外层头进⾏封装,然后在IP⽹络上传输,到达⽬的地后由隧道终结点解封装并将数据发送给⽬标主机。

通过VXLAN,虚拟⽹络可接⼊⼤量租户,且租户可以规划⾃⼰的虚拟⽹络,不需要考虑物理⽹络IP地址和⼴播域的限制,降低了⽹络管理的难度,同时满⾜虚拟机迁移和多租户的需求。

类似于传统的VLAN⽹络,VXLAN⽹络也有VXLAN⽹络内互访和VXLAN⽹络间互访。

VXLAN⽹络内互访
通过VXLAN技术可以实现在已有三层⽹络上构建虚拟⼆层⽹络,实现主机之间的⼆层互通
VXLAN⽹络内互访中涉及的概念如下:
⽹络标识VNI(VXLAN Network Identifier)
类似于传统⽹络中的VLAN ID,⽤于区分VXLAN段,不同VXLAN段的租户不能直接进⾏⼆层通信。

⼀个租户可以有⼀个或多个VNI,VNI由24⽐特组成,⽀持多达16M的租户。

⼴播域BD(Bridge Domain)
类似传统⽹络中采⽤VLAN划分⼴播域⽅法,在VXLAN⽹络中通过BD划分⼴播域。

在VXLAN⽹络中,将VNI以1:1⽅式映射到⼴播域BD,⼀个BD就表⽰着⼀个⼴播域,同⼀个BD内的主机就可以进⾏⼆层互通。

VXLAN隧道端点VTEP(VXLAN Tunnel Endpoints)
VTEP可以对VXLAN报⽂进⾏封装和解封装。

VXLAN报⽂中源IP地址为源端VTEP的IP地址,⽬的IP地址为⽬的端VTEP的IP地址。

⼀对VTEP地址就对应着⼀条VXLAN隧道。

在源端封装报⽂后通过隧道向⽬的端VTEP发送封装报⽂,⽬的端VTEP对接收到的封装报⽂进⾏解封装。

虚拟接⼊点VAP(Virtual Access Point)
VXLAN业务接⼊点,可以基于VLAN或报⽂流封装类型接⼊业务:
基于VLAN接⼊业务:在VTEP上建⽴VLAN与BD的⼀对⼀或多对⼀的映射。

这样,当VTEP收到业务侧报⽂后,根据VLAN与
BD的映射关系,实现报⽂在BD内进⾏转发。

基于报⽂流封装类型接⼊业务:在VTEP连接下⾏业务的物理接⼝上创建⼆层⼦接⼝,并配置不同的流封装类型,使得不同的接⼝接⼊不同的数据报⽂。

同时,将⼆层⼦接⼝与BD进⾏⼀⼀映射。

这样业务侧报⽂到达VTEP后,即会进⼊指定的⼆层⼦接⼝。

即根据⼆层⼦接⼝与BD的映射关系,实现报⽂在BD内进⾏转发。

⽹络虚拟边缘NVE(Network Virtualization Edge)
NVE是实现⽹络虚拟化功能的⽹络实体。

报⽂经过NVE封装转换后,NVE间就可基于三层基础⽹络建⽴⼆层虚拟化⽹络。

⼆层⽹关
类似传统⽹络的⼆层接⼊设备,在VXLAN⽹络中通过⼆层⽹关解决租户接⼊VXLAN虚拟⽹络,也可⽤于同⼀VXLAN虚拟⽹络的⼦⽹通信。

VXLAN⽹络间互访(集中式⽹关)
不同BD之间的主机不能直接进⾏⼆层通信,需要通过VXLAN三层⽹关实现主机间的三层通信。

集中式⽹关是指将三层⽹关集中部署在⼀台设备上,所有跨⼦⽹的流量都经过三层⽹关进⾏转发,实现流量的集中管理。

VXLAN⽹络间互访中涉及的概念如下:
三层⽹关
类似传统⽹络中不同VLAN的⽤户间不能直接进⾏⼆层互访,不同VNI之间的VXLAN及VXLAN和⾮VXLAN之间也不能直接相互通信。

为了使VXLAN之间,以及VXLAN和⾮VXLAN之间能够进⾏通信,引⼊了VXLAN三层⽹关的概念。

三层⽹关⽤于VXLAN虚拟⽹络的跨⼦⽹通信以及外部⽹络的访问。

VBDIF接⼝
类似于传统⽹络中采⽤VLANIF解决不同⼴播域互通的⽅法,在VXLAN中引⼊了VBDIF的概念。

VBDIF接⼝在VXLAN三层⽹关上配置,是基于BD创建的三层逻辑接⼝。

通过VBDIF接⼝配置IP地址可实现不同⽹段的VXLAN间,及VXLAN和⾮VXLAN的通信,也可实现⼆层⽹络接⼊三层⽹络。

VXLAN⽹络间互访(分布式⽹关)
分布式⽹关是指将VXLAN⼆层⽹关和三层⽹关部署在同⼀台设备上,VTEP设备既作为VXLAN⽹络中的⼆层⽹关设备,与主机对接,⽤于解决终端租户接⼊VXLAN虚拟⽹络的问题。

同时也作为VXLAN⽹络中的三层⽹关设备,实现跨⼦⽹的终端租户通信,以及外部⽹络的访问。

仅BGP EVPN⽅式部署VXLAN⽹络时⽀持分布式⽹关。

VXLAN分布式⽹关具有如下特点:
同⼀个VTEP节点既可以做VXLAN⼆层⽹关,也可以做VXLAN三层⽹关,部署灵活。

VTEP节点只需要学习⾃⾝连接服务器的ARP表项,⽽不必像集中式三层⽹关⼀样,需要学习所有服务器的ARP表项,解决了集中式三层⽹关带来的ARP表项瓶颈问题,⽹络规模扩展能⼒强
VXLAN报⽂封装格式
原始报⽂在封装过程中先被添加⼀个VXLAN帧头,再被封装在UDP报头中,并使⽤承载⽹络的IP、MAC地址作为外层头进⾏封装。

报⽂封装格式
现⽹实现⽅案
拓扑
拓扑描述
两个pop点均为IDC机房,拥有完整架构,以上拓扑主要摘出Vxlan相关设备,Site-1与Site-2间通过物理专线直连,同时两个Site同时使⽤物理专线接⼊华为云,在华为云购买云连接并配置路由打通两个站点
华为云与站点间使⽤静态路由⽅式(国内云平台BGP是伪BGP,不能根据线下通告的路由⾃动同步),直连专线链路使⽤ospf互联,site-2接⼊互联⽹
需求
- 两个站点服务器⼆层互通
- site-2互联⽹ip可以在site-1使⽤
- 优先使⽤云联⽹,直连专线做备⽤
- 主备倒换控制在毫秒级
需求分析
- 需求1要求两个site间实现⼆层互通,可以使⽤VPLS VLL Vxlan技术实现
- 需求2可以使⽤跨云平台GRE隧道或Vxlan技术实现
- 需求3与需求4根据需求1 2 来指定倒换⽅案
- 现⽹core设备为juniper mx系列,系统版本不⽀持RPM联动静态路由,也不⽀持跨条BFD检测,故⽆法使⽤浮动静态路由⽅式来做两端Vtep ip互通
- 同时云平台线路⾮直连不能建⽴ospf peer,所以也不能使⽤ospf主备路由⽅式做负载
综上,由于接⼊云平台所以不能建⽴完整mpls lsp 如果使⽤VPLS或VLL只能使⽤GRE承载PW会增⼤额外开销,且需求2还需独⽴实现,综合考虑最终选择使⽤Vxlan技术实现,根据最后两条分析决定跨云平台建⽴bgp与直连专线ospf两个协议间做主备。

⽅案配置
地址规划
设备loopback地址物理专线互联地址云平台互联地址
Site1-core192.168.39.5/3210.38.0.1/3010.39.0.1/30
Site2-core192.168.39.21/3210.38.0.2/3010.39.0.5/30
Vtep-1192.168.39.1/3010.40.0.2/30
Vtep-2192.168.39.17/3010.40.0.6/30
配置
基础线路主备
#Site1-core
set protocols bgp group Vxlan type external
set protocols bgp group Vxlan neighbor 192.168.39.21 multihop ttl 10
set protocols bgp group Vxlan neighbor 192.168.39.21 local-address 192.168.39.5
set protocols bgp group Vxlan neighbor 192.168.39.21 import Vxlanin
set protocols bgp group Vxlan neighbor 192.168.39.21 export Vxlanout
set protocols bgp group Vxlan neighbor 192.168.39.21 peer-as 65500
set protocols bgp group Vxlan neighbor 192.168.39.21 local-as 65501
set protocols bgp group Vxlan neighbor 192.168.39.21 bfd-liveness-detection minimum-interval 100
set protocols bgp group Vxlan neighbor 192.168.39.21 bfd-liveness-detection minimum-receive-interval 100
set protocols bgp group Vxlan neighbor 192.168.39.21 bfd-liveness-detection multiplier 3
set policy-options policy-statement Vxlanin term Vxlan from route-filter 192.168.39.17/32 exact
set policy-options policy-statement Vxlanin term Vxlan then accept
set policy-options policy-statement Vxlanin term 99 then reject
set policy-options policy-statement Vxlanout term Vxlan from route-filter 192.168.39.1/32 exact
set policy-options policy-statement Vxlanout term Vxlan then accept
set policy-options policy-statement Vxlanout term 99 then reject
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection minimum-receive-interval 100
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection multiplier 3
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection transmit-interval minimum-interval 100
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection minimum-receive-interval 100
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection multiplier 3
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection transmit-interval minimum-interval 100
set routing-options static route 192.168.39.21/32 next-hop 10.39.0.2
set routing-options static route 192.168.39.1/32 next-hop 10.40.0.2
#Site2-core
set protocols bgp group Vxlan type external
set protocols bgp group Vxlan family inet unicast rib-group fbf-group
set protocols bgp group Vxlan neighbor 192.168.39.5 multihop ttl 10
set protocols bgp group Vxlan neighbor 192.168.39.5 local-address 192.168.39.21
set protocols bgp group Vxlan neighbor 192.168.39.5 import Vxlanin
set protocols bgp group Vxlan neighbor 192.168.39.5 export Vxlanout
set protocols bgp group Vxlan neighbor 192.168.39.5 peer-as 65501
set protocols bgp group Vxlan neighbor 192.168.39.5 local-as 65500
set protocols bgp group Vxlan neighbor 192.168.39.5 bfd-liveness-detection minimum-interval 100
set protocols bgp group Vxlan neighbor 192.168.39.5 bfd-liveness-detection minimum-receive-interval 100
set protocols bgp group Vxlan neighbor 192.168.39.5 bfd-liveness-detection multiplier 3
set policy-options policy-statement Vxlanin term Vxlan from route-filter 192.168.39.1/32 exact
set policy-options policy-statement Vxlanin term Vxlan then accept
set policy-options policy-statement Vxlanin term 99 then reject
set policy-options policy-statement Vxlanout term Vxlan from route-filter 192.168.39.17/32 exact
set policy-options policy-statement Vxlanout term Vxlan then accept
set policy-options policy-statement Vxlanout term 99 then reject
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection minimum-receive-interval 100
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection multiplier 3
set protocols ospf area 0.0.0.0 interface xe-0/0/1.33 bfd-liveness-detection transmit-interval minimum-interval 100
set routing-options static route 192.168.39.5/32 next-hop 10.39.0.6
set routing-options static route 192.168.39.17/32 next-hop 10.40.0.6
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection minimum-receive-interval 100
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection multiplier 3
set protocols ospf area 0.0.0.0 interface xe-0/0/2.100 bfd-liveness-detection transmit-interval minimum-interval 100
Vxlan配置
#Vtep-1
interface LoopBack1
ip address 192.168.39.1 255.255.255.252
ospf network-type broadcast
ospf enable 1 area 0.0.0.0
bridge-domain 590
l2 binding vlan 520
vxlan vni 1001
bridge-domain 600
l2 binding vlan 590
vxlan vni 1002
interface Nve1
source 192.168.39.1
vni 1001 head-end peer-list 192.168.39.17
vni 1002 head-end peer-list 192.168.39.17
interface XGigabitEthernet0/0/3
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 520 590
#Vtep-2
interface LoopBack1
ip address 192.168.39.17 255.255.255.252
ospf network-type broadcast
ospf enable 1 area 0.0.0.0
bridge-domain 590
l2 binding vlan 520
vxlan vni 1001
bridge-domain 600
l2 binding vlan 590
vxlan vni 1002
interface Nve1
source 192.168.39.17
vni 1001 head-end peer-list 192.168.39.1
vni 1002 head-end peer-list 192.168.39.1
interface XGigabitEthernet0/0/3
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 590
以上配置可实现两个Site中服务器打上vlan 590标签就可实现⼆层互通,Vtep-1服务器打上vlan 520就可以使⽤Vtep-2互联⽹地址
注意由于封装了Vxlan头部,物理线路包括云平台MTU需要调整,最⼩调整为1550,或者服务器端MTU调整为1450,否则会影响传输效率,实测10G带宽最⼤利⽤率为10%。

相关文档
最新文档