/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254
destination -I 192.0.1.254 192.0.2.254 is alive
west #
 # ensure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 # confirm clear text does not get through
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 # normal case, not sent
west #
 ipsec whack --impair v2-proposal-integ:no
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #1: initiating IKEv2 connection
1v2 "ike,esp=aes_gcm" #1: sent IKE_SA_INIT request
1v2 "ike,esp=aes_gcm" #1: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #1: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #2: established Child SA using #1; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #1: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #2: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its addition
west #
 ipsec whack --impair v2-proposal-integ:allow-none
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #3: initiating IKEv2 connection
002 "ike,esp=aes_gcm" #3: IMPAIR: proposal 1 transform INTEG=NONE included when counting transforms
002 "ike,esp=aes_gcm" #3: IMPAIR: proposal 1 transform INTEG=NONE included when emitting proposal
1v2 "ike,esp=aes_gcm" #3: sent IKE_SA_INIT request
002 "ike,esp=aes_gcm" #3: IMPAIR: proposal 1 transform INTEG=NONE included when counting transforms
002 "ike,esp=aes_gcm" #3: IMPAIR: proposal 1 transform INTEG=NONE included when emitting proposal
1v2 "ike,esp=aes_gcm" #3: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #3: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #4: established Child SA using #3; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #3: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #4: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its exclusion
west #
 ipsec whack --impair v2-proposal-integ:drop-none
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #5: initiating IKEv2 connection
002 "ike,esp=aes_gcm" #5: IMPAIR: proposal 1 transform INTEG=NONE excluded when counting transforms
002 "ike,esp=aes_gcm" #5: IMPAIR: proposal 1 transform INTEG=NONE excluded when emitting proposal
1v2 "ike,esp=aes_gcm" #5: sent IKE_SA_INIT request
002 "ike,esp=aes_gcm" #5: IMPAIR: proposal 1 transform INTEG=NONE excluded when counting transforms
002 "ike,esp=aes_gcm" #5: IMPAIR: proposal 1 transform INTEG=NONE excluded when emitting proposal
1v2 "ike,esp=aes_gcm" #5: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #5: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #6: established Child SA using #5; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #5: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #6: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 ipsec whack --impair v2-proposal-integ:no
west #
 # normal case, not sent
west #
 ipsec whack --impair v2-proposal-dh:no
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #7: initiating IKEv2 connection
1v2 "ike,esp=aes_gcm" #7: sent IKE_SA_INIT request
1v2 "ike,esp=aes_gcm" #7: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #7: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #8: established Child SA using #7; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #7: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #8: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its addition
west #
 ipsec whack --impair v2-proposal-dh:allow-none
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #9: initiating IKEv2 connection
1v2 "ike,esp=aes_gcm" #9: sent IKE_SA_INIT request
002 "ike,esp=aes_gcm" #9: IMPAIR: proposal 1 transform DH=NONE included when counting transforms
002 "ike,esp=aes_gcm" #9: IMPAIR: proposal 1 transform DH=NONE included when emitting proposal
1v2 "ike,esp=aes_gcm" #9: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #9: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #10: established Child SA using #9; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #9: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #10: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its exclusion
west #
 ipsec whack --impair v2-proposal-dh:drop-none
west #
 ../../guestbin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 "ike,esp=aes_gcm": added IKEv2 connection
1v2 "ike,esp=aes_gcm" #11: initiating IKEv2 connection
1v2 "ike,esp=aes_gcm" #11: sent IKE_SA_INIT request
002 "ike,esp=aes_gcm" #11: IMPAIR: proposal 1 transform DH=NONE excluded when counting transforms
002 "ike,esp=aes_gcm" #11: IMPAIR: proposal 1 transform DH=NONE excluded when emitting proposal
1v2 "ike,esp=aes_gcm" #11: sent IKE_AUTH request {cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
003 "ike,esp=aes_gcm" #11: established IKE SA; authenticated using authby=secret and peer ID_FQDN '@east'
004 "ike,esp=aes_gcm" #12: established Child SA using #11; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE DPD=passive}
up
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #11: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
005 "ike,esp=aes_gcm" #12: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 ipsec whack --impair v2-proposal-integ:no
west #
 ipsec stop
Redirecting to: [initsystem]
west #
 # east shows what was sent across the wire; expect two lines for each
west #
 # of the three connections: default (missing); integ=none included;
west #
 # integ=none excluded
west #
 grep 'proposal .* chosen from' /tmp/pluto.log | sed -e 's/SPI=[^;]*/SPI=X/'
west #
 # west shows what came back, expect two lines for each of the three
west #
 # connections: default (missing); integ=none included; integ=none
west #
 # excluded
west #
 grep 'remote accepted' /tmp/pluto.log
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;ESN=ENABLED[first-match]
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;INTEG=NONE;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;INTEG=NONE;ESN=ENABLED[first-match]
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;ESN=ENABLED[first-match]
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;ESN=ENABLED[first-match]
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;DH=NONE;ESN=ENABLED[first-match]
| remote accepted the proposal 1:IKE:ENCR=AES_GCM_C_128;PRF=HMAC_SHA1;DH=MODP2048[first-match]
| remote accepted the proposal 1:ESP:ENCR=AES_GCM_C_128;ESN=ENABLED[first-match]
west #
 
