| 1 |
/testing/guestbin/swan-prep --nokeys |
| 2 |
Creating empty NSS database |
| 3 |
west # |
| 4 |
# confirm that the network is alive |
| 5 |
west # |
| 6 |
../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254 |
| 7 |
destination -I 192.0.1.254 192.0.2.254 is alive |
| 8 |
west # |
| 9 |
# ensure that clear text does not get through |
| 10 |
west # |
| 11 |
iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP |
| 12 |
west # |
| 13 |
iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT |
| 14 |
west # |
| 15 |
# confirm clear text does not get through |
| 16 |
west # |
| 17 |
../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254 |
| 18 |
down |
| 19 |
west # |
| 20 |
ipsec start |
| 21 |
Redirecting to: [initsystem] |
| 22 |
west # |
| 23 |
../../guestbin/wait-until-pluto-started |
| 24 |
west # |
| 25 |
echo "initdone" |
| 26 |
initdone |
| 27 |
west # |
| 28 |
../../guestbin/libreswan-up-down.sh ah=md5 -I 192.0.1.254 192.0.2.254 |
| 29 |
"ah=md5": added IKEv2 connection |
| 30 |
"ah=md5" #1: initiating IKEv2 connection to 192.1.2.23 using UDP |
| 31 |
"ah=md5" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500 |
| 32 |
"ah=md5" #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_CBC_128 integ=HMAC_SHA1_96 prf=HMAC_SHA1 group=MODP2048}, initiating IKE_AUTH |
| 33 |
"ah=md5" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500 |
| 34 |
"ah=md5" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east' |
| 35 |
"ah=md5" #2: initiator established Child SA using #1; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {AH=>0xAHAH <0xAHAH xfrm=HMAC_MD5_96 DPD=passive} |
| 36 |
up |
| 37 |
"ah=md5": initiating delete of connection's IKE SA #1 (and Child SA #2) |
| 38 |
"ah=md5" #1: sent INFORMATIONAL request to delete IKE SA |
| 39 |
"ah=md5" #2: AH traffic information: in=84B out=84B |
| 40 |
"ah=md5" #1: deleting IKE SA (established IKE SA) |
| 41 |
west # |
| 42 |
../../guestbin/libreswan-up-down.sh ah=sha1 -I 192.0.1.254 192.0.2.254 |
| 43 |
"ah=sha1": added IKEv2 connection |
| 44 |
"ah=sha1" #3: initiating IKEv2 connection to 192.1.2.23 using UDP |
| 45 |
"ah=sha1" #3: sent IKE_SA_INIT request to 192.1.2.23:UDP/500 |
| 46 |
"ah=sha1" #3: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_CBC_128 integ=HMAC_SHA1_96 prf=HMAC_SHA1 group=MODP2048}, initiating IKE_AUTH |
| 47 |
"ah=sha1" #3: sent IKE_AUTH request to 192.1.2.23:UDP/500 |
| 48 |
"ah=sha1" #3: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east' |
| 49 |
"ah=sha1" #4: initiator established Child SA using #3; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {AH=>0xAHAH <0xAHAH xfrm=HMAC_SHA1_96 DPD=passive} |
| 50 |
up |
| 51 |
"ah=sha1": initiating delete of connection's IKE SA #3 (and Child SA #4) |
| 52 |
"ah=sha1" #3: sent INFORMATIONAL request to delete IKE SA |
| 53 |
"ah=sha1" #4: AH traffic information: in=84B out=84B |
| 54 |
"ah=sha1" #3: deleting IKE SA (established IKE SA) |
| 55 |
west # |
| 56 |
# Test rekey |
| 57 |
west # |
| 58 |
ipsec auto --add ah=sha1 |
| 59 |
"ah=sha1": added IKEv2 connection |
| 60 |
west # |
| 61 |
ipsec auto --up ah=sha1 |
| 62 |
"ah=sha1" #5: initiating IKEv2 connection to 192.1.2.23 using UDP |
| 63 |
"ah=sha1" #5: sent IKE_SA_INIT request to 192.1.2.23:UDP/500 |
| 64 |
"ah=sha1" #5: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_CBC_128 integ=HMAC_SHA1_96 prf=HMAC_SHA1 group=MODP2048}, initiating IKE_AUTH |
| 65 |
"ah=sha1" #5: sent IKE_AUTH request to 192.1.2.23:UDP/500 |
| 66 |
"ah=sha1" #5: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east' |
| 67 |
"ah=sha1" #6: initiator established Child SA using #5; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {AH=>0xAHAH <0xAHAH xfrm=HMAC_SHA1_96 DPD=passive} |
| 68 |
west # |
| 69 |
../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254 |
| 70 |
up |
| 71 |
west # |
| 72 |
sleep 1 |
| 73 |
west # |
| 74 |
ipsec auto --up ah=sha1 |
| 75 |
"ah=sha1" #7: initiating Child SA using IKE SA #5 |
| 76 |
"ah=sha1" #7: sent CREATE_CHILD_SA request to create Child SA using IKE SA #5 |
| 77 |
"ah=sha1" #7: initiator established Child SA using #5; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {AH=>0xAHAH <0xAHAH xfrm=HMAC_SHA1_96 DPD=passive} |
| 78 |
west # |
| 79 |
sleep 1 |
| 80 |
west # |
| 81 |
../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254 |
| 82 |
up |
| 83 |
west # |
| 84 |
# since bofh AH tunnels are still there, check if they all got traffic, meaning new ones was used |
| 85 |
west # |
| 86 |
# use weird spacing to avoid sanitizer |
| 87 |
west # |
| 88 |
ip xfrm s | grep anti-replay |
| 89 |
anti-replay esn context: |
| 90 |
anti-replay esn context: |
| 91 |
west # |
| 92 |
echo done |
| 93 |
done |
| 94 |
west # |
| 95 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-state.sh ; fi |
| 96 |
src 192.1.2.45 dst 192.1.2.23 |
| 97 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 98 |
replay-window 0 flag af-unspec align4 |
| 99 |
auth-trunc hmac(sha1) 0xHASHKEY 96 |
| 100 |
lastused YYYY-MM-DD HH:MM:SS |
| 101 |
src 192.1.2.23 dst 192.1.2.45 |
| 102 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 103 |
replay-window 0 flag af-unspec align4 |
| 104 |
auth-trunc hmac(sha1) 0xHASHKEY 96 |
| 105 |
lastused YYYY-MM-DD HH:MM:SS |
| 106 |
anti-replay esn context: |
| 107 |
seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX |
| 108 |
replay_window 128, bitmap-length 4 |
| 109 |
00000000 00000000 00000000 XXXXXXXX |
| 110 |
src 192.1.2.45 dst 192.1.2.23 |
| 111 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 112 |
replay-window 0 flag af-unspec align4 |
| 113 |
auth-trunc hmac(sha1) 0xHASHKEY 96 |
| 114 |
lastused YYYY-MM-DD HH:MM:SS |
| 115 |
src 192.1.2.23 dst 192.1.2.45 |
| 116 |
proto ah spi 0xSPISPI reqid REQID mode tunnel |
| 117 |
replay-window 0 flag af-unspec align4 |
| 118 |
auth-trunc hmac(sha1) 0xHASHKEY 96 |
| 119 |
lastused YYYY-MM-DD HH:MM:SS |
| 120 |
anti-replay esn context: |
| 121 |
seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX |
| 122 |
replay_window 128, bitmap-length 4 |
| 123 |
00000000 00000000 00000000 XXXXXXXX |
| 124 |
west # |
| 125 |
if [ -f /var/run/pluto/pluto.pid ]; then ../../guestbin/ipsec-kernel-policy.sh ; fi |
| 126 |
src 192.0.1.0/24 dst 192.0.2.0/24 |
| 127 |
dir out priority PRIORITY ptype main |
| 128 |
tmpl src 192.1.2.45 dst 192.1.2.23 |
| 129 |
proto ah reqid REQID mode tunnel |
| 130 |
src 192.0.2.0/24 dst 192.0.1.0/24 |
| 131 |
dir fwd priority PRIORITY ptype main |
| 132 |
tmpl src 192.1.2.23 dst 192.1.2.45 |
| 133 |
proto ah reqid REQID mode tunnel |
| 134 |
src 192.0.2.0/24 dst 192.0.1.0/24 |
| 135 |
dir in priority PRIORITY ptype main |
| 136 |
tmpl src 192.1.2.23 dst 192.1.2.45 |
| 137 |
proto ah reqid REQID mode tunnel |
| 138 |
west # |
| 139 |
if [ -f /var/run/charon.pid -o -f /var/run/strongswan/charon.pid ]; then strongswan statusall ; fi |
| 140 |
west # |
| 141 |
|