web-dev-qa-db-ja.com

openswan Cisco ASA 9.1-接続が認識されていないため、IPsec SA要求に応答できません

わかりました。パブリックIPアドレスと172.16.255.1のループバックインターフェイスを持つ単一のLinuxホストを使用した単純なVPNIPSECセットアップがあります。右側には、Cisco ASA 55059.1があります。問題は、「フェーズ2が完了しました」をデバッグするときにCisco ASAが言うので、ISKMPネゴシエーションとの競合がないことを知っています。ただし、ネットワークACLの不一致を示す次のメッセージが表示されますが、理解できません。

Apr 09 14:30:26 [IKEv1 DEBUG]Group = x.x.137.133, IP = x.x.137.133, IKE got a KEY_ADD msg for SA: SPI = 0x61af9f82
Apr 09 14:30:26 [IKEv1 DEBUG]Group = x.x.137.133, IP = x.x.137.133, Pitcher: received KEY_UPDATE, spi 0x95cad3f0
Apr 09 14:30:26 [IKEv1 DEBUG]Group = x.x.137.133, IP = x.x.137.133, Starting P2 rekey timer: 27360 seconds.
Apr 09 14:30:26 [IKEv1]Group = x.x.137.133, IP = x.x.137.133, PHASE 2 COMPLETED (msgid=0504e77c)
Apr 09 14:23:29 [IKEv1]Group = x.x.137.133, IP = x.x.137.133, Received non-routine Notify message: Invalid ID info (18)

そして、OpenSwanを実行しているLinuxボックスでは、次のように表示されます。

"L2L-IPSEC-CT" #1: the peer proposed: 172.16.255.1/32:0/0 -> 192.168.0.0/24:0/0
"L2L-IPSEC-CT" #1: cannot respond to IPsec SA request because no connection is known for 172.16.255.1/32===x.x.137.133<x.x.137.133>[+S=C]:1/0...x.x.157.15<x.x.157.15>[+S=C]:1/0===192.168.0.0/24
"L2L-IPSEC-CT" #1: sending encrypted notification INVALID_ID_INFORMATION to x.x.157.15:500

いくつかの調査を行った後、トンネルを通過することを許可された提案されたネットワークに問題があるようです。ただし、両方の構成は同じです

Cisco config

access-list VPN-TRAFFIC-VPS1 line 1 extended permit icmp 192.168.0.0 255.255.255.0 Host 172.16.255.1 (hitcnt=422) 0x150f2cfc
access-list VPN-TRAFFIC-VPS1 line 2 extended permit ip 192.168.0.0 255.255.255.0 Host 172.16.255.1 (hitcnt=42) 0xfd98dbac

Openswan Config

conn L2L-IPSEC-CT
        auto=start #automatically start if detected
        type=tunnel #tunnel mode/not transport
        compress=no

        ###THIS SIDE###
        left=x.x.137.133
        leftsubnet=172.16.255.1/32

        ###PEER SIDE###
        right=x.x.157.15
        rightsubnet=192.168.0.0/24

        #phase 1 encryption-integrity-diffhellman
        keyexchange=ike
        ike=3des-md5-modp1024,aes256-sha1-modp1024
        ikelifetime=86400s
        authby=secret #use presharedkey

        #phase 2 encryption-pfsgroup
        phase2=esp #esp for encryption | ah for authentication only
        phase2alg=3des-md5;modp1024
        pfs=no

私のテストは192.168.0.200から172.16.255.1へのpingです:これはshow crypto ipsecsaです

asa(config)# show crypto ipsec sa
interface: outside
    Crypto map tag: outside-cmap, seq num: 40, local addr: x.x.157.15

      access-list VPN-TRAFFIC-VPS1 extended permit ip 192.168.0.0 255.255.255.0 Host 172.16.255.1
      local ident (addr/mask/prot/port): (192.168.0.0/255.255.255.0/0/0)
      remote ident (addr/mask/prot/port): (172.16.255.1/255.255.255.255/0/0)
      current_peer: x.x.137.133

      #pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
      #pkts decaps: 0, #pkts decrypt: 0, #pkts verify: 0
      #pkts compressed: 0, #pkts decompressed: 0
      #pkts not compressed: 0, #pkts comp failed: 0, #pkts decomp failed: 0
      #pre-frag successes: 0, #pre-frag failures: 0, #fragments created: 0
      #PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0
      #TFC rcvd: 0, #TFC sent: 0
      #Valid ICMP Errors rcvd: 0, #Invalid ICMP Errors rcvd: 0
      #send errors: 0, #recv errors: 0

      local crypto endpt.: x.x.157.15/0, remote crypto endpt.: x.x.137.133/0
      path mtu 1500, ipsec overhead 58(36), media mtu 1500
      PMTU time remaining (sec): 0, DF policy: copy-df
      ICMP error validation: disabled, TFC packets: disabled
      current outbound spi: 61AF9F82
      current inbound spi : 95CAD3F0

