| 1 |
/testing/guestbin/swan-prep --userland strongswan |
| 2 |
west # |
| 3 |
cp /testing/x509/real/mainca/root.cert /etc/strongswan/ipsec.d/cacerts/mainca.crt |
| 4 |
west # |
| 5 |
cp /testing/x509/real/mainca/`hostname`.end.key /etc/strongswan/ipsec.d/private/`hostname`.key |
| 6 |
west # |
| 7 |
cp /testing/x509/real/mainca/`hostname`.end.cert /etc/strongswan/ipsec.d/certs/`hostname`.crt |
| 8 |
west # |
| 9 |
# why? |
| 10 |
west # |
| 11 |
cp /testing/x509/real/mainca/east.end.cert /etc/strongswan/ipsec.d/certs/east.crt |
| 12 |
west # |
| 13 |
# confirm that the network is alive |
| 14 |
west # |
| 15 |
../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254 |
| 16 |
destination -I 192.0.1.254 192.0.2.254 is alive |
| 17 |
west # |
| 18 |
# ensure that clear text does not get through |
| 19 |
west # |
| 20 |
iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP |
| 21 |
west # |
| 22 |
iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT |
| 23 |
west # |
| 24 |
# confirm clear text does not get through |
| 25 |
west # |
| 26 |
../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254 |
| 27 |
down |
| 28 |
west # |
| 29 |
../../guestbin/strongswan-start.sh |
| 30 |
west # |
| 31 |
echo "initdone" |
| 32 |
initdone |
| 33 |
west # |
| 34 |
strongswan up westnet-eastnet-ikev2 | grep -v libcurl |
| 35 |
initiating IKE_SA westnet-eastnet-ikev2[1] to 192.1.2.23 |
| 36 |
generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) N(HASH_ALG) N(REDIR_SUP) ] |
| 37 |
sending packet: from 192.1.2.45[500] to 192.1.2.23[500] (XXX bytes) |
| 38 |
received packet: from 192.1.2.23[500] to 192.1.2.45[500] (XXX bytes) |
| 39 |
parsed IKE_SA_INIT response 0 [ SA KE No N(FRAG_SUP) N(NATD_S_IP) N(NATD_D_IP) N(CHDLESS_SUP) CERTREQ ] |
| 40 |
selected proposal: IKE:AES_GCM_16_256/PRF_HMAC_SHA2_512/ECP_256 |
| 41 |
received cert request for "C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, [email protected]" |
| 42 |
authentication of 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=west.testing.libreswan.org, [email protected]' (myself) with RSA signature successful |
| 43 |
establishing CHILD_SA westnet-eastnet-ikev2{1} |
| 44 |
generating IKE_AUTH request 1 [ IDi N(INIT_CONTACT) IDr AUTH SA TSi TSr N(MOBIKE_SUP) N(ADD_4_ADDR) N(EAP_ONLY) N(MSG_ID_SYN_SUP) ] |
| 45 |
sending packet: from 192.1.2.45[4500] to 192.1.2.23[4500] (XXX bytes) |
| 46 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 47 |
parsed IKE_AUTH response 1 [ EF(1/5) ] |
| 48 |
received fragment #1 of 5, waiting for complete IKE message |
| 49 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 50 |
parsed IKE_AUTH response 1 [ EF(2/5) ] |
| 51 |
received fragment #2 of 5, waiting for complete IKE message |
| 52 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 53 |
parsed IKE_AUTH response 1 [ EF(3/5) ] |
| 54 |
received fragment #3 of 5, waiting for complete IKE message |
| 55 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 56 |
parsed IKE_AUTH response 1 [ EF(4/5) ] |
| 57 |
received fragment #4 of 5, waiting for complete IKE message |
| 58 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 59 |
parsed IKE_AUTH response 1 [ EF(5/5) ] |
| 60 |
received fragment #5 of 5, reassembled fragmented IKE message (XXX bytes) |
| 61 |
parsed IKE_AUTH response 1 [ IDr CERT AUTH SA TSi TSr ] |
| 62 |
received end entity cert "C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]" |
| 63 |
using trusted certificate "C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]" |
| 64 |
using trusted ca certificate "C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, [email protected]" |
| 65 |
reached self-signed root ca with a path length of 0 |
| 66 |
checking certificate status of "C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]" |
| 67 |
requesting ocsp status from 'http://nic.testing.libreswan.org:2560' ... |
| 68 |
ocsp request to http://nic.testing.libreswan.org:2560 failed |
| 69 |
ocsp check failed, fallback to crl |
| 70 |
fetching crl from 'http://nic.testing.libreswan.org/revoked.crl' ... |
| 71 |
crl fetching failed |
| 72 |
certificate status is not available |
| 73 |
authentication of 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]' with RSA signature successful |
| 74 |
IKE_SA westnet-eastnet-ikev2[1] established between 192.1.2.45[C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=west.testing.libreswan.org, [email protected]]...192.1.2.23[C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]] |
| 75 |
scheduling reauthentication in XXXs |
| 76 |
maximum IKE_SA lifetime XXXs |
| 77 |
selected proposal: ESP:AES_GCM_16_256/NO_EXT_SEQ |
| 78 |
CHILD_SA westnet-eastnet-ikev2{1} established with SPIs SPISPI_i SPISPI_o and TS 192.0.1.0/24 === 192.0.2.0/24 |
| 79 |
connection 'westnet-eastnet-ikev2' established successfully |
| 80 |
west # |
| 81 |
../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254 |
| 82 |
up |
| 83 |
west # |
| 84 |
# hash algorithm notification should NOT be received |
| 85 |
west # |
| 86 |
grep SIGNATURE_HASH_ALGO /tmp/charon.log | cut -f 2 -d "]" |
| 87 |
west # |
| 88 |
echo done |
| 89 |
done |
| 90 |
west # |
| 91 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-state.sh ; fi |
| 92 |
west # |
| 93 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-policy.sh ; fi |
| 94 |
west # |
| 95 |
# expect state #2, state #1 responded with INVALID_KE |
| 96 |
west # |
| 97 |
if [ -f /var/run/pluto/pluto.pid ]; then grep " authenticated peer " /tmp/pluto.log ; fi |
| 98 |
west # |
| 99 |
if [ -f /var/run/charon.pid -o -f /var/run/strongswan/charon.pid ]; then strongswan status ; fi |
| 100 |
Shunted Connections: |
| 101 |
Bypass LAN 192.0.1.0/24: 192.0.1.0/24 === 192.0.1.0/24 PASS |
| 102 |
Bypass LAN 192.1.2.0/24: 192.1.2.0/24 === 192.1.2.0/24 PASS |
| 103 |
Security Associations (1 up, 0 connecting): |
| 104 |
westnet-eastnet-ikev2[1]: ESTABLISHED XXX second ago, 192.1.2.45[C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=west.testing.libreswan.org, [email protected]]...192.1.2.23[C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, [email protected]] |
| 105 |
westnet-eastnet-ikev2{1}: INSTALLED, TUNNEL, reqid 1, ESP SPIs: SPISPI_i SPISPI_o |
| 106 |
westnet-eastnet-ikev2{1}: 192.0.1.0/24 === 192.0.2.0/24 |
| 107 |
west # |
| 108 |
|