../../guestbin/netbsd-prep.sh
west.conf -> PATH/etc/ipsec.conf
west.secrets -> PATH/etc/ipsec.secrets
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]
pluto(ok)
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec whack --impair suppress-retransmits
west #
 ipsec auto --add eastnet-westnet-ikev2
002 "eastnet-westnet-ikev2": added IKEv2 connection
west #
 echo "initdone"
initdone
west #
 ipsec auto --up eastnet-westnet-ikev2
1v2 "eastnet-westnet-ikev2" #1: initiating IKEv2 connection
1v2 "eastnet-westnet-ikev2" #1: sent IKE_SA_INIT request to 192.1.2.23:500
1v2 "eastnet-westnet-ikev2" #1: sent IKE_AUTH request {cipher=AES_CBC_256 integ=HMAC_SHA2_256_128 prf=HMAC_SHA2_256 group=DH31}
003 "eastnet-westnet-ikev2" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
004 "eastnet-westnet-ikev2" #2: initiator established Child SA using #1; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=NULL-HMAC_SHA2_256_128 DPD=passive}
west #
 ipsecctl -v -v -k -s all
FLOWS:
@0 flow esp in from 192.0.2.0/24 to 192.0.1.0/24 local 192.1.2.45 peer 192.1.2.23 type require
@1 flow esp out from 192.0.1.0/24 to 192.0.2.0/24 local 192.1.2.45 peer 192.1.2.23 type require
SAD:
@0 esp tunnel from 192.1.2.23 to 192.1.2.45 spi 0xSPISPI auth hmac-sha2-256 enc null \
	authkey 0xX...X \
	enckey 0x
	sa: spi 0xSPISPI auth hmac-sha2-256 enc null
		state mature replay 8 flags 0x404<tunnel,esn>
	lifetime_cur: alloc 0 bytes 0 add NNNNNNNNNN first 0
	lifetime_hard: alloc 0 bytes 0 add 28800 first 0
	lifetime_soft: alloc 0 bytes 0 add NNNN first 0
	address_src: 192.1.2.23
	address_dst: 192.1.2.45
	key_auth: bits 256: X...X
	key_encrypt: bits 0: 
	counter: 
		0 input packets
		0 output packets
		0 input bytes
		0 output bytes
		0 input bytes, decompressed
		0 output bytes, uncompressed
		0 packets dropped on input
		0 packets dropped on output
	replay: rpl 1
@0 esp tunnel from 192.1.2.45 to 192.1.2.23 spi 0xSPISPI auth hmac-sha2-256 enc null \
	authkey 0xX...X \
	enckey 0x
	sa: spi 0xSPISPI auth hmac-sha2-256 enc null
		state mature replay 8 flags 0x404<tunnel,esn>
	lifetime_cur: alloc 0 bytes 0 add NNNNNNNNNN first 0
	lifetime_hard: alloc 0 bytes 0 add 28800 first 0
	lifetime_soft: alloc 0 bytes 0 add NNNN first 0
	address_src: 192.1.2.45
	address_dst: 192.1.2.23
	key_auth: bits 256: X...X
	key_encrypt: bits 0: 
	counter: 
		0 input packets
		0 output packets
		0 input bytes
		0 output bytes
		0 input bytes, decompressed
		0 output bytes, uncompressed
		0 packets dropped on input
		0 packets dropped on output
	replay: rpl 1
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsecctl -v -v -k -s all
FLOWS:
@0 flow esp in from 192.0.2.0/24 to 192.0.1.0/24 local 192.1.2.45 peer 192.1.2.23 type require
@1 flow esp out from 192.0.1.0/24 to 192.0.2.0/24 local 192.1.2.45 peer 192.1.2.23 type require
SAD:
@0 esp tunnel from 192.1.2.23 to 192.1.2.45 spi 0xSPISPI auth hmac-sha2-256 enc null \
	authkey 0xX...X \
	enckey 0x
	sa: spi 0xSPISPI auth hmac-sha2-256 enc null
		state mature replay 8 flags 0x404<tunnel,esn>
	lifetime_cur: alloc 0 bytes 88 add NNNNNNNNNN first NNNNNNNNNN
	lifetime_hard: alloc 0 bytes 0 add 28800 first 0
	lifetime_soft: alloc 0 bytes 0 add NNNN first 0
	address_src: 192.1.2.23
	address_dst: 192.1.2.45
	key_auth: bits 256: X...X
	key_encrypt: bits 0: 
	lifetime_lastuse: alloc 0 bytes 0 add 0 first NNNNNNNNNN
	counter: 
		1 input packet
		0 output packets
		220 input bytes
		0 output bytes
		104 input bytes, decompressed
		0 output bytes, uncompressed
		0 packets dropped on input
		0 packets dropped on output
	replay: rpl 1
@0 esp tunnel from 192.1.2.45 to 192.1.2.23 spi 0xSPISPI auth hmac-sha2-256 enc null \
	authkey 0xX...X \
	enckey 0x
	sa: spi 0xSPISPI auth hmac-sha2-256 enc null
		state mature replay 8 flags 0x404<tunnel,esn>
	lifetime_cur: alloc 0 bytes 84 add NNNNNNNNNN first NNNNNNNNNN
	lifetime_hard: alloc 0 bytes 0 add 28800 first 0
	lifetime_soft: alloc 0 bytes 0 add NNNN first 0
	address_src: 192.1.2.45
	address_dst: 192.1.2.23
	key_auth: bits 256: X...X
	key_encrypt: bits 0: 
	lifetime_lastuse: alloc 0 bytes 0 add 0 first NNNNNNNNNN
	counter: 
		0 input packets
		1 output packet
		0 input bytes
		132 output bytes
		0 input bytes, decompressed
		104 output bytes, uncompressed
		0 packets dropped on input
		0 packets dropped on output
	replay: rpl 2
west #
 ipsec trafficstatus
006 #2: "eastnet-westnet-ikev2", type=ESP, add_time=1234567890, id='@east'
west #
 echo done
done
west #
 
