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 & venus# 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 ] 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.3.6 IPsec [starter]... dave# ipsec start Starting strongSwan 4.3.6 IPsec [starter]... moon# ipsec start Starting strongSwan 4.3.6 IPsec [starter]... carol# sleep 2 carol# ipsec up alice 002 "alice" #1: initiating Main Mode 104 "alice" #1: STATE_MAIN_I1: initiate 003 "alice" #1: ignoring Vendor ID payload [strongSwan] 003 "alice" #1: received Vendor ID payload [XAUTH] 003 "alice" #1: received Vendor ID payload [Dead Peer Detection] 106 "alice" #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "alice" #1: we have a cert and are sending it upon request 108 "alice" #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "alice" #1: Peer ID is ID_FQDN: 'moon.strongswan.org' 002 "alice" #1: crl not found 002 "alice" #1: certificate status unknown 002 "alice" #1: ISAKMP SA established 004 "alice" #1: STATE_MAIN_I4: ISAKMP SA established 002 "alice" #1: sending ModeCfg request 002 "alice" #1: parsing ModeCfg reply 002 "alice" #1: received IPv4 DNS server address 192.168.0.150 002 "alice" #1: received IPv6 DNS server address fec1::20 002 "alice" #1: setting virtual IP source address to 10.3.0.1 002 "alice" #1: received ModeCfg reply, established 004 "alice" #1: STATE_MODE_CFG_I2: received ModeCfg reply, established 002 "alice" #2: initiating Quick Mode PUBKEY+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "alice" #2: STATE_QUICK_I1: initiate 002 "alice" #2: sent QI2, IPsec SA established {ESP=>0xeea3d0d8 <0x92e8191d} 004 "alice" #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0xeea3d0d8 <0x92e8191d} carol# ipsec up venus 002 "venus": inheriting virtual IP source address 10.3.0.1 from ModeCfg 002 "venus" #3: initiating Quick Mode PUBKEY+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "venus" #3: STATE_QUICK_I1: initiate 002 "venus" #3: sent QI2, IPsec SA established {ESP=>0xe33e6f78 <0x8e5abe66} 004 "venus" #3: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0xe33e6f78 <0x8e5abe66} dave# ipsec up venus 002 "venus" #1: initiating Main Mode 104 "venus" #1: STATE_MAIN_I1: initiate 003 "venus" #1: ignoring Vendor ID payload [strongSwan] 003 "venus" #1: received Vendor ID payload [XAUTH] 003 "venus" #1: received Vendor ID payload [Dead Peer Detection] 106 "venus" #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "venus" #1: we have a cert and are sending it upon request 108 "venus" #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "venus" #1: Peer ID is ID_FQDN: 'moon.strongswan.org' 002 "venus" #1: crl not found 002 "venus" #1: certificate status unknown 002 "venus" #1: ISAKMP SA established 004 "venus" #1: STATE_MAIN_I4: ISAKMP SA established 002 "venus" #1: sending ModeCfg request 002 "venus" #1: parsing ModeCfg reply 002 "venus" #1: received IPv4 DNS server address 192.168.0.150 002 "venus" #1: received IPv6 DNS server address fec1::20 002 "venus" #1: setting virtual IP source address to 10.3.0.2 002 "venus" #1: received ModeCfg reply, established 004 "venus" #1: STATE_MODE_CFG_I2: received ModeCfg reply, established 002 "venus" #2: initiating Quick Mode PUBKEY+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "venus" #2: STATE_QUICK_I1: initiate 002 "venus" #2: sent QI2, IPsec SA established {ESP=>0x1415c086 <0xd4d96fb0} 004 "venus" #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0x1415c086 <0xd4d96fb0} dave# ipsec up alice 002 "alice": inheriting virtual IP source address 10.3.0.2 from ModeCfg 002 "alice" #3: initiating Quick Mode PUBKEY+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "alice" #3: STATE_QUICK_I1: initiate 002 "alice" #3: sent QI2, IPsec SA established {ESP=>0x4ea984e9 <0x230aad5a} 004 "alice" #3: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0x4ea984e9 <0x230aad5a} carol# sleep 1 TEST carol# cat /var/log/auth.log | grep 'alice.*setting virtual IP source address to 10.3.0.1' [YES] Feb 27 23:08:32 carol pluto[14611]: "alice" #1: setting virtual IP source address to 10.3.0.1 carol# ipsec status | grep 'alice.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "alice" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 939s; newest IPSEC; eroute owner carol# cat /var/log/auth.log | grep 'venus.*inheriting virtual IP source address 10.3.0.1 from ModeCfg' [YES] Feb 27 23:08:34 carol pluto[14611]: "venus": inheriting virtual IP source address 10.3.0.1 from ModeCfg carol# ipsec status | grep 'venus.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #3: "venus" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 871s; 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=0.369 ms carol# ping -c 1 10.1.0.20 | grep '64 bytes from 10.1.0.20: icmp_seq=1' [YES] 64 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=12.8 ms dave# cat /var/log/auth.log | grep 'venus.*setting virtual IP source address to 10.3.0.2' [YES] Feb 27 23:08:39 dave pluto[7476]: "venus" #1: setting virtual IP source address to 10.3.0.2 dave# ipsec status | grep 'venus.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "venus" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 945s; newest IPSEC; eroute owner dave# cat /var/log/auth.log | grep 'alice.*inheriting virtual IP source address 10.3.0.2 from ModeCfg' [YES] Feb 27 23:08:41 dave pluto[7476]: "alice": inheriting virtual IP source address 10.3.0.2 from ModeCfg dave# ipsec status | grep 'alice.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #3: "alice" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 876s; newest IPSEC; eroute owner dave# ping -c 1 10.1.0.20 | grep '64 bytes from 10.1.0.20: icmp_seq=1' [YES] 64 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=0.441 ms 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=0.480 ms moon# ipsec status | grep 'carol-alice.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "carol-alice"[1] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1098s; newest IPSEC; eroute owner moon# ipsec status | grep 'carol-venus.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #3: "carol-venus"[1] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1100s; newest IPSEC; eroute owner moon# ipsec status | grep 'dave-venus.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #5: "dave-venus"[2] 192.168.0.200 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1104s; newest IPSEC; eroute owner moon# ipsec status | grep 'dave-alice.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #6: "dave-alice"[1] 192.168.0.200 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1106s; newest IPSEC; eroute owner moon# killall tcpdump moon# cat /tmp/tcpdump.log | grep 'IP carol.strongswan.org > moon.strongswan.org: ESP' [YES] 23:08:46.075512 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0xeea3d0d8,seq=0x1), length 132 23:08:46.312358 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0xe33e6f78,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > carol.strongswan.org: ESP' [YES] 23:08:46.075731 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0x92e8191d,seq=0x1), length 132 23:08:46.324725 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0x8e5abe66,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP dave.strongswan.org > moon.strongswan.org: ESP' [YES] 23:08:47.357280 IP dave.strongswan.org > moon.strongswan.org: ESP(spi=0x1415c086,seq=0x1), length 132 23:08:47.578549 IP dave.strongswan.org > moon.strongswan.org: ESP(spi=0x4ea984e9,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > dave.strongswan.org: ESP' [YES] 23:08:47.357501 IP moon.strongswan.org > dave.strongswan.org: ESP(spi=0xd4d96fb0,seq=0x1), length 132 23:08:47.578880 IP moon.strongswan.org > dave.strongswan.org: ESP(spi=0x230aad5a,seq=0x1), length 132 alice# killall tcpdump alice# cat /tmp/tcpdump.log | grep 'IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 23:08:46.013353 IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request, id 36409, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply' [YES] 23:08:46.014646 IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply, id 36409, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request' [YES] 23:08:47.516392 IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request, id 44061, seq 1, length 64 alice# cat /tmp/tcpdump.log | grep 'IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply' [YES] 23:08:47.516423 IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply, id 44061, seq 1, length 64 venus# killall tcpdump venus# cat /tmp/tcpdump.log | grep 'IP carol1.strongswan.org > venus.strongswan.org: ICMP echo request' [YES] 23:08:46.227722 IP carol1.strongswan.org > venus.strongswan.org: ICMP echo request, id 37177, seq 1, length 64 venus# cat /tmp/tcpdump.log | grep 'IP venus.strongswan.org > carol1.strongswan.org: ICMP echo reply' [YES] 23:08:46.228863 IP venus.strongswan.org > carol1.strongswan.org: ICMP echo reply, id 37177, seq 1, length 64 venus# cat /tmp/tcpdump.log | grep 'IP dave1.strongswan.org > venus.strongswan.org: ICMP echo request' [YES] 23:08:47.261693 IP dave1.strongswan.org > venus.strongswan.org: ICMP echo request, id 43293, seq 1, length 64 venus# cat /tmp/tcpdump.log | grep 'IP venus.strongswan.org > dave1.strongswan.org: ICMP echo reply' [YES] 23:08:47.261730 IP venus.strongswan.org > dave1.strongswan.org: ICMP echo reply, id 43293, 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 ] carol# ip addr del 10.3.0.1/32 dev eth0 dave# ip addr del 10.3.0.2/32 dev eth0