奇妙なIPsec動作

奇妙なIPsec動作

うまく説明できない興味深いものを見つけました。単純なUbuntu 20.04ボックスを開き、IPSecトンネルを介してすべてのトラフィックを保護しようとしました。私はVTIやxfrmインターフェースを使わずに両端でTSで0.0.0.0をネゴシエートします。 IPsecトンネルがなければ、すべてが正常です。

これでトンネルを開始すると、トンネルはうまく機能します。これで、iperf TCPテストを実行すると正常に動作します。パケットはトンネルを通ってアプリケーションに戻り、予測スループットを取得します。

pingテストを実行してもうまく動作します。

問題はネットワークトラフィックです。 wgetを実行するかブラウザを使用しようとすると、トラフィックがうまく流れ、Ubuntu 20ノードに戻ることがわかりますが、アプリケーションには届きません。

したがって、wgetは応答を見ることができませんが、TCP接続は期待どおりESTABを取得し、Wiresharkではトンネリングと復号化後の応答を見ることができます。ただし、説明できない理由から、ネットワークトラフィックを使用しようとした場合にのみ、トラフィックが意図したアプリケーションに到達しないことがわかりました。

どんな手がかりも。私のIPsec設定には興味深い点はありません。

vtewari@vtewari-ububtu:~$ sudo swanctl --list-sas
[sudo] password for vtewari: 
tenant-13543-1010: #9, ESTABLISHED, IKEv2, 43319062223514a3_i* 2927ffc3801b0fa2_r
  local  '[email protected]' @ 10.0.2.15[4500]
  remote 'vtewari-remote' @ vtewari-remote[4500]
  AES_CBC-128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_2048
  established 2622s ago, reauth in 24647s
  tenant-13543-1010: #13, reqid 11, INSTALLED, TUNNEL-in-UDP, ESP:AES_CBC-256/HMAC_SHA1_96
    installed 2623s ago, rekeying in 68598s, expires in 69378s
    in  c6fce0ab,    600 bytes,     7 packets,   381s ago
    out c13ce846, 127082 bytes,    96 packets,   381s ago
    local  0.0.0.0/0
    remote 0.0.0.0/0

vtewari@vtewari-ububtu:~$ sudo swanctl --list-conns
tenant-13543-1010: IKEv2, reauthentication every 215460s, no rekeying
  local:  %any
  remote: vtewari-remote
  local pre-shared key authentication:
    id: [email protected]
  remote pre-shared key authentication:
  tenant-13543-1010: TUNNEL, rekeying every 71460s
    local:  0.0.0.0/0
    remote: 0.0.0.0/0

Ping / Iperfはトンネルテストに成功しました。

vtewari@vtewari-ububtu:~$ iperf3 -c paris.testdebit.info -p 9237 -R
Connecting to host paris.testdebit.info, port 9237
Reverse mode, remote host paris.testdebit.info is sending
[  5] local 10.0.2.15 port 33296 connected to 89.84.1.194 port 9237
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  37.1 KBytes   304 Kbits/sec                  
[  5]   1.00-2.00   sec   102 KBytes   830 Kbits/sec                  
^C[  5]   2.00-2.54   sec   131 KBytes  2.01 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-2.54   sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-2.54   sec   270 KBytes   871 Kbits/sec                  receiver
iperf3: interrupt - the client has terminated

しかし、TCP接続にもかかわらず、wgetは応答を見ません。

vtewari@vtewari-ububtu:~$ wget http://google.com --verbose -O index.html
--2022-06-05 15:10:00--  http://google.com/
Resolving google.com (google.com)... 142.250.77.46, 2404:6800:4009:81c::200e
Connecting to google.com (google.com)|142.250.77.46|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2022-06-05 15:10:01--  http://www.google.com/
Resolving www.google.com (www.google.com)... 142.251.42.4, 2404:6800:4009:82f::2004
Connecting to www.google.com (www.google.com)|142.251.42.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                           [<=>                                                       ]       0  --.-KB/s               

ブラウザでも同じ内容が見えます。トンネリングを無効にすると、すべてが正常です。トンネリングを有効にすると、ブラウザはサーバーに接続できません。

これについての洞察力をありがとうございます。

ベストアンサー1

おすすめ記事