通过VPN将stream量路由到某个子网。 Ping是好的,但没有TCPstream量回来

我有以下设置

  • 服务器(192.168.21.11,172.17.4.6),通过OpenVPN路由10.10.10.0/24
  • 客户端(192.168.21.9)
  • 路由器(192.168.21.1)[m0n0wall]具有10.10.10.0/24至192.168.21.11的静态路由

在服务器上,启用NAT转发:

/sbin/iptables -t nat -A POSTROUTING -d 10.10.10.0/24 -o tun0 -j MASQUERADE # cat /proc/sys/net/ipv4/ip_forward 1 # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination 

我能够做从客户端到服务器的traceroute

 # traceroute 10.10.10.10 traceroute to 10.10.10.10 (10.10.10.10), 30 hops max, 60 byte packets 1 (192.168.21.1) 0.283 ms 0.211 ms 0.165 ms ## Router 2 (192.168.21.11) 0.262 ms 0.249 ms 0.213 ms ## Server 3 (172.17.4.1) 40.356 ms 83.965 ms 83.915 ms ## OpenVPN Subnet 4 (10.10.10.10) 83.778 ms 83.626 ms 83.488 ms 

但我不知何故无法从客户端连接到服务器。 以下是tcpdump报告,当我尝试通过SSH连接到服务器时:

 # tcpdump -i tun0 tcpdump: WARNING: arptype 65534 not supported by libpcap - falling back to cooked socket tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on tun0, link-type LINUX_SLL (Linux cooked), capture size 96 bytes 08:05:16.734848 IP 172.17.4.6.58710 > 10.10.10.10.ssh: S 2851123862:2851123862(0) win 5840 <mss 1460,sackOK,timestamp 597224955 0,nop,wscale 6> 08:05:16.776264 IP 10.10.10.10.ssh > 172.17.4.6.58710: S 658436853:658436853(0) ack 2851123863 win 5792 <mss 1366,sackOK,timestamp 296951268 597224955,nop,wscale 5> 08:05:20.986415 IP 10.10.10.10.ssh > 172.17.4.6.58710: S 658436853:658436853(0) ack 2851123863 win 5792 <mss 1366,sackOK,timestamp 296952321 597224955,nop,wscale 5> 08:05:26.985854 IP 10.10.10.10.ssh > 172.17.4.6.58710: S 658436853:658436853(0) ack 2851123863 win 5792 <mss 1366,sackOK,timestamp 296953821 597224955,nop,wscale 5> 

似乎来自服务器的数据包没有路由回客户端。

那么这不是一个iptables的问题。 问题是,我使用m0n0wall作为路由器,并通过m0n0wall设置路由。 由于m0n0wall将这些路由推送通过防火墙,因此必须启用“绕过相同接口上的stream量绕过防火墙规则”来阻止m0n0wall停止数据包。

这个问题非常类似于: http : //forum.m0n0.ch/index.php?topic=381.0