/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
west #
 ../../guestbin/ip.sh address add 192.0.100.254/24 dev eth0:1
west #
 ../../guestbin/ip.sh route add 192.0.200.0/24 via 192.1.2.23  dev eth1
west #
 # ensure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 iptables -A INPUT -i eth1 -s 192.0.200.0/24 -j DROP
west #
 iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec whack --impair suppress_retransmits
west #
 ipsec whack --impair revival
west #
 ipsec auto --add westnet-eastnet-ikev2a
"westnet-eastnet-ikev2a": added IKEv2 connection
west #
 ipsec auto --add westnet-eastnet-ikev2b
"westnet-eastnet-ikev2b": added IKEv2 connection
west #
 ipsec auto --add westnet-eastnet-ikev2c
"westnet-eastnet-ikev2c": added IKEv2 connection
west #
 echo "initdone"
initdone
west #
 ipsec auto --up westnet-eastnet-ikev2a
"westnet-eastnet-ikev2a" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"westnet-eastnet-ikev2a" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"westnet-eastnet-ikev2a" #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
"westnet-eastnet-ikev2a" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"westnet-eastnet-ikev2a" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"westnet-eastnet-ikev2a" #2: initiator established Child SA using #1; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 ping -n -q -w 1 -c 4 -I 192.0.1.254 192.0.2.254
PING 192.0.2.254 (192.0.2.254) from 192.0.1.254 : 56(84) bytes of data.
--- 192.0.2.254 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time XXXX
rtt min/avg/max/mdev = 0.XXX/0.XXX/0.XXX/0.XXX ms
west #
 # These two conns are mismatched and should fail
west #
 # The whack should release the socket on receiving NO_PROPOSAL_CHOSEN
west #
 ipsec auto --up westnet-eastnet-ikev2b
"westnet-eastnet-ikev2b" #3: initiating Child SA using IKE SA #1
"westnet-eastnet-ikev2b" #3: sent CREATE_CHILD_SA request to create Child SA using IKE SA #1
"westnet-eastnet-ikev2b" #3: CREATE_CHILD_SA failed with error notification TS_UNACCEPTABLE
"westnet-eastnet-ikev2b" #3: connection is supposed to remain up; revival attempt 1 scheduled in 0 seconds
"westnet-eastnet-ikev2b" #3: IMPAIR: revival: skip scheduling revival event
west #
 ipsec auto --up westnet-eastnet-ikev2c
"westnet-eastnet-ikev2c" #4: initiating Child SA using IKE SA #1
"westnet-eastnet-ikev2c" #4: sent CREATE_CHILD_SA request to create Child SA using IKE SA #1
"westnet-eastnet-ikev2c" #4: CREATE_CHILD_SA failed with error notification TS_UNACCEPTABLE
"westnet-eastnet-ikev2c" #4: connection is supposed to remain up; revival attempt 1 scheduled in 0 seconds
"westnet-eastnet-ikev2c" #4: IMPAIR: revival: skip scheduling revival event
west #
 #
west #
 # should see westnet-eastnet-ikev2b expiring
west #
 # should see westnet-eastnet-ikev2c replacing
west #
 ipsec auto --delete westnet-eastnet-ikev2a
"westnet-eastnet-ikev2a": terminating SAs using this connection
"westnet-eastnet-ikev2a" #1: deleting IKE SA (ESTABLISHED_IKE_SA) and sending notification
"westnet-eastnet-ikev2a" #2: ESP traffic information: in=84B out=84B
west #
 ipsec status | grep westnet-eastnet
