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.3.6 IPsec [starter]... sun# ipsec start Starting strongSwan 4.3.6 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=5 ttl=62 time=1.12 ms 64 bytes from 10.2.0.10: icmp_seq=6 ttl=62 time=0.925 ms 64 bytes from 10.2.0.10: icmp_seq=7 ttl=62 time=0.896 ms 64 bytes from 10.2.0.10: icmp_seq=8 ttl=62 time=0.945 ms 64 bytes from 10.2.0.10: icmp_seq=9 ttl=62 time=0.873 ms 64 bytes from 10.2.0.10: icmp_seq=10 ttl=62 time=1.43 ms --- 10.2.0.10 ping statistics --- 10 packets transmitted, 6 received, 40% packet loss, time 9065ms rtt min/avg/max/mdev = 0.873/1.032/1.432/0.197 ms TEST moon# cat /var/log/auth.log | grep 'initiate on demand from 10.1.0.10' [YES] Feb 27 23:32:32 moon pluto[22163]: | 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 943s; 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 1103s; 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.483 ms sun# killall tcpdump sun# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > sun.strongswan.org: ESP' [YES] 23:32:35.946233 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x1), length 132 23:32:36.952197 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x2), length 132 23:32:37.961460 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x3), length 132 23:32:38.968909 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x4), length 132 23:32:39.979396 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x5), length 132 23:32:40.988593 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x6), length 132 23:32:42.747953 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0x7b1c1e76,seq=0x7), length 132 sun# cat /tmp/tcpdump.log | grep 'IP sun.strongswan.org > moon.strongswan.org: ESP' [YES] 23:32:35.946664 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x1), length 132 23:32:36.952537 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x2), length 132 23:32:37.961778 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x3), length 132 23:32:38.969228 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x4), length 132 23:32:39.979724 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x5), length 132 23:32:40.989306 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x6), length 132 23:32:42.748139 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc29732f8,seq=0x7), 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 ]