/testing/guestbin/swan-prep
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec whack --impair revival
west #
 ipsec whack --impair suppress_retransmits
west #
 ipsec whack --impair block_inbound:yes
IMPAIR: block all inbound messages: yes
west #
 ipsec auto --add east-west
"east-west": added IKEv2 connection
west #
 # east initiated sending an IKE_SA_INIT request;
west #
 # hold east's IKE_SA_INIT request as inbound message 1
west #
 ../../guestbin/wait-for-inbound.sh 1
packet from 192.1.2.23:500: IMPAIR: blocking inbound message 1
west #
 # on west, initiate creating west's IKE #1;
west #
 # hold east's IKE_SA_INIT response as inbound message 2
west #
 ipsec up --asynchronous east-west
"east-west" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
west #
 ../../guestbin/wait-for-pluto.sh '^".*#1: sent IKE_SA_INIT request'
"east-west" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
west #
 ../../guestbin/wait-for-inbound.sh 2
packet from 192.1.2.23:500: IMPAIR: blocking inbound message 2
west #
 # on west, respond to east's IKE_SA_INIT request (message 1) creating
west #
 # east's IKE SA #2;
west #
 # hold east's IKE_AUTH request as inbound message 3
west #
 ipsec whack --impair drip_inbound:1
IMPAIR: start processing inbound drip packet 1
IMPAIR: stop processing inbound drip packet 1
west #
 ../../guestbin/wait-for-pluto.sh '^".*#2: sent IKE_SA_INIT'
"east-west" #2: sent IKE_SA_INIT (or IKE_INTERMEDIATE) response {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
west #
 ../../guestbin/wait-for-inbound.sh 3
packet from 192.1.2.23:500: IMPAIR: blocking inbound message 3
west #
 # on west, process east's IKE_SA_INIT response (message 2);
west #
 # establish west's IKE SA #1; and create west's Child SA #3
west #
 # hold east's IKE_AUTH response as inbound message 4
west #
 ipsec whack --impair drip_inbound:2
IMPAIR: start processing inbound drip packet 2
IMPAIR: stop processing inbound drip packet 2
west #
 ../../guestbin/wait-for.sh --match '^".*#1: sent IKE_AUTH request'  -- cat /tmp/pluto.log
"east-west" #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=DH19}, initiating IKE_AUTH
"east-west" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
west #
 ../../guestbin/wait-for-inbound.sh 4
packet from 192.1.2.23:500: IMPAIR: blocking inbound message 4
west #
 # on west, process east's IKE_SA_AUTH response (message 4)
west #
 # establish west's Child SA #3
west #
 ipsec whack --impair drip_inbound:4
IMPAIR: start processing inbound drip packet 4
IMPAIR: stop processing inbound drip packet 4
west #
 ../../guestbin/wait-for-pluto.sh 'established Child SA using #1'
"east-west" #3: initiator established Child SA using #1; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 # on west, process east's IKE_SA_AUTH request (message 3)
west #
 # establish east's IKE SA #2 and Child SA #4
west #
 ipsec whack --impair drip_inbound:3
IMPAIR: start processing inbound drip packet 3
IMPAIR: stop processing inbound drip packet 3
west #
 ../../guestbin/wait-for.sh --match 'established Child SA using #2'  -- cat /tmp/pluto.log
"east-west" #4: responder established Child SA using #2; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 ipsec showstates
#1: "east-west":500 STATE_V2_ESTABLISHED_IKE_SA (established IKE SA); REKEY in XXs; REPLACE in XXs; idle;
#2: "east-west":500 STATE_V2_ESTABLISHED_IKE_SA (established IKE SA); REKEY in XXs; REPLACE in XXs; newest; idle;
#3: "east-west":500 STATE_V2_ESTABLISHED_CHILD_SA (established Child SA); REKEY in XXs; REPLACE in XXs; IKE SA #1; idle;
#3: "east-west" esp.ESPSPIi@192.1.2.23 esp.ESPSPIi@192.1.2.45 tun.0@192.1.2.23 tun.0@192.1.2.45 Traffic: ESPin=0B ESPout=0B ESPmax=2^63B 
#4: "east-west":500 STATE_V2_ESTABLISHED_CHILD_SA (established Child SA); REKEY in XXs; REPLACE in XXs; newest; eroute owner; IKE SA #2; idle;
#4: "east-west" esp.ESPSPIi@192.1.2.23 esp.ESPSPIi@192.1.2.45 tun.0@192.1.2.23 tun.0@192.1.2.45 Traffic: ESPin=0B ESPout=0B ESPmax=2^63B 
west #
 ipsec trafficstatus
#3: "east-west", type=ESP, add_time=1234567890, inBytes=0, outBytes=0, maxBytes=2^63B, id='@east'
#4: "east-west", type=ESP, add_time=1234567890, inBytes=0, outBytes=0, maxBytes=2^63B, id='@east'
west #
 
