TCPDUMP moon# tcpdump -i eth0 not port ssh and not port domain and not arp > /tmp/tcpdump.log 2>&1 & alice# tcpdump -i eth0 not port ssh and not port domain and not arp > /tmp/tcpdump.log 2>&1 & PRE-TEST moon# mv /etc/hosts /etc/hosts.ori moon# mv /etc/hosts.stale /etc/hosts moon# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] carol# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] dave# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] carol# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... dave# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... moon# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... carol# sleep 2 carol# ipsec up moon 002 "moon"[1] 192.168.0.1 #1: initiating Main Mode 104 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I1: initiate 003 "moon"[1] 192.168.0.1 #1: ignoring Vendor ID payload [strongSwan 4.2.17] 003 "moon"[1] 192.168.0.1 #1: received Vendor ID payload [XAUTH] 003 "moon"[1] 192.168.0.1 #1: received Vendor ID payload [Dead Peer Detection] 106 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "moon"[1] 192.168.0.1 #1: we have a cert and are sending it upon request 108 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "moon"[1] 192.168.0.1 #1: Peer ID is ID_FQDN: '@moon.strongswan.org' 002 "moon"[1] 192.168.0.1 #1: crl not found 002 "moon"[1] 192.168.0.1 #1: certificate status unknown 002 "moon"[1] 192.168.0.1 #1: ISAKMP SA established 004 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I4: ISAKMP SA established 002 "moon"[1] 192.168.0.1 #2: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "moon"[1] 192.168.0.1 #2: STATE_QUICK_I1: initiate 002 "moon"[1] 192.168.0.1 #2: sent QI2, IPsec SA established {ESP=>0x2a685afc <0x77ad3445} 004 "moon"[1] 192.168.0.1 #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0x2a685afc <0x77ad3445} dave# ipsec up moon 002 "moon"[1] 192.168.0.1 #1: initiating Main Mode 104 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I1: initiate 003 "moon"[1] 192.168.0.1 #1: ignoring Vendor ID payload [strongSwan 4.2.17] 003 "moon"[1] 192.168.0.1 #1: received Vendor ID payload [XAUTH] 003 "moon"[1] 192.168.0.1 #1: received Vendor ID payload [Dead Peer Detection] 106 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "moon"[1] 192.168.0.1 #1: we have a cert and are sending it upon request 108 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "moon"[1] 192.168.0.1 #1: Peer ID is ID_FQDN: '@moon.strongswan.org' 002 "moon"[1] 192.168.0.1 #1: crl not found 002 "moon"[1] 192.168.0.1 #1: certificate status unknown 002 "moon"[1] 192.168.0.1 #1: ISAKMP SA established 004 "moon"[1] 192.168.0.1 #1: STATE_MAIN_I4: ISAKMP SA established 002 "moon"[1] 192.168.0.1 #2: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "moon"[1] 192.168.0.1 #2: STATE_QUICK_I1: initiate 002 "moon"[1] 192.168.0.1 #2: sent QI2, IPsec SA established {ESP=>0xbe9f5366 <0x1e2d5b2f} 004 "moon"[1] 192.168.0.1 #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0xbe9f5366 <0x1e2d5b2f} carol# sleep 1 TEST carol# ipsec status | grep 'moon.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "moon"[1] 192.168.0.1 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 985s; newest IPSEC; eroute owner carol# ping -c 1 10.1.0.10 | grep '64 bytes from 10.1.0.10: icmp_seq=1' [YES] 64 bytes from 10.1.0.10: icmp_seq=1 ttl=63 time=6.41 ms dave# ipsec status | grep 'moon.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "moon"[1] 192.168.0.1 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 871s; newest IPSEC; eroute owner dave# ping -c 1 10.1.0.10 | grep '64 bytes from 10.1.0.10: icmp_seq=1' [YES] 64 bytes from 10.1.0.10: icmp_seq=1 ttl=63 time=0.736 ms moon# ipsec status | grep 'carol.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "carol"[1] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1104s; newest IPSEC; eroute owner moon# ipsec status | grep 'dave.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #4: "dave"[2] 192.168.0.200 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1108s; newest IPSEC; eroute owner alice# killall tcpdump alice# cat /tmp/tcpdump.log | grep 'IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 14:29:34.746160 IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request, id 21027, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply' [YES] 14:29:34.749085 IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply, id 21027, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 14:29:35.418658 IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request, id 24596, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply' [YES] 14:29:35.418694 IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply, id 24596, seq 1, length 64 POST-TEST carol# ipsec stop Stopping strongSwan IPsec... dave# ipsec stop Stopping strongSwan IPsec... moon# sleep 1 moon# ipsec stop Stopping strongSwan IPsec... moon# mv /etc/hosts.ori /etc/hosts moon# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] dave# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# ip addr del 10.3.0.1/32 dev eth0 dave# ip addr del 10.3.0.2/32 dev eth0 moon# killall tcpdump