/testing/guestbin/swan-prep --hostkeys
Creating NSS database containing host keys
west #
 # confirm that the network is alive
west #
 ## ../../guestbin/ping-once.sh --up -I 192.1.2.45 192.1.2.23
west #
 # ensure that clear text does not get through
west #
 ## iptables -A INPUT -i eth0 -s 192.1.2.23/32 -p icmp -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 --up -I 192.1.2.45 192.1.2.23
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add west-east
"west-east": added IKEv2 connection
west #
 ipsec auto --add west-east-passthrough
"west-east-passthrough": added passthrough connection
west #
 ipsec auto --route west-east-passthrough
west #
 ipsec whack --impair suppress_retransmits
west #
 echo "initdone"
initdone
west #
 ipsec auto --up west-east
"west-east" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"west-east" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"west-east" #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" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500 with digital-signature and FQDN '@west'; Child SA #2 {ESP <0xESPESP}
"west-east" #1: initiator established IKE SA; authenticated peer using preloaded certificate '@east' and 2nnn-bit RSASSA-PSS with SHA2_512 digital signature
"west-east" #2: initiator established Child SA using #1; IPsec tunnel [192.1.2.45/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 # encrypted
west #
 ../../guestbin/ping-once.sh --up -I 192.1.2.45 192.1.2.23
up
west #
 # plaintext
west #
 echo "PLAINTEXT FROM WEST" | socat - TCP:192.1.2.23:7,bind=192.1.2.45,sourceport=7
PLAINTEXT FROM WEST
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 tunnel
	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
src 192.1.2.23 dst 192.1.2.45
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	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 
west #
 ipsec _kernel policy
src 192.1.2.23/32 dst 192.1.2.45/32 proto tcp sport 7 dport 7
	dir fwd priority PRIORITY ptype main
src 192.1.2.23/32 dst 192.1.2.45/32 proto tcp sport 7 dport 7
	dir in priority PRIORITY ptype main
src 192.1.2.45/32 dst 192.1.2.23/32 proto tcp sport 7 dport 7
	dir out priority PRIORITY ptype main
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 tunnel
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 tunnel
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 tunnel
west #
