/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add west-east
"west-east": added IKEv2 connection
west #
 ipsec auto --add pass-7
"pass-7": added passthrough connection
west #
 echo "initdone"
initdone
west #
 ipsec auto --up west-east
"west-east" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"west-east" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"west-east" #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=DH19}, initiating IKE_AUTH
"west-east" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"west-east" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"west-east" #2: initiator established Child SA using #1; IPsec tunnel [192.1.2.45/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 # poke a hole to port 7, those packets will be allowed cleartext
west #
 ipsec auto --route pass-7
west #
 ip xfrm policy
src 192.1.2.23/32 dst 192.1.2.45/32 proto tcp sport 7 
	dir fwd priority PRIORITY ptype main 
src 192.1.2.23/32 dst 192.1.2.45/32 proto tcp sport 7 
	dir in priority PRIORITY ptype main 
src 192.1.2.45/32 dst 192.1.2.23/32 proto tcp dport 7 
	dir out priority PRIORITY ptype main 
src 192.1.2.45/32 dst 192.1.2.23/32 
	dir out priority PRIORITY ptype main 
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 192.1.2.45/32 
	dir fwd priority PRIORITY ptype main 
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
src 192.1.2.23/32 dst 192.1.2.45/32 
	dir in priority PRIORITY ptype main 
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket out priority 0 ptype main 
src 0.0.0.0/0 dst 0.0.0.0/0 
	socket in priority 0 ptype main 
west #
 # send packet over the clear exception - should return connection refused
west #
 echo 'test' | nc -w 5 192.1.2.23 7
Ncat: Connection refused.
west #
 # counters should be zero
west #
 ipsec trafficstatus
#2: "west-east", type=ESP, add_time=1234567890, inBytes=0, outBytes=0, maxBytes=2^63B, id='@east'
west #
 # send packet over the 'tunnel' should get encrypted
west #
 echo 'test' | nc -w 5 192.1.2.23 80
Ncat: Connection refused.
west #
 ipsec trafficstatus
#2: "west-east", type=ESP, add_time=1234567890, inBytes=40, outBytes=60, maxBytes=2^63B, id='@east'
west #
 # counters should be zero
west #
 echo done
done
west #
 
