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 * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] sun# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] moon# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... sun# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... moon# sleep 2 alice# ping -c 10 10.2.0.10 PING 10.2.0.10 (10.2.0.10) 56(84) bytes of data. 64 bytes from 10.2.0.10: icmp_seq=4 ttl=62 time=1.13 ms 64 bytes from 10.2.0.10: icmp_seq=5 ttl=62 time=0.971 ms 64 bytes from 10.2.0.10: icmp_seq=6 ttl=62 time=0.844 ms 64 bytes from 10.2.0.10: icmp_seq=7 ttl=62 time=0.864 ms 64 bytes from 10.2.0.10: icmp_seq=8 ttl=62 time=0.848 ms 64 bytes from 10.2.0.10: icmp_seq=9 ttl=62 time=0.885 ms 64 bytes from 10.2.0.10: icmp_seq=10 ttl=62 time=1.04 ms --- 10.2.0.10 ping statistics --- 10 packets transmitted, 7 received, 30% packet loss, time 9039ms rtt min/avg/max/mdev = 0.844/0.942/1.135/0.106 ms TEST moon# cat /var/log/auth.log | grep 'initiate on demand from 10.1.0.10' [YES] Jul 20 15:06:30 moon pluto[17726]: | initiate on demand from 10.1.0.10:8 to 10.2.0.10:0 proto=1 state: fos_start because: whack 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 842s; 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 1102s; 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=0.724 ms sun# killall tcpdump sun# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > sun.strongswan.org: ESP' [YES] 15:06:34.099890 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x1), length 132 15:06:35.110327 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x2), length 132 15:06:36.116250 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x3), length 132 15:06:37.124668 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x4), length 132 15:06:38.125392 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x5), length 132 15:06:39.130544 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x6), length 132 15:06:40.132005 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x7), length 132 15:06:42.394936 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xd3ab9710,seq=0x8), length 132 sun# cat /tmp/tcpdump.log | grep 'IP sun.strongswan.org > moon.strongswan.org: ESP' [YES] 15:06:34.100430 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x1), length 132 15:06:35.110695 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x2), length 132 15:06:36.116578 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x3), length 132 15:06:37.124985 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x4), length 132 15:06:38.125709 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x5), length 132 15:06:39.130876 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x6), length 132 15:06:40.132329 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x7), length 132 15:06:42.395199 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xef3a46d3,seq=0x8), length 132 POST-TEST 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 ]