PRE-TEST

moon# ipsec start
Starting strongSwan 4.6.4 IPsec [starter]...
No leaks detected, 5 suppressed by whitelist

carol# ipsec start
Starting strongSwan 4.6.4 IPsec [starter]...
No leaks detected, 5 suppressed by whitelist

carol# sleep 2 

carol# ipsec up home
initiating IKE_SA home[1] to 192.168.0.1
generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) ]
sending packet: from 192.168.0.100[500] to 192.168.0.1[500]
received packet: from 192.168.0.1[500] to 192.168.0.100[500]
parsed IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(MULT_AUTH) ]
received cert request for "C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
sending cert request for "C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
authentication of 'carol@strongswan.org' (myself) with RSA signature successful
sending end entity cert "C=CH, O=Linux strongSwan, OU=Research, CN=carol@strongswan.org"
establishing CHILD_SA home
generating IKE_AUTH request 1 [ IDi CERT N(INIT_CONTACT) CERTREQ IDr AUTH SA TSi TSr N(MOBIKE_SUP) N(ADD_6_ADDR) N(MULT_AUTH) N(EAP_ONLY) ]
sending packet: from 192.168.0.100[4500] to 192.168.0.1[4500]
received packet: from 192.168.0.1[4500] to 192.168.0.100[4500]
parsed IKE_AUTH response 1 [ IDr CERT AUTH SA TSi TSr N(AUTH_LFT) N(MOBIKE_SUP) N(ADD_4_ADDR) N(ADD_6_ADDR) N(ADD_6_ADDR) ]
received end entity cert "C=CH, O=Linux strongSwan, CN=moon.strongswan.org"
  using certificate "C=CH, O=Linux strongSwan, CN=moon.strongswan.org"
  using trusted ca certificate "C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
checking certificate status of "C=CH, O=Linux strongSwan, CN=moon.strongswan.org"
  fetching crl from 'http://crl.strongswan.org/strongswan.crl' ...
  using trusted certificate "C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
  crl correctly signed by "C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
  crl is valid: until Jun 30 17:25:59 2012
certificate status is good
  reached self-signed root ca with a path length of 0
authentication of 'moon.strongswan.org' with RSA signature successful
IKE_SA home[1] established between 192.168.0.100[carol@strongswan.org]...192.168.0.1[moon.strongswan.org]
scheduling reauthentication in 3409s
maximum IKE_SA lifetime 3589s
No leaks detected, 1 suppressed by whitelist


TEST

carol# ipsec statusall | grep 'home.*INSTALLED' [YES]
No leaks detected, 1 suppressed by whitelist
        home{1}:  INSTALLED, TUNNEL, ESP SPIs: c26dc23e_i ca58f3a3_o

moon# ipsec statusall | grep 'rw.*INSTALLED' [YES]
No leaks detected, 1 suppressed by whitelist
          rw{1}:  INSTALLED, TUNNEL, ESP SPIs: ca58f3a3_i c26dc23e_o

moon# iptables -A INPUT -i eth0 -s 192.168.0.100 -j DROP | grep 'no output expected' [NO]

carol# iptables -A INPUT -i eth0 -s 192.168.0.1 -j DROP | grep 'no output expected' [NO]

carol# sleep 180 | grep 'no output expected' [NO]

carol# cat /var/log/daemon.log | grep 'sending DPD request' [YES]
May 31 20:54:23 carol charon: 08[IKE] sending DPD request 

carol# cat /var/log/daemon.log | grep 'retransmit.*of request' [YES]
May 31 20:54:27 carol charon: 03[IKE] retransmit 1 of request with message ID 2 
May 31 20:54:34 carol charon: 04[IKE] retransmit 2 of request with message ID 2 
May 31 20:54:47 carol charon: 01[IKE] retransmit 3 of request with message ID 2 
May 31 20:55:10 carol charon: 02[IKE] retransmit 4 of request with message ID 2 
May 31 20:55:52 carol charon: 05[IKE] retransmit 5 of request with message ID 2 
May 31 20:57:13 carol charon: 01[IKE] retransmit 1 of request with message ID 0 

carol# cat /var/log/daemon.log | grep 'giving up after 5 retransmits' [YES]
May 31 20:57:08 carol charon: 05[IKE] giving up after 5 retransmits 

carol# iptables -D INPUT -i eth0 -s 192.168.0.1 -j DROP | grep 'no output expected' [NO]

moon# iptables -D INPUT -i eth0 -s 192.168.0.100 -j DROP | grep 'no output expected' [NO]

carol# sleep 10 | grep 'no output expected' [NO]

carol# ipsec statusall | grep 'home.*INSTALLED' [YES]
No leaks detected, 1 suppressed by whitelist
        home{2}:  INSTALLED, TUNNEL, ESP SPIs: cd278629_i c64e6def_o

moon# ipsec statusall | grep 'rw.*INSTALLED' [YES]
No leaks detected, 1 suppressed by whitelist
          rw{2}:  INSTALLED, TUNNEL, ESP SPIs: c64e6def_i cd278629_o


POST-TEST

moon# ipsec stop
Stopping strongSwan IPsec...

carol# ipsec stop
Stopping strongSwan IPsec...