/testing/guestbin/swan-prep
east #
 cp policies/* /etc/ipsec.d/policies/
east #
 echo "192.1.3.0/24"  >> /etc/ipsec.d/policies/private-or-clear
east #
 ipsec start
Redirecting to: [initsystem]
east #
 ../../guestbin/wait-until-pluto-started
east #
 # give OE policies time to load
east #
 ../../guestbin/wait-for.sh --match 'loaded 10,' -- ipsec auto --status
000 Total IPsec connections: loaded 10, active 0
east #
 echo "initdone"
initdone
east #
 # A tunnel should have established
east #
 grep "^[^|].*: established Child SA" /tmp/pluto.log
"private-or-clear#192.1.3.0/24"[1] ...192.1.3.209 #2: established Child SA; IPsec tunnel [192.1.2.23-192.1.2.23:0-65535 0] -> [192.1.3.209-192.1.3.209:0-65535 0] {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE NATOA=none NATD=none DPD=passive}
east #
 # check for proper state counting
east #
 hostname | grep east && ipsec status | grep "SAs: total"
east
000 IKE SAs: total(1), half-open(0), open(0), authenticated(0), anonymous(1)
000 IPsec SAs: total(1), authenticated(0), anonymous(1)
east #
 sleep 10
east #
 ipsec auto --delete private-or-clear
005 "private-or-clear#192.1.3.0/24"[1] ...192.1.3.209 #2: ESP traffic information: in=84B out=84B
002 "private-or-clear#192.1.3.0/24"[1] ...192.1.3.209 #1: deleting state (STATE_V2_ESTABLISHED_IKE_SA) and sending notification
east #
 sleep 5
east #
 # should show 0 states left
east #
 ipsec status | grep "SAs: total"
000 IKE SAs: total(0), half-open(0), open(0), authenticated(0), anonymous(0)
000 IPsec SAs: total(0), authenticated(0), anonymous(0)
east #
 
