zoukankan      html  css  js  c++  java
  • 加密设备NAT对IPSec的影响

    加密设备NAT对IPSec VPN的影响:
    我们先配置好经典的IPSec VPN,然后在R3上做PAT看会对IPSec VPN产生什么影响(不会对有隧道的IPSec VPN技术产生影响)。


    现在默认配置经典IPSec VPN成功:
    R3#sho crypto  en connections  active
    Crypto Engine Connections

       ID  Type    Algorithm           Encrypt  Decrypt LastSeqN IP-Address
        5  IPsec   DES+MD5                   0       10       12 23.1.1.3
        6  IPsec   DES+MD5                  10        0        0 23.1.1.3
     1001  IKE     SHA+DES                   0        0        0 23.1.1.3
    现在在R3上做PAT:
    R3(config)#interface lo0
    R3(config-if)#ip na inside
    R3(config)#interface  f1/0
    R3(config-if)#ip nat  outside
    R3(config-if)#exi
    R3(config)#ip nat inside source list PAT interface  f1/0 overload
    R3(config)#ip access-list e
    R3(config)#ip access-list extended PAT
    R3(config-ext-nacl)#permit  ip 3.3.3.0 0.0.0.255 any
    R3#ping 1.1.1.1 so 3.3.3.3
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
    Packet sent with a source address of 3.3.3.3
    U.U.U
    Success rate is 0 percent (0/5)
    此时可以看见R3和R1之间不通了!!但是看和R2(Internet)呢?
    R3#ping 2.2.2.2 source 3.3.3.3

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
    Packet sent with a source address of 3.3.3.3
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 92/108/156 ms
    R3#telnet 2.2.2.2 /source-interface lo0
    Trying 2.2.2.2 ... Open


    User Access Verification

    Password:
    R2>en
    R2>enable
    Password:
    R2#
    这些说明了什么呢?
             分析NAT对IPSec VPN的影响:R3通过ping操作产生源为3.3.3.3,目的是1.1.1.1的流量,这个流量首先被PAT转化为23.1.1.3(默认NAT技术优于加密技术处理数据包),目的为1.1.1.1的流量,因为转化后的流量不是感兴趣流,所以不会被路由器加密,取而代之的是,路由器会转发这个未被加密的流量到Internet,当Internet收到数据包之后,发现没有到1.1.1.1的路由,那么就丢包,告诉R3不可达。
    那么解决的方法就是把这个流量从PAT列表中排除就好了:
    R3(config)#ip access-list extended PAT
    R3(config-ext-nacl)#5 deny ip 3.3.3.0 0.0.0.255 1.1.1.0 0.0.0.255
    R3(config-ext-nacl)#exi
    R3#sho ip access-lists PAT
    Extended IP access list PAT
        5 deny ip 3.3.3.0 0.0.0.255 1.1.1.0 0.0.0.255
        10 permit ip 3.3.3.0 0.0.0.255 any
    R3#ping 1.1.1.1 so 3.3.3.3

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
    Packet sent with a source address of 3.3.3.3
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 220/239/272 ms

    R3#sho access-lists PAT       
    Extended IP access list PAT
        5 deny ip 3.3.3.0 0.0.0.255 1.1.1.0 0.0.0.255 (5 matches)
        10 permit ip 3.3.3.0 0.0.0.255 any
    注意:问题是适用于IPSec VPN的经典配置,像有隧道技术的IPSec VPN是不会有问题的,原因很简单,流量是从隧道走的,而隧道接口没有配置
    IP nat outside,所以感兴趣流不会被转换。

    好好学习,天天向上!
  • 相关阅读:
    洛谷P1357 Solution
    洛谷P3469 Solution
    洛谷P2617 Solution
    CF818F Solution
    CF802K Solution
    CF519E Solution
    在代码中改变log的级别
    Java非对称加密解密
    mvn test 远程调试
    rsyn实现服务器源码同步
  • 原文地址:https://www.cnblogs.com/MomentsLee/p/10112699.html
Copyright © 2011-2022 走看看