TCPDUMP moon# 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 ] moon# iptables -I FORWARD -i eth0 -p tcp -d 10.1.0.0/16 --dport ssh -jACCEPT moon# iptables -I FORWARD -o eth0 -p tcp -s 10.1.0.0/16 --sport ssh -jACCEPT carol# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] carol# iptables -I INPUT -i eth0 -p tcp -s 10.1.0.0/16 --sport ssh -d 192.168.0.100 -jACCEPT carol# iptables -I OUTPUT -o eth0 -p tcp -d 10.1.0.0/16 --dport ssh -s 192.168.0.100 -jACCEPT carol# ip route add 10.1.0.0/16 via 192.168.0.1 moon# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... carol# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... carol# sleep 2 carol# ipsec up home-icmp 002 "home-icmp" #1: initiating Main Mode 104 "home-icmp" #1: STATE_MAIN_I1: initiate 003 "home-icmp" #1: ignoring Vendor ID payload [strongSwan 4.2.17] 003 "home-icmp" #1: received Vendor ID payload [XAUTH] 003 "home-icmp" #1: received Vendor ID payload [Dead Peer Detection] 106 "home-icmp" #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "home-icmp" #1: we have a cert and are sending it upon request 108 "home-icmp" #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "home-icmp" #1: Peer ID is ID_FQDN: '@moon.strongswan.org' 002 "home-icmp" #1: crl not found 002 "home-icmp" #1: certificate status unknown 002 "home-icmp" #1: ISAKMP SA established 004 "home-icmp" #1: STATE_MAIN_I4: ISAKMP SA established 002 "home-icmp" #2: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "home-icmp" #2: STATE_QUICK_I1: initiate 002 "home-icmp" #2: sent QI2, IPsec SA established {ESP=>0xaeb7a9ac <0x4825a25f} 004 "home-icmp" #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0xaeb7a9ac <0x4825a25f} TEST carol# ipsec status | grep 'home.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "home-icmp" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 935s; newest IPSEC; eroute owner moon# ipsec status | grep 'rw.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "rw-icmp"[2] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1110s; 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=3.87 ms carol# ping -c 1 10.1.0.1 | grep '64 bytes from 10.1.0.1: icmp_seq=1' [YES] 64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.468 ms carol# ssh -o ConnectTimeout=5 10.1.0.10 hostname | grep 'alice' [YES] alice moon# killall tcpdump moon# cat /tmp/tcpdump.log | grep 'IP carol.strongswan.org > moon.strongswan.org: ESP' [YES] 15:14:09.364951 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0xaeb7a9ac,seq=0x1), length 132 15:14:09.655222 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0xaeb7a9ac,seq=0x2), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > carol.strongswan.org: ESP' [YES] 15:14:09.365370 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0x4825a25f,seq=0x1), length 132 15:14:09.655398 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0x4825a25f,seq=0x2), length 132 POST-TEST moon# ipsec stop Stopping strongSwan IPsec... carol# ipsec stop Stopping strongSwan IPsec... carol# ip route del 10.1.0.0/16 via 192.168.0.1 moon# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ]