/testing/guestbin/swan-prep
road #
 cp policies/* /etc/ipsec.d/policies/
road #
 echo "192.1.2.23/32"  >> /etc/ipsec.d/policies/private-or-clear
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ipsec whack --impair suppress-retransmits
road #
 # ensure for tests acquires expire before our failureshunt=2m
road #
 echo 30 > /proc/sys/net/core/xfrm_acq_expires
road #
 # give OE policies time to load
road #
 ../../guestbin/wait-for.sh --match 'loaded 10' -- ipsec auto --status
000 Total IPsec connections: loaded 10, active 0
road #
 ipsec status | grep "our auth" | grep private
000 "clear-or-private":   our auth:null, their auth:null, our autheap:none, their autheap:none;
000 "private":   our auth:null, their auth:null, our autheap:none, their autheap:none;
000 "private-or-clear":   our auth:null, their auth:null, our autheap:none, their autheap:none;
000 "private-or-clear#192.1.2.23/32":   our auth:null, their auth:null, our autheap:none, their autheap:none;
road #
 echo "initdone"
initdone
road #
 # one packet, which gets eaten by XFRM, so east does not initiate
road #
 ../../guestbin/ping-once.sh --down -I 192.1.3.209 192.1.2.23
down
road #
 # wait on OE to establish
road #
 sleep 2
road #
 # should show established tunnel and no bare shunts
road #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.23/32"[1] ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=0, outBytes=0, id='ID_NULL'
road #
 # ping should succeed through tunnel
road #
 ../../guestbin/ping-once.sh --up -I 192.1.3.209 192.1.2.23
up
road #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.23/32"[1] ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='ID_NULL'
road #
 echo done
done
road #
 # Authentication should be AUTH_NULL
road #
 hostname | grep nic > /dev/null || grep authenticated /tmp/pluto.log
"private-or-clear#192.1.2.23/32"[1] ...192.1.2.23 #1: established IKE SA; authenticated using authby=null and peer ID_NULL 'ID_NULL'
road #
 
