/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
road #
 echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ../../guestbin/tcpdump.sh --start -i eth0
tcpdump started
road #
 ipsec whack --impair revival
road #
 ipsec auto --add road
"road": created ipsec-interface ipsec1@eth0
"road": added IKEv2 connection
road #
 echo "initdone"
initdone
road #
 ipsec auto --up road
"road" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"road" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"road" #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
"road" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"road" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"road" #2: initiator established Child SA using #1; IPsec tunnel [192.1.3.209/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
road #
 # Monitor the XFRMI ipsec1 interface
road #
 ../../guestbin/tcpdump.sh --start -i ipsec1
tcpdump started
road #
 # rekey; detaches after old Child SA is gone
road #
 ipsec whack --rekey-child --name road
"road" #3: initiating rekey to replace Child SA #2 using IKE SA #1
"road" #3: sent CREATE_CHILD_SA request to rekey Child SA #2 using IKE SA #1
"road" #3: initiator rekeyed Child SA #2 using #1; IPsec tunnel [192.1.3.209/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE-DH19 DPD=passive}
"road" #2: sent INFORMATIONAL request to delete established Child SA using IKE SA #1
"road" #2: ESP traffic information: in=0B out=0B
road #
 # rekey; detaches after old Child SA is gone
road #
 ipsec whack --rekey-child --name road
"road" #4: initiating rekey to replace Child SA #3 using IKE SA #1
"road" #4: sent CREATE_CHILD_SA request to rekey Child SA #3 using IKE SA #1
"road" #4: initiator rekeyed Child SA #3 using #1; IPsec tunnel [192.1.3.209/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE-DH19 DPD=passive}
"road" #3: sent INFORMATIONAL request to delete established Child SA using IKE SA #1
"road" #3: ESP traffic information: in=0B out=0B
road #
 # give TCPDUMP some time before shutting it down; output should be
road #
 # empty as only IKE packets were sent
road #
 sleep 5
road #
 ../../guestbin/tcpdump.sh --stop -i ipsec1
reading from file OUTPUT/road.ikev2-xfrmi-16-rekey.ipsec1.tcpdump.pcap, link-type RAW (Raw IP)
road #
 # Check a re-add flushes old ipsec1.  TCPDUMP is stopped before doing
road #
 # this so it won't asynchronously log that it lost ipsec1.
road #
 ipsec auto --add road
"road": terminating SAs using this connection
"road" #1: deleting IKE SA (ESTABLISHED_IKE_SA) and sending notification
"road" #4: ESP traffic information: in=0B out=0B
"road": delete ipsec-interface ipsec1@eth0 added by pluto
"road": created ipsec-interface ipsec1@eth0
"road": added IKEv2 connection
road #
 ipsec auto --up road
"road" #5: initiating IKEv2 connection to 192.1.2.23 using UDP
"road" #5: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"road" #5: 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
"road" #5: sent IKE_AUTH request to 192.1.2.23:UDP/500
"road" #5: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"road" #6: initiator established Child SA using #5; IPsec tunnel [192.1.3.209/32===192.1.2.23/32] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
road #
 echo done
done
road #
 ../../guestbin/xfrmcheck.sh
road #
 # traffic should be 0 bytes in both directions - no ESP
road #
 ipsec whack --trafficstatus
#6: "road", type=ESP, add_time=1234567890, inBytes=0, outBytes=0, maxBytes=2^63B, id='@east'
road #
 # ROAD should not have ESP packets - no IKE over ESP
road #
 sleep 5
road #
 ../../guestbin/tcpdump.sh --stop -i eth0
reading from file OUTPUT/road.ikev2-xfrmi-16-rekey.eth0.tcpdump.pcap, link-type EN10MB (Ethernet)
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: parent_sa ikev2_init[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: parent_sa ikev2_init[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  ikev2_auth[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  ikev2_auth[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  child_sa[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  child_sa[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  inf2[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  inf2[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  child_sa[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  child_sa[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  inf2[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  inf2[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  inf2[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  inf2[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: parent_sa ikev2_init[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: parent_sa ikev2_init[R]
IP 192.1.3.209.isakmp > 192.1.2.23.isakmp: isakmp: child_sa  ikev2_auth[I]
IP 192.1.2.23.isakmp > 192.1.3.209.isakmp: isakmp: child_sa  ikev2_auth[R]
road #
 ../../guestbin/ip.sh -s link show ipsec1
X: ipsec1@eth0: <NOARP,UP,LOWER_UP> mtu 1500 state UNKNOWN
    RX:  bytes packets errors dropped  missed   mcast           
             0       0      0       0       0       0 
    TX:  bytes packets errors dropped carrier collsns           
             0       0      0       0       0       0 
road #
 ../../guestbin/ip.sh rule show
0:	from all lookup local
100:	from all to 192.1.2.23 fwmark 0x1 lookup 50
32766:	from all lookup main
32767:	from all lookup default
road #
 ../../guestbin/ip.sh route show table 50
192.1.2.23 via 192.1.3.254 dev eth0
road #
 ../../guestbin/ip.sh route
default via 192.1.3.254 dev eth0
192.1.2.23 dev ipsec1 scope link
192.1.3.0/24 dev eth0 proto kernel scope link src 192.1.3.209
road #
 
