帮助我们改善您的体验。

让我们了解您的想法。

您是否能抽出两分钟的时间完成一份问卷调查?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
IPsec VPN 用户指南
Table of Contents Expand all
list Table of Contents
keyboard_arrow_right

机器翻译对您有帮助吗?

starstarstarstarstar
Go to English page
免责声明:

我们将使用第三方机器翻译软件翻译本页面。瞻博网络虽已做出相当大的努力提供高质量译文,但无法保证其准确性。如果对译文信息的准确性有任何疑问,请参阅英文版本. 可下载的 PDF 仅提供英文版.

对已启动但无法传递流量的 VPN 进行故障排除

date_range 18-Jan-25

问题

Description

VPN 已启动,但没有一个或两个方向的传递流量。

本主题有助于排查可能阻止流量通过活动 VPN 隧道的问题。

环境

VPN

解决方案

  1. 检查 VPN 安全关联 (SA) 是否处于活动状态: show security ipsec security-associations

    content_copy zoom_out_map
    user@CORPORATE> show security ipsec security-associations  
      total configured sa: 1
      ID     Gateway         Port  Algorithm       SPI      Life:sec/kb  Mon vsys
      <32785 2.2.2.2         1398  ESP:3des/sha1   29e26eba 28735/unlim   -   0
      >32785 2.2.2.2         1398  ESP:3des/sha1   6d4e790b 28735/unlim   -   0   

    如果列出了 VPN 网关,则隧道已建立并已启动。输出为每个 VPN 隧道显示两行,显示每个流量方向的 SPI 信息。

    MON VPN 监控使用该字段来显示隧道的状态,并具有以下值之一:

    • - (连字符):VPN 隧道处于活动状态,并且未配置 VPN 监视器可选功能。

    • U (上):VPN 隧道处于活动状态,链路(通过 VPN 监视器检测到)已启动。

    • D (下):VPN 隧道处于活动状态,并且链路(通过 VPN 监视器检测到)已关闭。

  2. 检查 VPN 是否使用环路接口 lo0 作为外部接口: show configuration security ike

    content_copy zoom_out_map
    root> show configuration security ike
    policy ike_pol {
       proposal-set compatible;
       pre-shared-key ascii-text "$9$tMwDuIESreWX7yr4aGDkqIEhcvWbs2";
    }
    gateway gate1 {
      ike-policy ike_pol;
      address 10.10.10.2;
      external-interface lo0.0;
    }
    • Yes:VPN 使用环路接口 lo0 作为外部接口。继续执行步骤 3

    • No:VPN 未使用环路接口 lo0 作为外部接口。继续执行步骤 4

  3. 检查用作 VPN 外部接口的出口接口(物理接口)和 lo0 是否在同一安全区域中。

  4. 如果您的 VPN 是基于路由的 VPN,请继续执行步骤 5。如果是基于策略的 VPN,请继续执行步骤 8 。请参阅 基于策略的 VPN 和基于路由的 VPN 有何区别?

  5. 检查是否通过 st0 接口为远程网络分配了路由: show route remote network

    content_copy zoom_out_map
    root@siteA > show route 192.168.20.10
    inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    192.168.2.0/24    *[ARI-TS/5] 00:00:53
                               > via st0.0  <----------
  6. 根据在步骤 5中分配给远程网络的路由,检查 VPN 是否指向正确的 st0 接口:show security ikeshow security ipsec

    1. 首先, show security ike 使用命令检查 IKE 网关。

      content_copy zoom_out_map
      root@siteA # show security ike
      ...
      gateway gw-siteB {        <---------
           ike-policy ike-phase1-policy;
           address 2.2.2.2;
           external-interface ge-0/0/3.0;
      }
    2. 使用 show security ipsec 命令检查该 IKE 网关的 IPsec VPN,并在输出中验证 bind-interface 是否指向 st0 接口。

      在此示例中,VPN ike-vpn-siteB 指向接口 st0.0

      content_copy zoom_out_map
      root@siteA # show security ipsec
      ...
      vpn ike-vpn-siteB {     
          bind-interface st0.0;
            ike {
               gateway gw-siteB;      <---------
               proxy-identity {
                   local 192.168.2.0/24;
                   remote 192.168.1.0/24;
                   service any;
                 }
                ipsec-policy ipsec-phase2-policy;
              }
           establish-tunnels immediately;
          }
  7. 检查是否存在允许从内部区域到 st0 安全区域的信息流的安全策略: show security policies

  8. 检查是否存在允许流量的 VPN 隧道安全策略: show security policies

    content_copy zoom_out_map
    root@siteA# show security policies
    ...
    from-zone trust to-zone untrust {
        policy vpn_egress {
            match {
                source-address local-net;
                destination-address remote-net;
                application any;
            }
            then {
                permit {
                    tunnel {                      <----------
                        ipsec-vpn ike-vpn-siteC;  <----------
                    }
                }
            }
        }
     }
    
    from-zone untrust to-zone trust {
        policy vpn_ingress {
            match {
                source-address remote-net;
                destination-address local-net;
                application any;
            }
            then {
                permit {
                    tunnel {                      <----------
                        ipsec-vpn ike-vpn-siteC;  <----------
                    }
                }
            }
        }
     }
  9. 检查流量是否与步骤 7 或步骤 8中确定的策略匹配: show security flow session source prefix source address destination prefix destination address

    content_copy zoom_out_map
    root@siteA> show security flow session source-prefix 192.168.2.0/24 destination-prefix 192.168.1.0/24
    
    Session ID: 5801, Policy name: AtoB/2, Timeout: 1790, Valid
    In: 192.168.2.222/1 --> 192.168.1.13/23053;icmp, If: fe-0/0/2.0, Pkts: 59878, Bytes: 4602292
    Out: 192.168.1.13/23053 --> 192.168.2.222/1;icmp, If: st0.0, Pkts: 52505, Bytes: 4189289
    • Yes:继续执行步骤 10

    • No:验证安全策略的顺序:show security match policies。请参阅 了解安全策略排序

      如果顺序正确,请参阅 如何对未传递数据的安全策略进行故障排除

      注:

      如果只有会话输出方向上的计数器在 pkts 递增,则与 VPN 对等方验证是否正在接收流量。

      这是为了检查与之形成此隧道的 VPN 对等方上的数据包计数器,以查看另一端是否正在接收数据包。

  10. 收集日志和流跟踪选项,并向瞻博网络支持团队提交案例:

footer-navigation