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# cat /etc/ipsec.d/tables.sql > /etc/ipsec.d/ipsec.sql moon# cat /etc/ipsec.d/ipsec.sql | sqlite3 /etc/ipsec.d/ipsec.db moon# ipsec pool --add bigpool --start 10.3.0.1 --end 10.3.3.232 --timeout 0 2> /dev/null allocating 1000 addresses... done. 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 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 ] 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 CERTREQ IDr AUTH CP SA TSi TSr N(MOBIKE_SUP) N(ADD_6_ADDR) ] 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 CP 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 Aug 19 13:47:17 2009 certificate status is good authentication of 'moon.strongswan.org' with RSA signature successful scheduling reauthentication in 3279s maximum IKE_SA lifetime 3459s IKE_SA home[1] established between 192.168.0.100[carol@strongswan.org]...192.168.0.1[moon.strongswan.org] installing new virtual IP 10.3.0.1 dave# 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.200[500] to 192.168.0.1[500] received packet: from 192.168.0.1[500] to 192.168.0.200[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, CN=strongSwan Root CA" sending cert request for "C=CH, O=Linux strongSwan, CN=strongSwan Root CA" authentication of 'dave@strongswan.org' (myself) with RSA signature successful sending end entity cert "C=CH, O=Linux strongSwan, OU=Accounting, CN=dave@strongswan.org" establishing CHILD_SA home generating IKE_AUTH request 1 [ IDi CERT CERTREQ IDr AUTH CP SA TSi TSr N(MOBIKE_SUP) N(ADD_6_ADDR) ] sending packet: from 192.168.0.200[4500] to 192.168.0.1[4500] received packet: from 192.168.0.1[4500] to 192.168.0.200[4500] parsed IKE_AUTH response 1 [ IDr CERT AUTH CP 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 Aug 19 13:47:17 2009 certificate status is good authentication of 'moon.strongswan.org' with RSA signature successful scheduling reauthentication in 3404s maximum IKE_SA lifetime 3584s IKE_SA home[1] established between 192.168.0.200[dave@strongswan.org]...192.168.0.1[moon.strongswan.org] installing new virtual IP 10.3.0.2 carol# sleep 1 TEST carol# cat /var/log/daemon.log | grep 'installing new virtual IP 10.3.0.1' [YES] Jul 20 16:03:05 carol charon: 14[IKE] installing new virtual IP 10.3.0.1 carol# ip addr list dev eth0 | grep '10.3.0.1' [YES] inet 10.3.0.1/32 scope global eth0 carol# ip route list table 220 | grep '10.1.0.0/16.*src 10.3.0.1' [YES] 10.1.0.0/16 via 192.168.0.1 dev eth0 proto static src 10.3.0.1 carol# ipsec status | grep 'home.*INSTALLED' [YES] home{1}: INSTALLED, TUNNEL, ESP SPIs: c817721e_i c216fb50_o 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=1.08 ms dave# cat /var/log/daemon.log | grep 'installing new virtual IP 10.3.0.2' [YES] Jul 20 16:03:06 dave charon: 14[IKE] installing new virtual IP 10.3.0.2 dave# ip addr list dev eth0 | grep '10.3.0.2' [YES] inet 10.3.0.2/32 scope global eth0 dave# ip route list table 220 | grep '10.1.0.0/16.*src 10.3.0.2' [YES] 10.1.0.0/16 via 192.168.0.1 dev eth0 proto static src 10.3.0.2 dave# ipsec status | grep 'home.*INSTALLED' [YES] home{1}: INSTALLED, TUNNEL, ESP SPIs: c2a7989b_i ca6aaeed_o 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=1.11 ms moon# cat /var/log/daemon.log | grep 'peer requested virtual IP %any' [YES] Jul 20 16:03:05 moon charon: 11[IKE] peer requested virtual IP %any Jul 20 16:03:06 moon charon: 13[IKE] peer requested virtual IP %any moon# cat /var/log/daemon.log | grep 'acquired new lease for address.*in pool.*bigpool' [YES] Jul 20 16:03:05 moon charon: 11[CFG] acquired new lease for address 10.3.0.1 in pool 'bigpool' Jul 20 16:03:06 moon charon: 13[CFG] acquired new lease for address 10.3.0.2 in pool 'bigpool' moon# cat /var/log/daemon.log | grep 'assigning virtual IP' [YES] Jul 20 16:03:05 moon charon: 11[IKE] assigning virtual IP 10.3.0.1 to peer Jul 20 16:03:06 moon charon: 13[IKE] assigning virtual IP 10.3.0.2 to peer moon# ipsec pool --status 2> /dev/null | grep 'bigpool.*10.3.0.1.*10.3.3.232.*static.*2' [YES] bigpool 10.3.0.1 10.3.3.232 static 1000 2 ( 0%) 2 ( 0%) moon# ipsec pool --leases --filter pool=bigpool,addr=10.3.0.1,id=carol@strongswan.org 2> /dev/null | grep 'online' [YES] bigpool 10.3.0.1 online Jul 20 16:03:05 2009 carol@strongswan.org moon# ipsec pool --leases --filter pool=bigpool,addr=10.3.0.2,id=dave@strongswan.org 2> /dev/null | grep 'online' [YES] bigpool 10.3.0.2 online Jul 20 16:03:06 2009 dave@strongswan.org moon# ipsec status | grep 'rw.*ESTABLISHED.*carol@strongswan.org' [YES] rw[1]: ESTABLISHED 10 seconds ago, 192.168.0.1[moon.strongswan.org]...192.168.0.100[carol@strongswan.org] moon# ipsec status | grep 'rw.*ESTABLISHED.*dave@strongswan.org' [YES] rw[2]: ESTABLISHED 10 seconds ago, 192.168.0.1[moon.strongswan.org]...192.168.0.200[dave@strongswan.org] moon# killall tcpdump moon# cat /tmp/tcpdump.log | grep 'IP carol.strongswan.org > moon.strongswan.org: ESP' [YES] 16:03:10.053428 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0xc216fb50,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > carol.strongswan.org: ESP' [YES] 16:03:10.053875 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0xc817721e,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP dave.strongswan.org > moon.strongswan.org: ESP' [YES] 16:03:11.857425 IP dave.strongswan.org > moon.strongswan.org: ESP(spi=0xca6aaeed,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > dave.strongswan.org: ESP' [YES] 16:03:11.857856 IP moon.strongswan.org > dave.strongswan.org: ESP(spi=0xc2a7989b,seq=0x1), length 132 alice# killall tcpdump alice# cat /tmp/tcpdump.log | grep 'IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 16:03:10.285577 IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request, id 4198, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply' [YES] 16:03:10.296813 IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply, id 4198, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 16:03:12.089221 IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request, id 35625, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply' [YES] 16:03:12.089276 IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply, id 35625, seq 1, length 64 POST-TEST moon# ipsec stop Stopping strongSwan IPsec... carol# ipsec stop Stopping strongSwan IPsec... dave# 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 ] dave# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] moon# ipsec pool --del bigpool 2> /dev/null moon# rm /etc/ipsec.d/ipsec.*