/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ../../pluto/bin/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 #
 ../../pluto/bin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ipsec start
Redirecting to: [initsystem]
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 # normal case, not sent
west #
 ipsec whack --impair v2-proposal-integ:no
west #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #2: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #1: authenticated using authby=secret
002 "ike,esp=aes_gcm" #2: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #2: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #2: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #2: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #1: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its addition
west #
 ipsec whack --impair v2-proposal-integ:allow-none
west #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #4: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #3: authenticated using authby=secret
002 "ike,esp=aes_gcm" #4: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #4: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #4: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #4: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #3: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its exclusion
west #
 ipsec whack --impair v2-proposal-integ:drop-none
west #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #6: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #5: authenticated using authby=secret
002 "ike,esp=aes_gcm" #6: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #6: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #6: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #6: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #5: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
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 #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #8: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #7: authenticated using authby=secret
002 "ike,esp=aes_gcm" #8: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #8: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #8: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #8: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #7: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its addition
west #
 ipsec whack --impair v2-proposal-dh:allow-none
west #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #10: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #9: authenticated using authby=secret
002 "ike,esp=aes_gcm" #10: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #10: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #10: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #10: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #9: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
002 "ike,esp=aes_gcm": terminating SAs using this connection
west #
 # force its exclusion
west #
 ipsec whack --impair v2-proposal-dh:drop-none
west #
 ../bin/libreswan-up-down.sh ike,esp=aes_gcm  -I 192.0.1.254 192.0.2.254
002 added IKEv2 connection "ike,esp=aes_gcm"
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 {auth=IKEv2 cipher=AES_GCM_16_128 integ=n/a prf=HMAC_SHA1 group=MODP2048}
002 "ike,esp=aes_gcm" #12: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "ike,esp=aes_gcm" #11: authenticated using authby=secret
002 "ike,esp=aes_gcm" #12: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "ike,esp=aes_gcm" #12: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_128-NONE NATOA=none NATD=none DPD=passive}
destination -I 192.0.1.254 192.0.2.254 is alive
002 "ike,esp=aes_gcm": terminating SAs using this connection
002 "ike,esp=aes_gcm" #12: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "ike,esp=aes_gcm" #12: ESP traffic information: in=84B out=84B
002 "ike,esp=aes_gcm" #11: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
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=DISABLED[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=DISABLED[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=DISABLED[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=DISABLED[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=DISABLED[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=DISABLED[first-match]
west #
 ../bin/check-for-core.sh
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi
west #
 
