/testing/guestbin/swan-prep --nokeys
Creating empty NSS database
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ipsec whack --impair suppress_retransmits
road #
 ipsec auto --add westnet-eastnet-ipv4-psk-ikev2
"westnet-eastnet-ipv4-psk-ikev2": added IKEv2 connection
road #
 echo "initdone"
initdone
road #
 ipsec auto --up westnet-eastnet-ipv4-psk-ikev2
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/4500 {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=DH19}, initiating IKE_AUTH
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: sent IKE_AUTH request to 192.1.2.23:UDP/4500
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_ADDRESS 192.0.2.1
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_DNS 1.2.3.4
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_DNS 8.8.8.8
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: up-client output: updating resolvconf
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: initiator established Child SA using #1; IPsec tunnel [192.0.2.1/32===192.1.2.23/32] {ESPinUDP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE NATD=192.1.2.23:4500 DPD=passive}
road #
 # AA see really weird route, I have to remove that
road #
 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.1.3.254     0.0.0.0         UG    0      0        0 eth0
192.1.2.23      0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.1.3.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0
road #
 route del -net 192.1.2.23 netmask 255.255.255.255
road #
 # ipsec will configure 192.0.2.1 on eth0
road #
 ../../guestbin/ip.sh address show  dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    link/ether 12:00:00:ab:cd:02 brd ff:ff:ff:ff:ff:ff
    altname enp0s5
    altname ens5
    inet 192.1.3.209/24 scope global eth0
       valid_lft forever preferred_lft forever
road #
 ../../guestbin/ping-once.sh --up -I 192.0.2.1 192.1.2.23
up
road #
 ipsec whack --trafficstatus
#2: "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, maxBytes=2^63B, id='@east', lease=192.0.2.1/32
road #
 ipsec auto --down westnet-eastnet-ipv4-psk-ikev2
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23: terminating SAs using this connection
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: sent INFORMATIONAL request to delete IKE SA
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: down-client output: restoring resolvconf
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: ESP traffic information: in=84B out=84B
"westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: deleting IKE SA (established IKE SA)
road #
 #check if the address, 192.0.2.1, is removed
road #
 ../../guestbin/ip.sh address show  dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    link/ether 12:00:00:ab:cd:02 brd ff:ff:ff:ff:ff:ff
    altname enp0s5
    altname ens5
    inet 192.1.3.209/24 scope global eth0
       valid_lft forever preferred_lft forever
road #
 echo done
done
road #
 
