/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
west #
 # confirm that the network is alive
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
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 #
 ipsec auto --add west-east-delete1
"west-east-delete1": added IKEv2 connection
west #
 ipsec whack --impair suppress_retransmits
west #
 ipsec whack --impair revival
west #
 echo "initdone"
initdone
west #
 ipsec auto --up west-east-delete1
"west-east-delete1" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"west-east-delete1" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"west-east-delete1" #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
"west-east-delete1" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"west-east-delete1" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"west-east-delete1" #2: 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 #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsec whack --trafficstatus
#2: "west-east-delete1", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='@east'
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.0.2.0/24 dst 192.0.1.0/24
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
src 192.0.2.0/24 dst 192.0.1.0/24
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
west #
 ipsec whack --showstates
#1: "west-east-delete1":500 ESTABLISHED_IKE_SA (established IKE SA); REKEY in XXs; REPLACE in XXs; newest; idle;
#2: "west-east-delete1":500 ESTABLISHED_CHILD_SA (established Child SA); REKEY in XXs; REPLACE in XXs; newest; eroute owner; IKE SA #1; idle;
#2: "west-east-delete1" 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=84B ESPout=84B ESPmax=2^63B 
west #
 echo "sleeping a bit.. then deleting child"
sleeping a bit.. then deleting child
west #
 sleep 2
west #
 ipsec whack --deletestate 2
"west-east-delete1" #2: sent INFORMATIONAL request to delete established Child SA using IKE SA #1
"west-east-delete1" #2: connection is supposed to remain up; revival attempt 1 scheduled in 0 seconds
"west-east-delete1" #2: IMPAIR: revival: skip scheduling revival event
"west-east-delete1" #2: ESP traffic information: in=84B out=84B
west #
 sleep 2
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
west #
 ipsec whack --showstates
#1: "west-east-delete1":500 ESTABLISHED_IKE_SA (established IKE SA); REKEY in XXs; REPLACE in XXs; newest; idle;
west #
 echo "sleeping a bit.. then deleting ike"
sleeping a bit.. then deleting ike
west #
 sleep 2
west #
 ipsec whack --deletestate 1
"west-east-delete1" #1: sent INFORMATIONAL request to delete IKE SA
"west-east-delete1" #1: deleting IKE SA (established IKE SA)
west #
 sleep 2
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
west #
 ipsec auto --showstates
west #
 ipsec delete west-east-delete1
west #
 
