/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ../../guestbin/wait-until-alive -I 192.1.2.45 192.1.2.23
destination -I 192.1.2.45 192.1.2.23 is alive
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add ipv4-psk-ikev2
"ipv4-psk-ikev2": added oriented IKEv2 connection
west #
 ipsec auto --status | grep iptfs
"ipv4-psk-ikev2":   iptfs: yes; fragmentation: yes; packet-size: 0; max-queue-size: 0; drop-time: 0; init-delay: 0; reorder-window: 0;
west #
 ipsec whack --impair suppress-retransmits
west #
 echo "initdone"
initdone
west #
 ipsec auto --route ipv4-psk-ikev2
west #
 # ping will get eaten
west #
 ../../guestbin/ping-once.sh --fire-and-forget -I 192.1.2.45 192.1.2.23
fired and forgotten
west #
 ipsec _kernel state | grep iptfs
west #
 ip xfrm pol |grep iptfs
west #
 ../../guestbin/ping-once.sh --up -I 192.1.2.45 192.1.2.23
up
west #
 echo done
done
west #
 ipsec _kernel state
src 192.1.2.45 dst 192.1.2.23
	proto esp spi 0xSPISPI reqid REQID mode 5
	replay-window 0 flag af-unspec esn
	aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128
	lastused YYYY-MM-DD HH:MM:SS
	anti-replay esn context:
	 seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX
	 replay_window 0, bitmap-length 0
	dir out
src 192.1.2.23 dst 192.1.2.45
	proto esp spi 0xSPISPI reqid REQID mode 5
	replay-window 0 flag af-unspec esn
	aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128
	lastused YYYY-MM-DD HH:MM:SS
	anti-replay esn context:
	 seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX
	 replay_window 128, bitmap-length 4
	 00000000 00000000 00000000 XXXXXXXX 
	dir in
src 192.1.2.45 dst 192.1.2.23
	proto esp spi 0x00000000 reqid 0 mode transport
	replay-window 0 
	dir out
	sel src 192.1.2.45/32 dst 192.1.2.23/32 proto icmp type 8 code 0 dev eth1 
west #
 ipsec _kernel policy
src 192.1.2.23/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode 5
src 192.1.2.23/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode 5
src 192.1.2.45/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode 5
west #
 grep -e '^[^|].*IPTFS' /tmp/pluto.log
kernel: IPTFS SA supported by kernel
"ipv4-psk-ikev2" #2: initiator established Child SA using #1; IPsec tunnel [192.1.2.45/32===192.1.2.23/32] {ESP/ESN/IPTFS=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256 DPD=passive}
west #
 grep -e '^[^|].*USE_AGGFRAG' /tmp/pluto.log
"ipv4-psk-ikev2" #1: processing IKE_AUTH response from 192.1.2.23:UDP/500 containing SK{IDr,AUTH,SA,TSi,TSr,N(USE_AGGFRAG)} reassembled from N fragments
west #
