/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec whack --impair revival
west #
 ipsec whack --impair suppress_retransmits
west #
 ipsec auto --add west
"west": added IKEv2 connection
west #
 # iptables -A INPUT -s 192.1.2.23 -j LOG --log-prefix "east all"
west #
 # iptables -A INPUT -m u32 --u32 '0x6&0xFF=0x11' -j LOG --log-prefix  "udp log"
west #
 # iptables -A INPUT -m u32 --u32 '0x6 & 0xFF = 0x11 && 0x30 & 0xFFFFFFFF = 0x0:0x8' -j LOG --log-prefix  "ike"
west #
 # Drop the second IPsec rekey message, which is IKE Message ID: 4
west #
 # Message ID : 0 = IKE_INIT, 1 = IKE_AUTH, 2 = REKEY (First one let it go)
west #
 # 3 : DELETE, 4 = REKEY (DROP)
west #
 # iptables -A INPUT -m u32 --u32 '0x6 & 0xFF = 0x11 && 0x30 & 0xFFFFFFFF = 0x4' -j LOG --log-prefix  "ike"
west #
 iptables -A INPUT -m u32 --u32 '0x6 & 0xFF = 0x11 && 0x30 & 0xFFFFFFFF = 0x4' -j DROP
west #
 sleep 4 # XXX: why?
west #
 echo "initdone"
initdone
west #
 ipsec auto --status | grep west
"west": 192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=unset; their_ip=unset;
"west":   host: oriented; local: 192.1.2.45; remote: 192.1.2.23;
"west":   my_updown=ipsec _updown;
"west":   xauth us:none, xauth them:none, my_username=[any]; their_username=[any]
"west":   our auth:secret, their auth:secret, our autheap:none, their autheap:none;
"west":   modecfg info: us:none, them:none, modecfg policy:push, dns:unset, domains:unset, cat:unset;
"west":   cisco-split: no; cisco-unity: no; cisco-peer: no; nm-configured: no;
"west":   sec_label:unset;
"west":   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%;
"west":   iptfs: no; fragmentation: yes; packet-size: 0; max-queue-size: 0; drop-time: 0; init-delay: 0; reorder-window: 0;
"west":   retransmit-interval: 9999ms; retransmit-timeout: 99s; iketcp:no; iketcp-port:4500;
"west":   initial-contact:no; fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:no;
"west":   policy: IKEv2+PSK+ENCRYPT+TUNNEL+PFS+IKE_FRAG_ALLOW+ESN_NO+ESN_YES;
"west":   v2-auth-hash-policy: none;
"west":   conn_prio: 32,32,0; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
"west":   nflog-group: unset; mark: unset; vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:no;
"west":   our idtype: FQDN; our id=@west; their idtype: FQDN; their id=@east
"west":   sendca: all; our sendcert: always; their sendcert: always;
"west":   liveness: passive; dpddelay:0s; retransmit-timeout:15s
"west":   nat-traversal: encapsulation:auto; keepalive:20s
"west":   routing: unrouted;
"west":   conn serial: $1;
west #
 ipsec auto --up west
"west" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"west" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"west" #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" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500 with shared-key-mac and FQDN '@west'; Child SA #2 {ESP <0xESPESP}
"west" #1: initiator established IKE SA; authenticated peer using authby=secret and FQDN '@east'
"west" #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 #
 ../../guestbin/ping-once.sh --up 192.1.2.23
up
west #
 ipsec trafficstatus
#2: "west", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='@east'
west #
 # This rekey, #2->#3, should succeed
west #
 ipsec whack --rekey-child --name west
"west" #3: initiating rekey to replace Child SA #2 using IKE SA #1
"west" #3: sent CREATE_CHILD_SA request to rekey Child SA #2 using IKE SA #1 {ESP <0xESPESP}
"west" #3: initiator rekeyed Child SA #2 using #1; IPsec tunnel [192.1.2.45/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE-DH19 DPD=passive}
"west" #2: sent INFORMATIONAL request to delete established Child SA using IKE SA #1
"west" #2: ESP traffic information: in=84B out=84B
west #
 # This rekey, #3->#4, should fail.  The message is blocked by firewall
west #
 # rules added in 02-west-init.sh
west #
 ipsec whack --rekey-child --name west
"west" #4: initiating rekey to replace Child SA #3 using IKE SA #1
"west" #4: sent CREATE_CHILD_SA request to rekey Child SA #3 using IKE SA #1 {ESP <0xESPESP}
"west" #1: ESTABLISHED_IKE_SA: 15 second timeout exceeded after 0 retransmits.  No response (or no acceptable response) to our IKEv2 message
"west" #3: connection is supposed to remain up; revival attempt 1 scheduled in 0 seconds
"west" #3: IMPAIR: revival: skip scheduling revival event
"west" #3: ESP traffic information: in=0B out=0B
"west" #4: deleting larval Child SA
"west" #1: deleting IKE SA (established IKE SA)
west #
 ipsec whack --trafficstatus
west #
 # policies and state should be multiple
west #
