/testing/guestbin/swan-prep --hostkeys
Creating NSS database containing host keys
west #
 # confirm that the network is alive
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 #
 # ensure that clear text does not get through
west #
 # ../../guestbin/nftable-westneteastnet-ipsec-only.nft
west #
 # confirm clear text does not get through
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
up UNEXPECTED
# ping -n -c 1  -i 2 -w 1   -I 192.0.1.254 192.0.2.254
PING 192.0.2.254 (192.0.2.254) from 192.0.1.254 : 56(84) bytes of data. 64 bytes from 192.0.2.254: icmp_seq=1 ttl=64 time=0.XXX ms --- 192.0.2.254 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time XXXX rtt min/avg/max/mdev = 0.XXX/0.XXX/0.XXX/0.XXX ms
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 #
 echo "initdone"
initdone
west #
 # show nflog global ipsec-all rules
west #
 nft list ruleset
table inet ipsec-log {
	chain input {
		type filter hook input priority filter; policy accept;
		meta ipsec exists log prefix "all-ipsec-input" group 50
	}
	chain output {
		type filter hook output priority filter; policy accept;
		rt ipsec exists log prefix "all-ipsec-output" group 50
	}
}
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
"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 #
 # 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 #
 # wait for count to reach tcpdump then dump it
west #
 ../../guestbin/tcpdump.sh --wait -i nflog:50 --
reading from file OUTPUT/west.nflog-01-global.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 #
 echo done
done
west #
 ../../guestbin/ipsec-kernel-state.sh
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out action block priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
west #
 ipsec stop
Redirecting to: [initsystem]
west #
 # show no nflog left behind
west #
 nft list ruleset
west #
 
