TCPDUMP sun# tcpdump -i eth0 not port ssh and not port domain and not arp > /tmp/tcpdump.log 2>&1 & PRE-TEST moon# /etc/init.d/iptables start 2> /dev/null * Starting firewall ... [ ok ] sun# /etc/init.d/iptables start 2> /dev/null * Starting firewall ... [ ok ] moon# ipsec start Starting strongSwan IPsec 2.8.11 [starter]... sun# ipsec start Starting strongSwan IPsec 2.8.11 [starter]... alice# sleep 12 TEST moon# ipsec status | grep 'net-net.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "net-net" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 880s; newest IPSEC; eroute owner sun# ipsec status | grep 'net-net.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "net-net" STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1110s; newest IPSEC; eroute owner alice# ping -c 1 10.2.0.10 | grep '64 bytes from 10.2.0.10: icmp_seq=1' [YES] 64 bytes from 10.2.0.10: icmp_seq=1 ttl=62 time=1.34 ms sun# killall tcpdump sun# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > sun.strongswan.org: ESP' [YES] 07:29:16.739616 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xbe60ed6d,seq=0x1), length 116 sun# cat /tmp/tcpdump.log | grep 'IP sun.strongswan.org > moon.strongswan.org: ESP' [YES] 07:29:16.740171 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0x312cc5a9,seq=0x1), length 116 POST-TEST moon# iptables -v -n -L Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 136 ACCEPT esp -- eth0 * 0.0.0.0/0 0.0.0.0/0 4 2216 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp spt:500 dpt:500 4 1008 ACCEPT tcp -- eth0 * 192.168.0.150 0.0.0.0/0 tcp spt:80 203 25205 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 84 ACCEPT all -- eth0 * 10.2.0.0/16 10.1.0.0/16 policy match dir in pol ipsec reqid 16385 proto 50 1 84 ACCEPT all -- * eth0 10.1.0.0/16 10.2.0.0/16 policy match dir out pol ipsec reqid 16385 proto 50 Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 136 ACCEPT esp -- * eth0 0.0.0.0/0 0.0.0.0/0 6 2672 ACCEPT udp -- * eth0 0.0.0.0/0 0.0.0.0/0 udp spt:500 dpt:500 6 391 ACCEPT tcp -- * eth0 0.0.0.0/0 192.168.0.150 tcp dpt:80 276 42051 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:22 sun# iptables -v -n -L Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 136 ACCEPT esp -- eth0 * 0.0.0.0/0 0.0.0.0/0 6 2672 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:500 0 0 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:4500 4 1008 ACCEPT tcp -- eth0 * 192.168.0.150 0.0.0.0/0 tcp spt:80 321 37482 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 84 ACCEPT all -- eth0 * 10.1.0.0/16 10.2.0.0/16 policy match dir in pol ipsec reqid 16385 proto 50 1 84 ACCEPT all -- * eth0 10.2.0.0/16 10.1.0.0/16 policy match dir out pol ipsec reqid 16385 proto 50 Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 136 ACCEPT esp -- * eth0 0.0.0.0/0 0.0.0.0/0 4 2216 ACCEPT udp -- * eth0 0.0.0.0/0 0.0.0.0/0 udp spt:500 0 0 ACCEPT udp -- * eth0 0.0.0.0/0 0.0.0.0/0 udp spt:4500 6 391 ACCEPT tcp -- * eth0 0.0.0.0/0 192.168.0.150 tcp dpt:80 359 61646 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:22 moon# ipsec stop Stopping strongSwan IPsec... sun# ipsec stop Stopping strongSwan IPsec... moon# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] sun# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ]