| 1 |
/testing/guestbin/swan-prep --userland strongswan |
| 2 |
west # |
| 3 |
# confirm that the network is alive |
| 4 |
west # |
| 5 |
../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254 |
| 6 |
destination -I 192.0.1.254 192.0.2.254 is alive |
| 7 |
west # |
| 8 |
# ensure that clear text does not get through |
| 9 |
west # |
| 10 |
iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP |
| 11 |
west # |
| 12 |
iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT |
| 13 |
west # |
| 14 |
# confirm clear text does not get through |
| 15 |
west # |
| 16 |
../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254 |
| 17 |
down |
| 18 |
west # |
| 19 |
../../guestbin/strongswan-start.sh |
| 20 |
west # |
| 21 |
echo "initdone" |
| 22 |
initdone |
| 23 |
west # |
| 24 |
strongswan up westnet-eastnet-ikev2 |
| 25 |
initiating IKE_SA westnet-eastnet-ikev2[1] to 192.1.2.23 |
| 26 |
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) ] |
| 27 |
sending packet: from 192.1.2.45[500] to 192.1.2.23[500] (XXX bytes) |
| 28 |
received packet: from 192.1.2.23[500] to 192.1.2.45[500] (XXX bytes) |
| 29 |
parsed IKE_SA_INIT response 0 [ SA KE No N(FRAG_SUP) N(NATD_S_IP) N(NATD_D_IP) N(CHDLESS_SUP) ] |
| 30 |
selected proposal: IKE:AES_GCM_16_256/PRF_HMAC_SHA2_512/ECP_256 |
| 31 |
authentication of 'west' (myself) with pre-shared key |
| 32 |
establishing CHILD_SA westnet-eastnet-ikev2{1} |
| 33 |
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) ] |
| 34 |
sending packet: from 192.1.2.45[4500] to 192.1.2.23[4500] (XXX bytes) |
| 35 |
received packet: from 192.1.2.23[4500] to 192.1.2.45[4500] (XXX bytes) |
| 36 |
parsed IKE_AUTH response 1 [ IDr AUTH SA TSi TSr ] |
| 37 |
authentication of 'east' with pre-shared key successful |
| 38 |
IKE_SA westnet-eastnet-ikev2[1] established between 192.1.2.45[west]...192.1.2.23[east] |
| 39 |
scheduling reauthentication in XXXs |
| 40 |
maximum IKE_SA lifetime XXXs |
| 41 |
selected proposal: AH:HMAC_SHA2_512_256/NO_EXT_SEQ |
| 42 |
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 |
| 43 |
connection 'westnet-eastnet-ikev2' established successfully |
| 44 |
west # |
| 45 |
../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254 |
| 46 |
up |
| 47 |
west # |
| 48 |
# cannot use ../../guestbin/ipsec-kernel-state.sh |
| 49 |
west # |
| 50 |
../../guestbin/ipsec-kernel-policy.sh for strongswan |
| 51 |
grep: strongswan: No such file or directory |
| 52 |
west # |
| 53 |
../../guestbin/ipsec-kernel-state.sh |
| 54 |
src 192.1.2.45 dst 192.1.2.23 |
| 55 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 56 |
replay-window 0 flag af-unspec align4 |
| 57 |
auth-trunc hmac(sha512) 0xHASHKEY 256 |
| 58 |
lastused YYYY-MM-DD HH:MM:SS |
| 59 |
src 192.1.2.23 dst 192.1.2.45 |
| 60 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 61 |
replay-window 32 flag af-unspec align4 |
| 62 |
auth-trunc hmac(sha512) 0xHASHKEY 256 |
| 63 |
lastused YYYY-MM-DD HH:MM:SS |
| 64 |
west # |
| 65 |
ip xfrm policy |
| 66 |
src 192.0.1.0/24 dst 192.0.2.0/24 |
| 67 |
dir out priority PRIORITY ptype main |
| 68 |
tmpl src 192.1.2.45 dst 192.1.2.23 |
| 69 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 70 |
src 192.0.2.0/24 dst 192.0.1.0/24 |
| 71 |
dir fwd priority PRIORITY ptype main |
| 72 |
tmpl src 192.1.2.23 dst 192.1.2.45 |
| 73 |
proto ah reqid REQID mode tunnel |
| 74 |
src 192.0.2.0/24 dst 192.0.1.0/24 |
| 75 |
dir in priority PRIORITY ptype main |
| 76 |
tmpl src 192.1.2.23 dst 192.1.2.45 |
| 77 |
proto ah reqid REQID mode tunnel |
| 78 |
src 192.1.2.0/24 dst 192.1.2.0/24 |
| 79 |
dir fwd priority PRIORITY ptype main |
| 80 |
src 192.1.2.0/24 dst 192.1.2.0/24 |
| 81 |
dir in priority PRIORITY ptype main |
| 82 |
src 192.1.2.0/24 dst 192.1.2.0/24 |
| 83 |
dir out priority PRIORITY ptype main |
| 84 |
src 192.0.1.0/24 dst 192.0.1.0/24 |
| 85 |
dir fwd priority PRIORITY ptype main |
| 86 |
src 192.0.1.0/24 dst 192.0.1.0/24 |
| 87 |
dir in priority PRIORITY ptype main |
| 88 |
src 192.0.1.0/24 dst 192.0.1.0/24 |
| 89 |
dir out priority PRIORITY ptype main |
| 90 |
src 0.0.0.0/0 dst 0.0.0.0/0 |
| 91 |
socket in priority 0 ptype main |
| 92 |
src 0.0.0.0/0 dst 0.0.0.0/0 |
| 93 |
socket out priority 0 ptype main |
| 94 |
src 0.0.0.0/0 dst 0.0.0.0/0 |
| 95 |
socket in priority 0 ptype main |
| 96 |
src 0.0.0.0/0 dst 0.0.0.0/0 |
| 97 |
socket out priority 0 ptype main |
| 98 |
src ::/0 dst ::/0 |
| 99 |
socket in priority 0 ptype main |
| 100 |
src ::/0 dst ::/0 |
| 101 |
socket out priority 0 ptype main |
| 102 |
src ::/0 dst ::/0 |
| 103 |
socket in priority 0 ptype main |
| 104 |
src ::/0 dst ::/0 |
| 105 |
socket out priority 0 ptype main |
| 106 |
west # |
| 107 |
echo done |
| 108 |
done |
| 109 |
west # |
| 110 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-state.sh ; fi |
| 111 |
west # |
| 112 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-policy.sh ; fi |
| 113 |
west # |
| 114 |
if [ -f /var/run/charon.pid -o -f /var/run/strongswan/charon.pid ]; then strongswan status ; fi |
| 115 |
Shunted Connections: |
| 116 |
Bypass LAN 192.0.1.0/24: 192.0.1.0/24 === 192.0.1.0/24 PASS |
| 117 |
Bypass LAN 192.1.2.0/24: 192.1.2.0/24 === 192.1.2.0/24 PASS |
| 118 |
Security Associations (1 up, 0 connecting): |
| 119 |
westnet-eastnet-ikev2[1]: ESTABLISHED XXX second ago, 192.1.2.45[west]...192.1.2.23[east] |
| 120 |
westnet-eastnet-ikev2{1}: INSTALLED, TUNNEL, reqid 1, AH SPIs: SPISPI_i SPISPI_o |
| 121 |
westnet-eastnet-ikev2{1}: 192.0.1.0/24 === 192.0.2.0/24 |
| 122 |
west # |
| 123 |
|