/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
west #
 ../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254
destination -I 192.0.1.254 192.0.2.254 is alive
west #
 # confirm that the network is alive
west #
 ../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254
destination -I 192.0.1.254 192.0.2.254 is alive
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 -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 # confirm clear text does not get through
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec whack --impair revival
west #
 ipsec auto --add westnet-eastnet
"westnet-eastnet": added IKEv2 connection
west #
 echo "initdone"
initdone
west #
 ipsec auto --up westnet-eastnet
"westnet-eastnet" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"westnet-eastnet" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"westnet-eastnet" #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_CBC_256 integ=HMAC_SHA2_512_256 prf=HMAC_SHA2_512 group=MODP2048}, initiating IKE_AUTH
"westnet-eastnet" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"westnet-eastnet" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"westnet-eastnet" #2: initiator established Child SA using #1; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {ESP=>0xESPESP <0xESPESP xfrm=AES_CBC_256-HMAC_SHA2_512_256 DPD=passive}
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 ipsec trafficstatus
#2: "westnet-eastnet", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='@east'
west #
 # does not work on 3.29 for now leave it timer based rekey
west #
 ipsec whack --rekey-child --name westnet-eastnet
"westnet-eastnet" #3: initiating rekey to replace Child SA #2 using IKE SA #1
"westnet-eastnet" #3: sent CREATE_CHILD_SA request to rekey Child SA #2 using IKE SA #1
"westnet-eastnet" #3: initiator rekeyed Child SA #2 using #1; IPsec tunnel [192.0.1.0/24===192.0.2.0/24] {ESP=>0xESPESP <0xESPESP xfrm=AES_CBC_256-HMAC_SHA2_512_256-MODP2048 DPD=passive}
"westnet-eastnet" #2: sent INFORMATIONAL request to delete established Child SA using IKE SA #1
"westnet-eastnet" #2: ESP traffic information: in=84B out=84B
west #
 sleep 15
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 # only #3 should be there with traffic
west #
 ipsec trafficstatus
#3: "westnet-eastnet", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='@east'
west #
 ipsec status | grep westnet-eastnet
"westnet-eastnet": 192.0.1.0/24===192.1.2.45[@west]...192.1.2.23[@east]===192.0.2.0/24; routed-tunnel; my_ip=unset; their_ip=unset;
"westnet-eastnet":   host: oriented; local: 192.1.2.45; remote: 192.1.2.23; established IKE SA: #1;
"westnet-eastnet":   my_updown=ipsec _updown;
"westnet-eastnet":   xauth us:none, xauth them:none,  my_username=[any]; their_username=[any]
"westnet-eastnet":   our auth:secret, their auth:secret, our autheap:none, their autheap:none;
"westnet-eastnet":   modecfg info: us:none, them:none, modecfg policy:push, dns:unset, domains:unset, cat:unset;
"westnet-eastnet":   sec_label:unset;
"westnet-eastnet":   ike_life: 28800s; ipsec_life: 28800s; ipsec_max_bytes: 2^63B; ipsec_max_packets: 2^63; replay_window: 128; rekey_margin: 540s; rekey_fuzz: 0%;
"westnet-eastnet":   retransmit-interval: 9999ms; retransmit-timeout: 99s; iketcp:no; iketcp-port:4500;
"westnet-eastnet":   initial-contact:no; cisco-unity:no; fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:no;
"westnet-eastnet":   policy: IKEv2+PSK+ENCRYPT+TUNNEL+PFS+UP+IKE_FRAG_ALLOW+ESN_NO+ESN_YES;
"westnet-eastnet":   v2-auth-hash-policy: none;
"westnet-eastnet":   conn_prio: 24,24; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
"westnet-eastnet":   nflog-group: unset; mark: unset; vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:no;
"westnet-eastnet":   our idtype: ID_FQDN; our id=@west; their idtype: ID_FQDN; their id=@east
"westnet-eastnet":   liveness: passive; dpddelay:0s; retransmit-timeout:60s
"westnet-eastnet":   nat-traversal: encapsulation:auto; keepalive:20s
"westnet-eastnet":   routing: routed-tunnel; owner: Child SA #3; established IKE SA: #1; established Child SA: #3;
"westnet-eastnet":   conn serial: $1;
"westnet-eastnet":   IKE algorithms: AES_CBC_256-HMAC_SHA2_512-MODP2048
"westnet-eastnet":   IKEv2 algorithm newest: AES_CBC_256-HMAC_SHA2_512-MODP2048
"westnet-eastnet":   ESP algorithms: AES_CBC_256-HMAC_SHA2_512_256-MODP2048
"westnet-eastnet":   ESP algorithm newest: AES_CBC_256-HMAC_SHA2_512_256; pfsgroup=<Phase1>
#1: "westnet-eastnet":500 ESTABLISHED_IKE_SA (established IKE SA); REKEY in XXs; REPLACE in XXs; newest; idle;
#3: "westnet-eastnet":500 ESTABLISHED_CHILD_SA (established Child SA); REKEY in XXs; REPLACE in XXs; newest; eroute owner; IKE SA #1; idle;
#3: "westnet-eastnet" esp.ESPSPIi@192.1.2.23 esp.ESPSPIi@192.1.2.45 tun.0@192.1.2.23 tun.0@192.1.2.45 Traffic: ESPin=84B ESPout=84B ESPmax=2^63B 
west #
 # give time to strongswan to expire old one
west #
 sleep 53
west #
 if [ -f /var/run/charon.pid -o -f /var/run/strongswan/charon.pid ]; then strongswan status ; fi
west #
 
