/testing/guestbin/swan-prep
west #
 cp policies/* /etc/ipsec.d/policies/
west #
 echo "192.1.2.0/24" >> /etc/ipsec.d/policies/private-or-clear
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 # give OE policies time to load
west #
 ../../guestbin/wait-for.sh --match 'loaded 10,' -- ipsec auto --status
000 Total IPsec connections: loaded 10, active 0
west #
 echo "initdone"
initdone
west #
 # ICMP ping; expect error from trying to delete the kernel's acquire shunt
west #
 ipsec whack --oppohere 192.1.2.45 --oppothere 192.1.2.23 --oppoproto 1 --opposport 8 --oppodport 0
002 initiate on-demand for packet 192.1.2.45:8-ICMP->192.1.2.23:0 by whack
1v2 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23 #1: initiating IKEv2 connection
003 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23 #1: initiator established IKE SA; authenticated peer using authby=null and ID_NULL 'ID_NULL'
004 "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23 #2: initiator established Child SA using #1; IPsec tunnel [192.1.2.45-192.1.2.45:0-65535 0] -> [192.1.2.23-192.1.2.23:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 ../../guestbin/ping-once.sh --up 192.1.2.23
up
west #
 # should show traffic
west #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='ID_NULL'
west #
 echo done
done
west #
 ../../guestbin/ipsec-look.sh
west NOW
XFRM state:
src 192.1.2.23 dst 192.1.2.45
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	replay-window 0 flag af-unspec esn
	aead rfc4106(gcm(aes)) 0xENCAUTHKEY 128
	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.2.45 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
	anti-replay esn context:
	 seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX
	 replay_window 128, bitmap-length 4
	 00000000 00000000 00000000 XXXXXXXX 
XFRM policy:
src 127.0.0.1/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
src 127.0.0.1/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
src 192.1.2.253/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.253/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
src 192.1.2.254/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
src 192.1.2.254/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
src 192.1.2.45/32 dst 127.0.0.1/32
	dir out priority PRIORITY ptype main
src 192.1.2.45/32 dst 192.1.2.253/32
	dir out priority PRIORITY ptype main
src 192.1.2.45/32 dst 192.1.2.254/32
	dir out priority PRIORITY ptype main
src 192.1.2.45/32 dst 192.1.3.253/32
	dir out priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
src 192.1.3.253/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
src 192.1.2.23/32 dst 192.1.2.45/32
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 192.1.2.45/32
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
src 192.1.2.45/32 dst 192.1.2.23/32
	dir out priority PRIORITY ptype main
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.2.45/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.2.254 dev eth1
192.0.1.0/24 dev eth0 proto kernel scope link src 192.0.1.254
192.0.2.0/24 via 192.1.2.23 dev eth1
192.1.2.0/24 dev eth1 proto kernel scope link src 192.1.2.45
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
west #
 
