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 1 moon# ipsec up net-net initiating IKE_SA net-net[1] to 192.168.0.2 generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) ] sending packet: from 192.168.0.1[500] to 192.168.0.2[500] received packet: from 192.168.0.2[500] to 192.168.0.1[500] parsed IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ ] received cert request for "C=CH, O=Linux strongSwan, OU=RFC3779, CN=strongSwan RFC3779 CA" sending cert request for "C=CH, O=Linux strongSwan, OU=RFC3779, CN=strongSwan RFC3779 CA" authentication of 'moon.strongswan.org' (myself) with RSA signature successful sending end entity cert "C=CH, O=Linux strongSwan, OU=RFC3779, CN=moon.strongswan.org" establishing CHILD_SA net-net generating IKE_AUTH request 1 [ IDi CERT CERTREQ IDr AUTH SA TSi TSr N(EAP_ONLY) ] sending packet: from 192.168.0.1[500] to 192.168.0.2[500] received packet: from 192.168.0.2[500] to 192.168.0.1[500] parsed IKE_AUTH response 1 [ IDr CERT AUTH SA TSi TSr N(AUTH_LFT) ] received end entity cert "C=CH, O=Linux strongSwan, OU=RFC3779, CN=sun.strongswan.org" using certificate "C=CH, O=Linux strongSwan, OU=RFC3779, CN=sun.strongswan.org" using trusted ca certificate "C=CH, O=Linux strongSwan, OU=RFC3779, CN=strongSwan RFC3779 CA" checking certificate status of "C=CH, O=Linux strongSwan, OU=RFC3779, CN=sun.strongswan.org" fetching crl from 'http://crl.strongswan.org/strongswan_rfc3779.crl' ... using trusted certificate "C=CH, O=Linux strongSwan, OU=RFC3779, CN=strongSwan RFC3779 CA" crl correctly signed by "C=CH, O=Linux strongSwan, OU=RFC3779, CN=strongSwan RFC3779 CA" crl is valid: until Mar 14 22:27:26 2010 certificate status is good reached self-signed root ca with a path length of 0 authentication of 'sun.strongswan.org' with RSA signature successful IKE_SA net-net[1] established between 192.168.0.1[moon.strongswan.org]...192.168.0.2[sun.strongswan.org] scheduling reauthentication in 3353s maximum IKE_SA lifetime 3533s checking certificate-based traffic selector constraints [RFC 3779] TS 10.2.0.0/16 is contained in address block constraint 10.2.0.0/16 moon# sleep 1 TEST moon# ipsec statusall | grep 'net-net.*ESTABLISHED' [YES] net-net[1]: ESTABLISHED 2 seconds ago, 192.168.0.1[moon.strongswan.org]...192.168.0.2[sun.strongswan.org] sun# ipsec statusall | grep 'net-net.*ESTABLISHED' [YES] net-net[1]: ESTABLISHED 2 seconds ago, 192.168.0.2[sun.strongswan.org]...192.168.0.1[moon.strongswan.org] moon# cat /var/log/daemon.log | grep 'subject address block 10.2.0.0/16 is contained in issuer address block 10.1.0.0..10.2.255.255' [YES ] Feb 28 00:34:35 moon charon: 16[CFG] subject address block 10.2.0.0/16 is contained in issuer address block 10.1.0.0..10.2.255.255 moon# cat /var/log/daemon.log | grep 'subject address block 192.168.0.2/32 is contained in issuer address block 192.168.0.0/24' [YES ] Feb 28 00:34:35 moon charon: 16[CFG] subject address block 192.168.0.2/32 is contained in issuer address block 192.168.0.0/24 moon# cat /var/log/daemon.log | grep 'subject address block fec0:\:2/128 is contained in issuer address block fec0:\:..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff' [YES ] Feb 28 00:34:35 moon charon: 16[CFG] subject address block fec0::2/128 is contained in issuer address block fec0::..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff moon# cat /var/log/daemon.log | grep 'subject address block fec2:\:/16 is contained in issuer address block fec0:\:..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff' [YES ] Feb 28 00:34:35 moon charon: 16[CFG] subject address block fec2::/16 is contained in issuer address block fec0::..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff sun# cat /var/log/daemon.log | grep 'subject address block 10.1.0.0/16 is contained in issuer address block 10.1.0.0..10.2.255.255' [YES ] Feb 28 00:34:35 sun charon: 09[CFG] subject address block 10.1.0.0/16 is contained in issuer address block 10.1.0.0..10.2.255.255 sun# cat /var/log/daemon.log | grep 'subject address block 192.168.0.1/32 is contained in issuer address block 192.168.0.0/24' [YES ] Feb 28 00:34:35 sun charon: 09[CFG] subject address block 192.168.0.1/32 is contained in issuer address block 192.168.0.0/24 sun# cat /var/log/daemon.log | grep 'subject address block fec0:\:1/128 is contained in issuer address block fec0:\:..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff' [YES ] Feb 28 00:34:35 sun charon: 09[CFG] subject address block fec0::1/128 is contained in issuer address block fec0::..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff sun# cat /var/log/daemon.log | grep 'subject address block fec1:\:/16 is contained in issuer address block fec0:\:..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff' [YES ] Feb 28 00:34:35 sun charon: 09[CFG] subject address block fec1::/16 is contained in issuer address block fec0::..fec2:ffff:ffff:ffff:ffff:ffff:ffff:ffff moon# cat /var/log/daemon.log | grep 'TS 10.2.0.0/16 is contained in address block constraint 10.2.0.0/16' [YES] Feb 28 00:34:35 moon charon: 16[IKE] TS 10.2.0.0/16 is contained in address block constraint 10.2.0.0/16 sun# cat /var/log/daemon.log | grep 'TS 10.1.0.0/16 is contained in address block constraint 10.1.0.0/16' [YES] Feb 28 00:34:35 sun charon: 09[IKE] TS 10.1.0.0/16 is contained in address block constraint 10.1.0.0/16 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.530 ms sun# killall tcpdump sun# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > sun.strongswan.org: ESP' [YES] 00:34:39.278366 IP moon.strongswan.org > sun.strongswan.org: ESP(spi=0xc878de8e,seq=0x1), length 132 sun# cat /tmp/tcpdump.log | grep 'IP sun.strongswan.org > moon.strongswan.org: ESP' [YES] 00:34:39.278574 IP sun.strongswan.org > moon.strongswan.org: ESP(spi=0xc6498c86,seq=0x1), 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 ]