先上个效果
WAN Computer -- (eth1/80.10.3.5)Server1(eth0/10.10.2.4) -- (eth0/10.11.2.3)Server2(eth1/111.1.1.2) -- WAN
现在手上有两个服务器,打算拿 server1 做跳板连接到 server2 的 IPsec VPN server,但是尝试配置了 iptables 之后无法通过 server1 的 IP 连接到 server2,VPN Server 是 l2tp with IPsec 和 Cisco IPsec 都配置有的。
内网可以通信
eth1 是外网接口,eth0 是内网接口
尝试的配置如下
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 4500 -j SNAT --to-source 10.10.2.4
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 500 -j SNAT --to-source 10.10.2.4
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 1701 -j SNAT --to-source 10.10.2.4
iptables -t nat -A PREROUTING -p udp --dport 500 -j DNAT --to-destination 10.11.2.3
iptables -t nat -A PREROUTING -p udp --dport 4500 -j DNAT --to-destination 10.11.2.3
iptables -t nat -A PREROUTING -p udp --dport 1701 -j DNAT --to-destination 10.11.2.3
iptables -A FORWARD -p esp -j ACCEPT
iptables -A FORWARD -p ah -j ACCEPT
测试了转发至 server2 上的 httpd 之类的都可以正常链接,请问是哪里配置错了呢?
WAN Computer -- (eth1/80.10.3.5)Server1(eth0/10.10.2.4) -- (eth0/10.11.2.3)Server2(eth1/111.1.1.2) -- WAN
现在手上有两个服务器,打算拿 server1 做跳板连接到 server2 的 IPsec VPN server,但是尝试配置了 iptables 之后无法通过 server1 的 IP 连接到 server2,VPN Server 是 l2tp with IPsec 和 Cisco IPsec 都配置有的。
内网可以通信
eth1 是外网接口,eth0 是内网接口
尝试的配置如下
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 4500 -j SNAT --to-source 10.10.2.4
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 500 -j SNAT --to-source 10.10.2.4
iptables -t nat -A POSTROUTING -p udp -d 10.11.2.3 --dport 1701 -j SNAT --to-source 10.10.2.4
iptables -t nat -A PREROUTING -p udp --dport 500 -j DNAT --to-destination 10.11.2.3
iptables -t nat -A PREROUTING -p udp --dport 4500 -j DNAT --to-destination 10.11.2.3
iptables -t nat -A PREROUTING -p udp --dport 1701 -j DNAT --to-destination 10.11.2.3
iptables -A FORWARD -p esp -j ACCEPT
iptables -A FORWARD -p ah -j ACCEPT
测试了转发至 server2 上的 httpd 之类的都可以正常链接,请问是哪里配置错了呢?