/testing/guestbin/swan-prep --x509
Preparing X.509 files
road #
 ipsec certutil -D -n road
road #
 ipsec certutil -D -n east
road #
 cp road-ikev2-oe.conf /etc/ipsec.d/ikev2-oe.conf
road #
 cp policies/* /etc/ipsec.d/policies/
road #
 echo "192.1.3.128/27"  >> /etc/ipsec.d/policies/private-or-clear
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ipsec whack --impair suppress_retransmits
road #
 # give OE policies time to load
road #
 ../../guestbin/wait-for.sh --match 'loaded 10' -- ipsec auto --status
Total IPsec connections: loaded 10, active 0
road #
 echo "initdone"
initdone
road #
 # one packet, which gets eaten by XFRM, so east does not initiate
road #
 ../../guestbin/ping-once.sh --down -I 192.1.3.209 192.1.3.130
down
road #
 # wait on OE IKE negotiation
road #
 ../../guestbin/wait-for.sh --match private-or-clear -- ipsec trafficstatus
#2: "private-or-clear#192.1.3.128/27"[1] ...192.1.3.130, type=ESP, add_time=1234567890, inBytes=0, outBytes=0, maxBytes=2^63B, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org'
road #
 # ping should succeed through tunnel
road #
 ../../guestbin/ping-once.sh --up -I 192.1.3.209 192.1.3.130
up
road #
 # should show established tunnel and no bare shunts
road #
 ipsec whack --trafficstatus
#2: "private-or-clear#192.1.3.128/27"[1] ...192.1.3.130, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org'
road #
 ipsec whack --shuntstatus
Bare Shunt list:
 
road #
 echo done
done
road #
 # A tunnel should have established with non-zero byte counters
road #
 hostname | grep nic > /dev/null || ipsec trafficstatus
#2: "private-or-clear#192.1.3.128/27"[1] ...192.1.3.130, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org'
road #
 ../../guestbin/ipsec-kernel-state.sh
src 192.1.3.209 dst 192.1.3.130
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	replay-window 0 flag af-unspec esn
	aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128
	encap type espinudp sport 4500 dport 4500 addr 0.0.0.0
	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 
src 192.1.3.130 dst 192.1.3.209
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	replay-window 0 flag af-unspec esn
	aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128
	encap type espinudp sport 4500 dport 4500 addr 0.0.0.0
	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 
src 192.1.3.209 dst 192.1.3.130
	proto esp spi 0x00000000 reqid 0 mode transport
	replay-window 0 
	sel src 192.1.3.209/32 dst 192.1.3.130/32 proto icmp type 8 code 0 dev eth0 
road #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.1.3.130/32 dst 192.1.3.209/32
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.3.130 dst 192.1.3.209
		proto esp reqid REQID mode tunnel
src 192.1.3.130/32 dst 192.1.3.209/32
	dir in priority PRIORITY ptype main
	tmpl src 192.1.3.130 dst 192.1.3.209
		proto esp reqid REQID mode tunnel
src 192.1.3.209/32 dst 192.1.3.130/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.3.209 dst 192.1.3.130
		proto esp reqid REQID mode tunnel
src 192.1.2.253/32 dst 192.1.3.209/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.253/32 dst 192.1.3.209/32
	dir in priority PRIORITY ptype main
src 192.1.2.254/32 dst 192.1.3.209/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.254/32 dst 192.1.3.209/32
	dir in priority PRIORITY ptype main
src 192.1.3.209/32 dst 192.1.2.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.209/32 dst 192.1.2.254/32
	dir out priority PRIORITY ptype main
src 192.1.3.209/32 dst 192.1.3.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.209/32 dst 192.1.3.254/32
	dir out priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.209/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.209/32
	dir in priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.209/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.209/32
	dir in priority PRIORITY ptype main
src 192.1.3.209/32 dst 192.1.3.128/27
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
road #
 # you should see both RSA and NULL
road #
 grep -e 'auth method: ' -e 'hash algorithm identifier' -e "^[^|].* established IKE SA" /tmp/pluto.log
| emitting 2 raw bytes of hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_256 into IKEv2 Notify Payload
| hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_256: 00 02
| emitting 2 raw bytes of hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_384 into IKEv2 Notify Payload
| hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_384: 00 03
| emitting 2 raw bytes of hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_512 into IKEv2 Notify Payload
| hash algorithm identifier IKEv2_HASH_ALGORITHM_SHA2_512: 00 04
| parsing 2 raw bytes of IKEv2 Notify Payload into hash algorithm identifier (network ordered)
| parsing 2 raw bytes of IKEv2 Notify Payload into hash algorithm identifier (network ordered)
| parsing 2 raw bytes of IKEv2 Notify Payload into hash algorithm identifier (network ordered)
|    auth method: IKEv2_AUTH_NULL (0xd)
|    auth method: IKEv2_AUTH_DIGITAL_SIGNATURE (0xe)
"private-or-clear#192.1.3.128/27"[1] ...192.1.3.130 #1: initiator established IKE SA; authenticated peer certificate 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org' and 3nnn-bit RSASSA-PSS with SHA2_512 digital signature issued by 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'
road #
 
