/testing/guestbin/swan-prep
road #
 ipsec start
Redirecting to: systemctl start ipsec.service
road #
 /testing/pluto/bin/wait-until-pluto-started
road #
 ipsec whack --debug-all --impair-retransmits
road #
 ipsec auto --add westnet-eastnet-ipv4-psk-ikev2
002 added connection description "westnet-eastnet-ipv4-psk-ikev2"
road #
 echo "initdone"
initdone
road #
 ipsec auto --up  westnet-eastnet-ipv4-psk-ikev2
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: initiating v2 parent SA
133 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: STATE_PARENT_I1: initiate
133 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: STATE_PARENT_I1: sent v2I1, expected v2R1
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #1: suppressing retransmit because IMPAIR_RETRANSMITS is set.
134 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_gcm_16_256 integ=n/a prf=sha2_512 group=MODP2048}
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: suppressing retransmit because IMPAIR_RETRANSMITS is set.
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: IKEv2 mode peer ID is ID_FQDN: '@east'
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_ADDRESS 192.0.2.1
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_DNS 1.2.3.4
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: received INTERNAL_IP4_DNS 8.8.8.8
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: negotiated connection [192.0.2.1,192.0.2.1:0-65535 0] -> [192.1.2.23,192.1.2.23:0-65535 0]
004 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 #2: STATE_V2_IPSEC_I: IPsec SA established tunnel mode {ESP/NAT=>0xESPESP <0xESPESP xfrm=AES_GCM_C_256-NONE NATOA=none NATD=192.1.2.23:4500 DPD=passive}
road #
 # AA see really weired 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 #
 ip addr show  dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 12:00:00:ab:cd:02 brd ff:ff:ff:ff:ff:ff
    inet 192.1.3.209/24 brd 192.1.3.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.0.2.1/32 scope global eth0
       valid_lft forever preferred_lft forever
road #
 ping -n -c 2 -I 192.0.2.1 192.1.2.23
PING 192.1.2.23 (192.1.2.23) from 192.0.2.1 : 56(84) bytes of data.
64 bytes from 192.1.2.23: icmp_seq=1 ttl=64 time=0.XXX ms
64 bytes from 192.1.2.23: icmp_seq=2 ttl=64 time=0.XXX ms
--- 192.1.2.23 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time XXXX
rtt min/avg/max/mdev = 0.XXX/0.XXX/0.XXX/0.XXX ms
road #
 ipsec whack --trafficstatus
006 #2: "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23, type=ESP, add_time=1234567890, inBytes=168, outBytes=168, id='@east', lease=192.0.2.1/32
road #
 ipsec auto --down westnet-eastnet-ipv4-psk-ikev2
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23: terminating SAs using this connection
002 "westnet-eastnet-ipv4-psk-ikev2" #2: deleting state (STATE_V2_IPSEC_I)
005 "westnet-eastnet-ipv4-psk-ikev2" #2: ESP traffic information: in=168B out=168B
002 "westnet-eastnet-ipv4-psk-ikev2" #1: deleting state (STATE_PARENT_I3)
002 "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23: deleting connection "westnet-eastnet-ipv4-psk-ikev2"[1] 192.1.2.23 instance with peer 192.1.2.23
road #
 #check if the address, 192.0.2.1, is removed
road #
 ip addr show  dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 12:00:00:ab:cd:02 brd ff:ff:ff:ff:ff:ff
    inet 192.1.3.209/24 brd 192.1.3.255 scope global eth0
       valid_lft forever preferred_lft forever
road #
 echo done
done
road #
road #
 if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; mv /tmp/core* OUTPUT/; fi
road #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

