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 * Starting firewall ... [ ok ] carol# /etc/init.d/iptables start 2> /dev/null * Starting firewall ... [ ok ] carol# ipsec start Starting strongSwan IPsec 2.8.11 [starter]... moon# ipsec start Starting strongSwan IPsec 2.8.11 [starter]... carol# ipsec up home 002 "home" #1: initiating Main Mode 104 "home" #1: STATE_MAIN_I1: initiate 003 "home" #1: ignoring Vendor ID payload [strongSwan 2.8.11] 003 "home" #1: received Vendor ID payload [XAUTH] 003 "home" #1: received Vendor ID payload [Dead Peer Detection] 106 "home" #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "home" #1: we have a cert and are sending it 108 "home" #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "home" #1: Peer ID is ID_FQDN: '@moon.strongswan.org' 002 "home" #1: crl not found 002 "home" #1: certificate status unknown 002 "home" #1: ISAKMP SA established 004 "home" #1: STATE_MAIN_I4: ISAKMP SA established 002 "home" #2: initiating Quick Mode RSASIG+ENCRYPT+AUTHENTICATE+TUNNEL+PFS+UP {using isakmp#1} 112 "home" #2: STATE_QUICK_I1: initiate 002 "home" #2: sent QI2, IPsec SA established {ESP=>0x60e25690 <0xf87ae489 AH=>0x2f7f6f2c <0x17e5c70a} 004 "home" #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0x60e25690 <0xf87ae489 AH=>0x2f7f6f2c <0x17e5c70a} TEST carol# ipsec status | grep 'home.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "home" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 846s; newest IPSEC; eroute owner moon# ipsec status | grep 'rw.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "rw"[1] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1110s; newest IPSEC; eroute owner carol# ipsec statusall | grep 'ESP algorithm newest: AES_128-;' [YES] 000 "home": ESP algorithm newest: AES_128-; pfsgroup= moon# ipsec statusall | grep 'ESP algorithm newest: AES_128-;' [YES] 000 "rw"[1]: ESP algorithm newest: AES_128-; pfsgroup= carol# ping -c 1 -s 120 -p deadbeef 10.1.0.10 | grep '128 bytes from 10.1.0.10: icmp_seq=1' [YES] 128 bytes from 10.1.0.10: icmp_seq=1 ttl=63 time=4.42 ms carol# ipsec status | grep 'ah\..*ah\..*esp\..*ago.*esp\..*ago.*tunnel' [YES] 000 #2: "home" ah.2f7f6f2c@192.168.0.1 ah.17e5c70a@192.168.0.100 esp.60e25690@192.168.0.1 (148 bytes, 0s ago) esp.f87ae489@192.168.0.100 (148 bytes, 0s ago); tunnel moon# ipsec status | grep 'ah\..*ah\..*esp\..*ago.*esp\..*ago.*tunnel' [YES] 000 #2: "rw"[1] 192.168.0.100 ah.17e5c70a@192.168.0.100 ah.2f7f6f2c@192.168.0.1 esp.f87ae489@192.168.0.100 (148 bytes, 0s ago) esp.60e25690@192.168.0.1 (148 bytes, 0s ago); tunnel moon# killall tcpdump moon# cat /tmp/tcpdump.log | grep 'AH.*ESP' [YES] 07:01:45.223158 IP carol.strongswan.org > moon.strongswan.org: AH(spi=0x2f7f6f2c,seq=0x1): ESP(spi=0x60e25690,seq=0x1), length 184 07:01:45.227080 IP moon.strongswan.org > carol.strongswan.org: AH(spi=0x17e5c70a,seq=0x1): ESP(spi=0xf87ae489,seq=0x1), length 184 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 228 ACCEPT ah -- eth0 * 0.0.0.0/0 0.0.0.0/0 5 2400 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 281 37449 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 148 ACCEPT all -- eth0 * 192.168.0.100 10.1.0.0/16 policy match dir in pol ipsec reqid 16389 proto 50 1 148 ACCEPT all -- * eth0 10.1.0.0/16 192.168.0.100 policy match dir out pol ipsec reqid 16389 proto 50 Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 228 ACCEPT ah -- * eth0 0.0.0.0/0 0.0.0.0/0 4 2268 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 345 60363 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:22 carol# iptables -v -n -L Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 148 ACCEPT all -- eth0 * 10.1.0.0/16 192.168.0.100 policy match dir in pol ipsec reqid 16385 proto 50 1 228 ACCEPT ah -- eth0 * 0.0.0.0/0 0.0.0.0/0 4 2268 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 311 39041 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 Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 148 ACCEPT all -- * eth0 192.168.0.100 10.1.0.0/16 policy match dir out pol ipsec reqid 16385 proto 50 1 228 ACCEPT ah -- * eth0 0.0.0.0/0 0.0.0.0/0 5 2400 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 405 62523 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:22 moon# ipsec stop Stopping strongSwan IPsec... carol# ipsec stop Stopping strongSwan IPsec... moon# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ]