Topology

Untitled

Basic Configuration

FW1

R1-FG1101E # show vpn ipsec phase1-interface ToR2
config vpn ipsec phase1-interface
    edit "ToR2"
        set interface "port16"
        set peertype any
        set net-device disable
        set passive-mode enable
        set proposal aes128-sha256
        **set ip-fragmentation pre-encapsulation**
        set remote-gw 100.0.1.2
        set psksecret ENC Z8JY4iWGlEVkd9FBHND38mehwVdARcHczR3QcrxWjT60LTWVr1+CirMEFhzQdLZWBK+HWBCsGowDBXAzPqLPd2VfyW4Cl/w1n7Axa0B1e0oh+zTSdKr1auFuCMn/p/IkQpiHCY5AWV1E8GQcteDZ6zv7fpWqnTD0crmVSydT/Qpk5p844Oxgf02k9AfDRcY29j8Gcw==
    next
end
R1-FG1101E # show vpn ipsec phase2-interface ToR2 
config vpn ipsec phase2-interface
    edit "ToR2"
        set phase1name "ToR2"
        set proposal **aes256-sha256**
    next
end

FW2

R2-FG1101E # show vpn ipsec phase1-interface ToR1
config vpn ipsec phase1-interface
    edit "ToR1"
        set interface "port16"
        set peertype any
        set net-device disable
        set exchange-interface-ip enable
        set proposal aes128-sha256
        set **ip-fragmentation pre-encapsulation**
        set dpd disable
        set remote-gw 100.0.0.2
        set psksecret ENC Lv4Etajj6H2abp3coiBKezA+1aP7epa+KIUb6TpVECqC/MO8vweHdqW4mTfE+PJnm3xmywcheaxr7r/jNRimIuRbripGvAdvk9V8ezgTsInYXXWmmt1+twvGPPxfCKUxGHHJHVgozsun3uH5TMDmMwmgRkWL0sq7YR+Zv5lyrDhi7XZcJdioL60aa3RCqNyzc+hZYw==
    next
end
R2-FG1101E # show vpn ipsec phase2-interface ToR1 
config vpn ipsec phase2-interface
    edit "ToR1"
        set phase1name "ToR1"
        set proposal **aes256-sha256**
        set auto-negotiate enable
    next
end

Test Steps

  1. 在Router设备上开启针对FW2的SNAT,将FW2的port16的地址(100.0.3.2)转换为Router的port7的地址(100.0.1.2)。
  2. IPSec VPN隧道建立成功后,我们先来看下两端设备计算出的Tunnel SA/Tunnel Interface的MTU。
  1. 首先验证下在Tunnel MTU极限值的情况下,是否会产生分片。目前Tunnel Interface MTU为1438,也就是说被加密原始明文最大为1438 Bytes。我们使用PC1 Ping PC2来测试,datasize = 1438 - 20(Original IP Header) - 8(ICMP Header) = 1410

    [root@CentOS-1 ~]# ping 10.1.87.222 -c 1 **-s 1410** -M dont
    PING 10.1.87.222 (10.1.87.222) 1410(**1438**) bytes of data.
    1418 bytes from 10.1.87.222: icmp_seq=1 ttl=62 time=1.22 ms
    --- 10.1.87.222 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 1.224/1.224/1.224/0.000 ms
    
  2. 在FW1上抓取ICMP明文,可以看到ICMP报文进入隧道后未分片:

    R1-FG1101E # diagnose sniffer packet any 'host 10.1.87.222' 4
    interfaces=[any]
    filters=[host 10.1.87.222]
    6150.682437 port14 in 10.0.86.221 -> 10.1.87.222: icmp: echo request
    6150.682457 ToR2 out 10.0.86.221 -> 10.1.87.222: icmp: echo request