/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: systemctl start ipsec.service
east #
 /testing/pluto/bin/wait-until-pluto-started
east #
 # give OE policies time to load
east #
 sleep 5
east #
 echo "initdone"
initdone
east #
 # A tunnel should have established
east #
 grep "negotiated connection" /tmp/pluto.log
"private-or-clear#192.1.3.0/24"[1] ...192.1.3.209 #2: negotiated connection [192.1.2.23-192.1.2.23:0-65535 0] -> [192.1.3.209-192.1.3.209:0-65535 0]
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
002 "private-or-clear": deleting non-instance connection
005 "private-or-clear#192.1.3.0/24" #2: ESP traffic information: in=168B out=168B
002 "private-or-clear#192.1.3.0/24" #1: deleting state (STATE_PARENT_R2) and sending notification
002 "private-or-clear#192.1.3.0/24": deleting non-instance connection
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 #
east #
 ../bin/check-for-core.sh
east #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