"westnet-eastnet-ikev2b": 192.0.1.0/24===192.1.2.45[@west]...192.1.2.23[@east]===192.0.200.0/24; unrouted; my_ip=unset; their_ip=unset;
"westnet-eastnet-ikev2b":   host: oriented; local: 192.1.2.45; remote: 192.1.2.23;
"westnet-eastnet-ikev2b":   my_updown=ipsec _updown;
"westnet-eastnet-ikev2b":   xauth us:none, xauth them:none,  my_username=[any]; their_username=[any]
"westnet-eastnet-ikev2b":   our auth:secret, their auth:secret, our autheap:none, their autheap:none;
"westnet-eastnet-ikev2b":   modecfg info: us:none, them:none, modecfg policy:push, dns:unset, domains:unset, cat:unset;
"westnet-eastnet-ikev2b":   sec_label:unset;
"westnet-eastnet-ikev2b":   ike_life: 28800s; ipsec_life: 28800s; ipsec_max_bytes: 2^63B; ipsec_max_packets: 2^63; replay_window: 128; rekey_margin: 540s; rekey_fuzz: 100%;
"westnet-eastnet-ikev2b":   retransmit-interval: 9999ms; retransmit-timeout: 99s; iketcp:no; iketcp-port:4500;
"westnet-eastnet-ikev2b":   initial-contact:no; cisco-unity:no; fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:no;
"westnet-eastnet-ikev2b":   policy: IKEv2+PSK+ENCRYPT+TUNNEL+DONT_REKEY+UP+IKE_FRAG_ALLOW+ESN_NO+ESN_YES;
"westnet-eastnet-ikev2b":   v2-auth-hash-policy: none;
"westnet-eastnet-ikev2b":   conn_prio: 24,24; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
"westnet-eastnet-ikev2b":   nflog-group: unset; mark: unset; vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:no;
"westnet-eastnet-ikev2b":   our idtype: ID_FQDN; our id=@west; their idtype: ID_FQDN; their id=@east
"westnet-eastnet-ikev2b":   liveness: passive; dpddelay:0s; retransmit-timeout:60s
"westnet-eastnet-ikev2b":   nat-traversal: encapsulation:auto; keepalive:20s
"westnet-eastnet-ikev2b":   routing: unrouted;
"westnet-eastnet-ikev2b":   conn serial: $2;
"westnet-eastnet-ikev2c": 192.0.1.0/24===192.1.2.45[@west]...192.1.2.23[@east]===192.0.201.0/24; unrouted; my_ip=unset; their_ip=unset;
"westnet-eastnet-ikev2c":   host: oriented; local: 192.1.2.45; remote: 192.1.2.23;
"westnet-eastnet-ikev2c":   my_updown=ipsec _updown;
"westnet-eastnet-ikev2c":   xauth us:none, xauth them:none,  my_username=[any]; their_username=[any]
"westnet-eastnet-ikev2c":   our auth:secret, their auth:secret, our autheap:none, their autheap:none;
"westnet-eastnet-ikev2c":   modecfg info: us:none, them:none, modecfg policy:push, dns:unset, domains:unset, cat:unset;
"westnet-eastnet-ikev2c":   sec_label:unset;
"westnet-eastnet-ikev2c":   ike_life: 28800s; ipsec_life: 28800s; ipsec_max_bytes: 2^63B; ipsec_max_packets: 2^63; replay_window: 128; rekey_margin: 540s; rekey_fuzz: 100%;
"westnet-eastnet-ikev2c":   retransmit-interval: 9999ms; retransmit-timeout: 99s; iketcp:no; iketcp-port:4500;
"westnet-eastnet-ikev2c":   initial-contact:no; cisco-unity:no; fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:no;
"westnet-eastnet-ikev2c":   policy: IKEv2+PSK+ENCRYPT+TUNNEL+UP+IKE_FRAG_ALLOW+ESN_NO+ESN_YES;
"westnet-eastnet-ikev2c":   v2-auth-hash-policy: none;
"westnet-eastnet-ikev2c":   conn_prio: 24,24; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
"westnet-eastnet-ikev2c":   nflog-group: unset; mark: unset; vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:no;
"westnet-eastnet-ikev2c":   our idtype: ID_FQDN; our id=@west; their idtype: ID_FQDN; their id=@east
"westnet-eastnet-ikev2c":   liveness: passive; dpddelay:0s; retransmit-timeout:60s
"westnet-eastnet-ikev2c":   nat-traversal: encapsulation:auto; keepalive:20s
"westnet-eastnet-ikev2c":   routing: unrouted;
"westnet-eastnet-ikev2c":   conn serial: $3;
west #
 echo done
done
west #
 
