通过IPSec的IP地址

我有四个主机设置如下:

网络图

我在服务器B和C之间通过互联网通过OpenSwan获得IPSec隧道。服务器A和Dconfiguration为分别通过B和C将stream量路由到另一个。 服务器A和B在一个专用networking上,服务器C和D在另一个专用networking上。

我可以ping通并正确对话,但是当从服务器A ping服务器D时,我在每个框中看到tcpdump输出中有趣的东西。

在服务器A上:

04:52:12.790527 IP (tos 0x0, ttl 64, id 24219, offset 0, flags [DF], proto ICMP (1), length 84) [Server A] > [Server D]: ICMP echo request, id 29513, seq 1, length 64 04:52:12.793453 IP (tos 0x0, ttl 62, id 44476, offset 0, flags [none], proto ICMP (1), length 84) [Server D] > [Server A]: ICMP echo reply, id 29513, seq 1, length 64 

在服务器B上:

 04:52:08.393560 IP (tos 0x0, ttl 64, id 24219, offset 0, flags [DF], proto ICMP (1), length 84) [Server A] > [Server D]: ICMP echo request, id 29513, seq 1, length 64 04:52:08.395307 IP (tos 0x0, ttl 63, id 44476, offset 0, flags [none], proto ICMP (1), length 84) [Server D] > [Server B]: ICMP echo reply, id 29513, seq 1, length 64 

服务器C:

 04:52:08.395849 IP (tos 0x0, ttl 62, id 24219, offset 0, flags [DF], proto ICMP (1), length 84) [Server B] > [Server D]: ICMP echo request, id 29513, seq 1, length 64 04:52:08.396382 IP (tos 0x0, ttl 64, id 44476, offset 0, flags [none], proto ICMP (1), length 84) [Server D] > [Server B]: ICMP echo reply, id 29513, seq 1, length 64 

服务器D:

 04:52:12.428422 IP (tos 0x0, ttl 62, id 24219, offset 0, flags [DF], proto ICMP (1), length 84) [Server B] > [Server D]: ICMP echo request, id 29513, seq 1, length 64 04:52:12.428457 IP (tos 0x0, ttl 64, id 44476, offset 0, flags [none], proto ICMP (1), length 84) [Server D] > [Server B]: ICMP echo reply, id 29513, seq 1, length 64 

然而,奇怪的是:

  • 服务器A具有正确的IP
  • 服务器B种子正确的回应请求,但回声答复似乎要去服务器B.
  • 服务器C和D都可以看到服务器B和D之间的请求。

为什么这些数据包似乎来自服务器B,而不是服务器A? 谢谢!

看起来B正在将IP SRC标题字段更改为它自己的地址。 可能是工作NAT的结果。 检查你的包filter的任何翻译规则,并相应地修改它们。