Swan ipsec auto--statusを開きます

**000 "L2L-IPSEC-CT": 172.16.255.1/32===x.x.137.133<x.x.137.133>[+S=C]...x.x.157.15<x.x.157.15>[+S=C]===192.168.0.0/24; erouted; eroute owner: #4
000 "L2L-IPSEC-CT":     myip=unset; hisip=unset;
000 "L2L-IPSEC-CT":   ike_life: 86400s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0
000 "L2L-IPSEC-CT":   policy: PSK+ENCRYPT+TUNNEL+UP+IKEv2ALLOW+SAREFTRACK+lKOD+rKOD; prio: 32,24; interface: eth0;
000 "L2L-IPSEC-CT":   newest ISAKMP SA: #3; newest IPsec SA: #4;
000 "L2L-IPSEC-CT":   IKE algorithms wanted: 3DES_CBC(5)_000-MD5(1)_000-MODP1024(2), AES_CBC(7)_256-SHA1(2)_000-MODP1024(2); flags=-strict
000 "L2L-IPSEC-CT":   IKE algorithms found:  3DES_CBC(5)_192-MD5(1)_128-MODP1024(2), AES_CBC(7)_256-SHA1(2)_160-MODP1024(2)
000 "L2L-IPSEC-CT":   IKE algorithm newest: 3DES_CBC_192-MD5-MODP1024
000 "L2L-IPSEC-CT":   ESP algorithms wanted: 3DES(3)_000-MD5(1)_000; pfsgroup=MODP1024(2); flags=-strict
000 "L2L-IPSEC-CT":   ESP algorithms loaded: 3DES(3)_192-MD5(1)_128
000 "L2L-IPSEC-CT":   ESP algorithm newest: 3DES_000-HMAC_MD5; pfsgroup=<N/A>
000
000 #4: "L2L-IPSEC-CT":500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 27518s; newest IPSEC; eroute owner; isakmp#3; idle; import:admin initiate
000 #4: "L2L-IPSEC-CT" [email protected] [email protected] [email protected] [email protected] ref=0 refhim=4294901761
000 #3: "L2L-IPSEC-CT":500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 85221s; newest ISAKMP; lastdpd=1s(seq in:0 out:0); idle; import:admin initiate
**

なぜこれが機能しないのか、私は本当に迷っています。私はこれに3日間取り組んできたので、おそらく新しい目です!うわぁ!

あなたの助けに感謝しますserverfaultコミュニティ!

P.S.問題のサブネットがトンネル「openswan」によってピックアップされていることを確認するために使用できるOpenSwanコマンドはありますか

3
Jim

わかりました、それで私はそれを理解したと信じています。

したがって、OpenswanボックスはNATの背後にnotあり、パブリックIPを使用して直接NIC NAT-Traversalをオンにするには、これを念頭に置いて、leftsoureip = 172.16.255.1を追加して、Openswanに通信時に使用する送信元アドレスを指示する必要がありました。トンネルの右側。最後にやらなければならなかったのは、forceencapsを有効にすることでした。これを行うとすぐに、何らかの理由でトンネルが機能し始めました。

config setup
     listen=x.x.137.133
     nat_traversal=yes
     virtual_private=%v:172.16.255.1/32,192.168.0.0/24
     oe=off
     protostack=netkey

conn L2L-IPSEC-CT
    auto=start #automatically start if detected
    type=tunnel #tunnel mode/not transport
    compress=no

    ###THIS SIDE###
    left=x.x.137.133
    leftid=x.x.137.133
    leftsubnet=172.16.255.1/32
    leftsourceip=172.16.255.1

    ###PEER SIDE###
    right=x.x.157.15
    rightid=x.x.157.15
    rightsubnet=192.168.0.0/24

    #phase 1 encryption-integrity-diffhellman
    keyexchange=ike
    ike=3des-md5-modp1024,aes256-sha1-modp1024
    ikelifetime=86400s
    authby=secret #use presharedkey

    #phase 2 encryption-pfsgroup
    phase2=esp #esp for encryption | ah for authentication only
    phase2alg=3des-md5;modp1024
    pfs=no
    forceencaps=yes
2
Jim