网络架构图:

基于虚拟专用网络(Virtual Private Network, VPN)或者云专线(Direct Connect, DC)建立云上与云下之间的二层网络,解决云上和云下网络二层互通问题,允许您在不改变子网、IP规划的前提下将数据中心或私有云主机业务部分迁移上云。

您通过VPN或者云专线连接云上和云下互联网数据中心(Internet Data Center, IDC),此时建立的是三层网络,要求云上与云下子网网段不能重叠。

当云下IDC与云上VPC子网网段重叠,并且需要云上与云下服务器在该重叠子网网段内通信时,您需要建立二层网络,企业交换机可以帮助您实现该需求。

云上企业交换机配置示例:

云下IDC之CE12808 vxlan交换机配置示例:

interface LoopBack12
 ip address 12.1.1.1 255.255.255.255

bridge-domain 9527
 l2 binding vlan 40
 vxlan vni 9527

interface Nve1
 source 12.1.1.1
 vni 9527 head-end peer-list 10.0.1.66
#

[~CoreSW-CE12808]  disp vxlan vni 9527 verbose
    BD ID                  : 9527
    State                  : up
    NVE                    : 358
    Source Address         : 12.1.1.1
    Source IPv6 Address    : -
    UDP Port               : 4789
    BUM Mode               : head-end
    Group Address          : -
    Peer List              : 10.0.1.66
[~CoreSW-CE12808]

遇到的丢包问题云上主机能ping通云下主机,但反之不通。

分析:

1、云主机ping云下主机流程:

云主机172.18.0.8 访问 云下的192.168.4.6,  通过云网关172.18.0.254 找到路由走vpn到云下,云下vpn解封装后,路由到192.168.4.6 ,回程时,根据路由,找到了云下本地的172.18.0.254网关,由此网关通过vxlan隧道把报文回送给172.18.0.8

2、云下主机ping云主机流程:

云下192.168.4.6 访问云上172.18.0.8,首先192.168.4.6把报文发给网关,该网关同时为vpn网关,存在IPSec目的网段172.18.0.0/24网段和本地路由网段172.18.0.0/24,由于报文接收的接口与查找路由后报文的出接口为同一物理接口(未经严谨考证),防火墙不做IPSec流量匹配,直接路由到本地网关172.18.0.254,该网关通过vxlan隧道把报文送给云端企业交换机ESW,再到172.18.0.8,回程时,发给云网关172.18.0.254,找到路由走vpn到云下,云下vpn收到后丢包,因为防火墙收到的是回应包,没有请求包,认为是报文来回路径不一致,就直接丢包。

云下IDC防火墙:

[XTDC-HL-OUTFW-USG6570-A]diagnose
[XTDC-HL-OUTFW-USG6570-A-diagnose]display firewall statistics acl discard

Statistic Flags:
 RcvnFrag - Number of received non-fragment packets
 RcvFrag  - Number of received fragment packets
 Forward  - Number of forward packets
 DisnFrag - Number of discarded non-fragment packets
 DisFrag  - Number of discarded fragment packets
 Obverse  - The Obverse direction of a session
 Reverse  - The Reverse direction of a session
********************************************************************************
*              Detailed information of ACL-based packet statistics             *
********************************************************************************
 Protocol(icmp) SourceIp(172.18.0.8) DestinationIp(192.168.4.6)
 SourcePort(2048) DestinationPort(4) VpnIndex(public)
                 RcvnFrag    RcvFrag     Forward     DisnFrag    DisFrag
 Obverse(pkts) : 200         0           0           200         0
 Reverse(pkts) : 0           0           0           0           0
 Discard detail information:
   ICMP session miss packets discarded: 200
   Suggestion: Please check whether ICMP request packets pass through the firewall
 ICMP packet detail information:
   ICMP_ECHOREPLY: 200
 Protocol(tcp) SourceIp(172.18.0.8) DestinationIp(192.168.4.6)
 SourcePort(22) DestinationPort(58058) VpnIndex(public)
                 RcvnFrag    RcvFrag     Forward     DisnFrag    DisFrag
 Obverse(pkts) : 2           0           0           2           0
 Reverse(pkts) : 0           0           0           0           0
 Discard detail information:
   TCP session miss packets discarded: 2
   Suggestion: Please check whether the TCP SYN  packet  pass through the firewall

解决办法一:

防火墙(VPN)关闭状态检测

NGE功能是内容安全检测功能,具体为IPS、AV、URL过滤等重要功能,一般不建议关闭,可以选择不重要的防火墙或者单独的vpn设备来配置IPSec隧道。

解决办法二:

在防火墙(VPN网关)上游路由器配置环回口,使产生主机路由,防火墙学习到主机路由后,访问172.18.0.8的流量会穿过防火墙,则会匹配IPSec感兴趣流,让请求报文走VPN隧道而不是vxlan隧道。此时,请求报文和回应报文都通过vpn隧道封装,解决来回路径不一致问题。

<XTDC-HL-RT-AR3260-A>disp cu int loopback1
[V200R007C00SPC900]
#
interface LoopBack1
 ip address 172.18.0.8  255.255.255.255

ospf 1 router-id 55.15.0.3
 import-route direct
 area 0.0.0.2
  authentication-mode hmac-md5 1 cipher %^%#6dN}$1\Y#V=wm!YT>2OQ/+<>*n]/NQynEP5-g<F6%^%#
  network 10.0.1.8 0.0.0.0
  network 55.0.6.77 0.0.0.0

参考:

https://support.huaweicloud.com/productdesc-esw/esw_pd_0002.html

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注