/testing/guestbin/swan-prep
west #
 # make sure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 ipsec start
Redirecting to: [initsystem]
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add west
002 added IKEv2 connection "west"
west #
 echo "initdone"
initdone
west #
 # bring up west and confirm
west #
 ipsec auto --up west
1v2 "west" #1: initiating IKEv2 connection
1v2 "west" #1: sent IKE_SA_INIT request
1v2 "west" #1: sent IKE_AUTH request {auth=IKEv2 cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
002 "west" #2: IKEv2 mode peer ID is ID_FQDN: '@east'
003 "west" #1: authenticated using authby=secret
002 "west" #2: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "west" #2: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE NATOA=none NATD=none DPD=passive}
west #
 ../../pluto/bin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 # expect IKE #1 CHILD #2
west #
 ipsec whack --trafficstatus
006 #2: "west", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 # why?
west #
 echo "sleep 9"
sleep 9
west #
 sleep 9
west #
 # rekey CHILD SA
west #
 ipsec whack --rekey-ipsec --name west
1v2 "west" #3: sent CREATE_CHILD_SA request to rekey IPsec SA
002 "west" #3: rekeyed #2 STATE_V2_REKEY_CHILD_I1 and expire it remaining life XXs
002 "west" #3: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "west" #3: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE-MODP2048 NATOA=none NATD=none DPD=passive}
002 "west" #2: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "west" #2: ESP traffic information: in=84B out=84B
west #
 sleep 2
west #
 # expect IKE #1 CHILD #3
west #
 ipsec status |grep STATE_
000 #1: "west":500 STATE_V2_ESTABLISHED_IKE_SA (established IKE SA); EVENT_SA_REKEY in XXs; newest ISAKMP; idle;
000 #3: "west":500 STATE_V2_ESTABLISHED_CHILD_SA (IPsec SA established); EVENT_SA_REKEY in XXs; newest IPSEC; eroute owner; isakmp#1; idle;
west #
 ../../pluto/bin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsec whack --trafficstatus
006 #3: "west", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 # why?
west #
 echo "sleep 11"
sleep 11
west #
 sleep 11
west #
 ../../pluto/bin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 # rekey CHILD SA
west #
 ipsec whack --rekey-ipsec --name west
1v2 "west" #4: sent CREATE_CHILD_SA request to rekey IPsec SA
002 "west" #4: rekeyed #3 STATE_V2_REKEY_CHILD_I1 and expire it remaining life XXs
002 "west" #4: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "west" #4: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE-MODP2048 NATOA=none NATD=none DPD=passive}
002 "west" #3: deleting state (STATE_V2_ESTABLISHED_CHILD_SA) and sending notification
005 "west" #3: ESP traffic information: in=168B out=168B
west #
 sleep 2
west #
 # expect IKE #1 CHILD #4
west #
 ipsec status |grep STATE_
000 #1: "west":500 STATE_V2_ESTABLISHED_IKE_SA (established IKE SA); EVENT_SA_REKEY in XXs; newest ISAKMP; idle;
000 #4: "west":500 STATE_V2_ESTABLISHED_CHILD_SA (IPsec SA established); EVENT_SA_REKEY in XXs; newest IPSEC; eroute owner; isakmp#1; idle;
west #
 ../../pluto/bin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsec whack --trafficstatus
006 #4: "west", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 echo done
done
west #
 ipsec whack --trafficstatus
006 #4: "west", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 ../bin/check-for-core.sh
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi
west #
 
