/testing/guestbin/swan-prep --x509
Preparing X.509 files
north #
 certutil -D -n road -d sql:/etc/ipsec.d
north #
 certutil -D -n north -d sql:/etc/ipsec.d
north #
 certutil -D -n east -d sql:/etc/ipsec.d
north #
 cp road-ikev2-oe.conf /etc/ipsec.d/ikev2-oe.conf
north #
 cp policies/* /etc/ipsec.d/policies/
north #
 echo "192.1.2.0/24"  >> /etc/ipsec.d/policies/private-or-clear
north #
 restorecon -R /etc/ipsec.d
north #
 ipsec start
Redirecting to: [initsystem]
north #
 ../../guestbin/wait-until-pluto-started
north #
 ipsec whack --impair suppress-retransmits
north #
 # ensure for tests acquires expire before our failureshunt=2m
north #
 echo 30 > /proc/sys/net/core/xfrm_acq_expires
north #
 # give OE policies time to load
north #
 ../../guestbin/wait-for.sh --match 'loaded 10' -- ipsec auto --status
000 Total IPsec connections: loaded 10, active 0
north #
 # one packet, which gets eaten by XFRM, so east does not initiate
north #
 ../../guestbin/ping-once.sh --forget -I 192.1.3.33 192.1.2.23
fired and forgotten
north #
 # wait on OE IKE negotiation
north #
 ../../guestbin/wait-for.sh --match private-or-clear -- ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, 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', lease=10.0.10.1/32
north #
 # ping should succeed through tunnel (road pings once, north twice)
north #
 # should show established tunnel and no bare shunts
north #
 ../../guestbin/ping-once.sh --up -I 192.1.3.33 192.1.2.23
up
north #
 ../../guestbin/ping-once.sh --up -I 192.1.3.33 192.1.2.23
up
north #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=168, outBytes=168, 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', lease=10.0.10.1/32
north #
 ipsec whack --shuntstatus
000 Bare Shunt list:
000  
north #
 ../../guestbin/ipsec-look.sh
north NOW
XFRM state:
src 192.1.2.23 dst 192.1.3.33
	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
	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.33 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
	encap type espinudp sport 4500 dport 4500 addr 0.0.0.0
	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.33 dst 192.1.2.23
	proto esp spi 0x00000000 reqid 0 mode transport
	replay-window 0 
	sel src 192.1.3.33/32 dst 192.1.2.23/32 proto icmp type 8 code 0 dev eth1 
XFRM policy:
src 10.0.10.1/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.3.33 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 10.0.10.1/32
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.3.33
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 10.0.10.1/32
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.3.33
		proto esp reqid REQID mode tunnel
src 192.1.2.253/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.253/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.3.33 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.3.33/32 dst 192.1.2.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.3.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.3.254/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
XFRM done
IPSEC mangle TABLES
iptables filter TABLE
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ROUTING TABLES
default via 192.1.3.254 dev eth1
192.0.3.0/24 dev eth0 proto kernel scope link src 192.0.3.254
192.1.3.0/24 dev eth1 proto kernel scope link src 192.1.3.33
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
Libreswan test CA for mainca - Libreswan                     CT,, 
east-ec                                                      P,,  
hashsha1                                                     P,,  
nic                                                          P,,  
west                                                         P,,  
west-ec                                                      P,,  
north #
 iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DNAT       all  --  192.1.2.23           10.0.10.1            policy match dir in pol ipsec to:192.1.3.33
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
SNAT       all  --  0.0.0.0/0            192.1.2.23           policy match dir out pol ipsec to:10.0.10.1
north #
 # A tunnel should have established with non-zero byte counters
north #
 ../../guestbin/ping-once.sh --up 192.1.2.23
up
north #
 # jacob two two for east?
north #
 hostname | grep nic > /dev/null || ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=252, outBytes=252, 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', lease=10.0.10.1/32
north #
 ../../guestbin/ipsec-look.sh | sed "s/\(.\)port [0-9][0-9][0-9][0-9] /\1port XXXX /g"
north NOW
XFRM state:
src 192.1.2.23 dst 192.1.3.33
	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 XXXX dport XXXX addr 0.0.0.0
	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.33 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
	encap type espinudp sport XXXX dport XXXX addr 0.0.0.0
	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.33 dst 192.1.2.23
	proto esp spi 0x00000000 reqid 0 mode transport
	replay-window 0 
	sel src 192.1.3.33/32 dst 192.1.2.23/32 proto icmp type 8 code 0 dev eth1 
XFRM policy:
src 10.0.10.1/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.3.33 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 10.0.10.1/32
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.3.33
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 10.0.10.1/32
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.3.33
		proto esp reqid REQID mode tunnel
src 192.1.2.253/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.253/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.33/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.254/32 dst 192.1.3.33/32
	dir in priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.3.33 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.3.33/32 dst 192.1.2.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.3.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.3.254/32
	dir out priority PRIORITY ptype main
src 192.1.3.33/32 dst 192.1.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
XFRM done
IPSEC mangle TABLES
iptables filter TABLE
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ROUTING TABLES
default via 192.1.3.254 dev eth1
192.0.3.0/24 dev eth0 proto kernel scope link src 192.0.3.254
192.1.3.0/24 dev eth1 proto kernel scope link src 192.1.3.33
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
Libreswan test CA for mainca - Libreswan                     CT,, 
east-ec                                                      P,,  
hashsha1                                                     P,,  
nic                                                          P,,  
west                                                         P,,  
west-ec                                                      P,,  
north #
 # you should see both RSA and NULL
north #
 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)
| hash algorithm identifier (network ordered)
| parsing 2 raw bytes of IKEv2 Notify Payload into hash algorithm identifier (network ordered)
| hash algorithm identifier (network ordered)
| parsing 2 raw bytes of IKEv2 Notify Payload into hash algorithm identifier (network ordered)
| hash algorithm identifier (network ordered)
|    auth method: IKEv2_AUTH_NULL (0xd)
|    auth method: IKEv2_AUTH_DIGSIG (0xe)
"private-or-clear#192.1.2.0/24"[1] ...192.1.2.23 #1: initiator established IKE SA; authenticated peer '3nnn-bit RSASSA-PSS with SHA2_512' digital signature using peer certificate 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org' issued by CA 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'
north #
 
