/testing/guestbin/swan-prep
north #
 # confirm that the network is alive
north #
 ../../pluto/bin/wait-until-alive 192.1.2.23
destination 192.1.2.23 is alive
north #
 ipsec start
Redirecting to: [initsystem]
north #
 /testing/pluto/bin/wait-until-pluto-started
north #
 ipsec auto --add north-east-222
002 added IKEv1 connection "north-east-222"
north #
 echo done
done
north #
 ipsec auto --up north-east-222
002 "north-east-222" #1: initiating IKEv1 Main Mode connection
1v1 "north-east-222" #1: sent Main Mode request
1v1 "north-east-222" #1: sent Main Mode I2
1v1 "north-east-222" #1: sent Main Mode I3
002 "north-east-222" #1: Peer ID is ID_FQDN: '@east'
003 "north-east-222" #1: authenticated using RSA with SHA-1
004 "north-east-222" #1: IKE SA established {auth=RSA_SIG cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}
002 "north-east-222" #2: initiating Quick Mode RSASIG+ENCRYPT+PFS+UP+IKEV1_ALLOW+IKE_FRAG_ALLOW+ESN_NO
1v1 "north-east-222" #2: sent Quick Mode request
004 "north-east-222" #2: IPsec SA established transport mode {ESPinUDP=>0xESPESP <0xESPESP xfrm=AES_CBC_128-HMAC_SHA1_96 NATOA=none NATD=192.1.2.23:4500 DPD=passive}
north #
 # port 2 does NOT go over ipsec, IPsec traffic should remain 0
north #
 echo test | nc 192.1.2.23 2
Ncat: Connection refused.
north #
 ipsec trafficstatus
006 #2: "north-east-222", type=ESP, add_time=1234567890, inBytes=0, outBytes=0, id='@east'
north #
 # port 222 goes over ipsec, traffic counters should be non-zero
north #
 echo test | nc 192.1.2.23 222
Ncat: Connection refused.
north #
 ipsec trafficstatus
006 #2: "north-east-222", type=ESP, add_time=1234567890, inBytes=20, outBytes=40, id='@east'
north #
 echo done
done
north #
 # confirm tunnel of first client still works after second client established
north #
 ipsec trafficstatus
006 #2: "north-east-222", type=ESP, add_time=1234567890, inBytes=20, outBytes=40, id='@east'
north #
 # port 222 goes over ipsec, traffic counters should increase
north #

### below should not time out. Note that outbytes increases, but inbytes does not. East has a bug

 echo test | nc 192.1.2.23 222
Ncat: Connection timed out.
north #
 ipsec trafficstatus
006 #2: "north-east-222", type=ESP, add_time=1234567890, inBytes=20, outBytes=200, id='@east'
north #
 ../bin/check-for-core.sh
north #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi
north #
 
