/testing/guestbin/swan-prep --hostkeys
Creating NSS database containing host keys
west #
 ../../guestbin/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 #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add westnet-eastnet-ikev2
"westnet-eastnet-ikev2": added IKEv2 connection
west #
 ipsec whack --impair suppress_retransmits
west #
 echo "initdone"
initdone
west #
 nft list ruleset
west #
 ipsec auto --up westnet-eastnet-ikev2
"westnet-eastnet-ikev2" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"westnet-eastnet-ikev2" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"westnet-eastnet-ikev2" #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
"westnet-eastnet-ikev2" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500 with digital-signature and FQDN '@west'; Child SA #2 {ESP <0xESPESP}
"westnet-eastnet-ikev2" #1: initiator established IKE SA; authenticated peer using preloaded certificate '@east' and 2nnn-bit RSASSA-PSS with SHA2_512 digital signature
"westnet-eastnet-ikev2" #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 #
 nft list ruleset
table inet ipsec-log {
	chain input {
		type filter hook input priority filter; policy accept;
		ipsec in reqid REQID ip saddr 192.0.2.0/24 ip daddr 192.0.1.0/24 counter packets 0 bytes 0 log group 50
	}
	chain output {
		type filter hook output priority filter; policy accept;
		ipsec out reqid REQID ip saddr 192.0.1.0/24 ip daddr 192.0.2.0/24 counter packets 0 bytes 0 log group 50
	}
}
west #
 # suppress job monitoring; specify packet count
west #
 ../../guestbin/tcpdump.sh --start -c 4 -i nflog:50
tcpdump started
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsec auto --down westnet-eastnet-ikev2
"westnet-eastnet-ikev2": initiating delete of connection's IKE SA #1 (and Child SA #2)
"westnet-eastnet-ikev2" #1: sent INFORMATIONAL request to delete IKE SA
"westnet-eastnet-ikev2" #2: ESP traffic information: in=168B out=168B
"westnet-eastnet-ikev2" #1: deleting IKE SA (established IKE SA)
west #
 # wait for count to reach tcpdump then dump it
west #
 ../../guestbin/tcpdump.sh --wait -i nflog:50 --
reading from file OUTPUT/west.nflog-02-conn-nftables.nflog.50.tcpdump.pcap, link-type NFLOG (Linux netfilter log messages)
IP 192.0.1.254 > 192.0.2.254: ICMP echo request, id XXXX, seq 1, length 64
IP 192.0.2.254 > 192.0.1.254: ICMP echo reply, id XXXX, seq 1, length 64
IP 192.0.1.254 > 192.0.2.254: ICMP echo request, id XXXX, seq 1, length 64
IP 192.0.2.254 > 192.0.1.254: ICMP echo reply, id XXXX, seq 1, length 64
west #
 # expect no nftables rulese
west #
 nft list ruleset
west #
 echo done
done
west #
 ipsec _kernel state
west #
 ipsec _kernel policy
west #
 nft list ruleset
west #
 ipsec stop
Redirecting to: [initsystem]
west #
 # show no nflog left behind
west #
 nft list ruleset
west #
