strongswan/testing/tests/ikev1/double-nat-net/pretest.dat

13 lines
643 B
Plaintext

alice::iptables-restore < /etc/iptables.rules
bob::iptables-restore < /etc/iptables.rules
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p udp -j SNAT --to-source PH_IP_MOON:1024-1100
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p tcp -j SNAT --to-source PH_IP_MOON:2000-2100
sun::iptables -t nat -A POSTROUTING -o eth0 -s 10.2.0.0/16 -p tcp -j SNAT --to-source PH_IP_SUN:2000-2100
sun::iptables -t nat -A PREROUTING -i eth0 -s PH_IP_MOON -p udp -j DNAT --to-destination PH_IP_BOB
sun::ip route add 10.1.0.0/16 via PH_IP_BOB
alice::ipsec start
bob::ipsec start
alice::sleep 2
alice::ipsec up nat-t
alice::sleep 1