/testing/guestbin/swan-prep --x509 --46
Preparing X.509 files
road #
 dig +short east46.testing.libreswan.org A
192.1.2.23
road #
 dig +short east46.testing.libreswan.org AAAA
2001:db8:1:2::23
road #
 ../../guestbin/ip.sh -4 route
default via 192.1.3.254 dev eth0
192.1.3.0/24 dev eth0 proto kernel scope link src 192.1.3.209
road #
 ../../guestbin/ip.sh -6 route
2001:db8:1:3::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via 2001:db8:1:3::254 dev eth0
road #
 ../../guestbin/wait-until-alive 2001:db8:0:2::254
destination 2001:db8:0:2::254 is alive
road #
 ../../guestbin/wait-until-alive 2001:db8:1:2::23
destination 2001:db8:1:2::23 is alive
road #
 ../../guestbin/ip.sh route get to 2001:db8:1:2::23
2001:db8:1:2::23 from :: via 2001:db8:1:3::254 dev eth0
road #
 # change the default route
road #
 ../../guestbin/ip.sh -6 route del default
road #
 ../../guestbin/ping-once.sh --down 2001:db8:1:2::23
unexpected status 2
connect: Network is unreachable
road #
 # add default via link local
road #
 ../../guestbin/ip.sh -6 route add default dev eth0 via fe80::1000:ff:fe32:64ba
road #
 ../../guestbin/ping-once.sh --up 2001:db8:1:2::23
up
road #
 ip6tables -A INPUT -i eth0 -s 2001:db8:0:2::254 -p ipv6-icmp -j DROP
road #
 ip6tables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
road #
 ../../guestbin/ping-once.sh --down 2001:db8:0:2::254
down
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ipsec whack --impair suppress_retransmits
road #
 # this test need --verbose to see source address selection
road #
 ipsec auto --add --verbose road
opening file: /etc/ipsec.conf
debugging mode enabled
end of file /etc/ipsec.conf
Loading conn road
starter: left is KH_DEFAULTROUTE
loading named conns: road
resolving family = IPv6 src = <defaultroute> gateway = <defaultroute> peer east46.testing.libreswan.org
  seeking gateway
  query getroute +REQUEST +ROOT +MATCH
  add dst 2001:db8:1:2::23 (peer->addr)
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst ::1 dev lo priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst 2001:db8:1:3:: dev eth0 priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst fe80:: dev eth0 priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway fe80::1000:ff:fe32:64ba dst <unset-address> dev eth0 priority 1024 pref 0 table 254 +cacheinfo
  found gateway (host_nexthop): fe80::1000:ff:fe32:64ba
  please-call-again: src = <defaultroute> gateway = fe80::1000:ff:fe32:64ba
resolving family = IPv6 src = <defaultroute> gateway = fe80::1000:ff:fe32:64ba peer east46.testing.libreswan.org
  seeking prefsrc
  query getroute +REQUEST
  add dst 2001:db8:1:2::23 (peer->addr)
  src :: prefsrc 2001:db8:1:3::209 gateway fe80::1000:ff:fe32:64ba dst 2001:db8:1:2::23 dev eth0 priority 1024 pref 0 table 254 +cacheinfo
  found prefsrc (host_addr): 2001:db8:1:3::209
  success: src = 2001:db8:1:3::209 gateway = fe80::1000:ff:fe32:64ba
resolving family = IPv6 src = east46.testing.libreswan.org gateway = <not-set> peer 2001:db8:1:3::209
  seeking nothing
conn: "road" modecfgdns=<unset>
conn: "road" modecfgdomains=<unset>
conn: "road" modecfgbanner=<unset>
conn: "road" mark=<unset>
conn: "road" mark-in=<unset>
conn: "road" mark-out=<unset>
conn: "road" vti_iface=<unset>
conn: "road" redirect-to=<unset>
conn: "road" accept-redirect-to=<unset>
conn: "road" esp=<unset>
conn: "road" ike=<unset>
"road": added IKEv2 connection
road #
 echo "initdone"
initdone
road #
 ipsec auto --up road
"road"[1] 2001:db8:1:2::23 #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"road"[1] 2001:db8:1:2::23 #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"road"[1] 2001:db8:1:2::23 #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] 2001:db8:1:2::23 #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"road"[1] 2001:db8:1:2::23 #1: initiator established IKE SA; authenticated peer certificate '@east.testing.libreswan.org' and 2nnn-bit RSASSA-PSS with SHA2_512 digital signature issued by 'C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'
"road"[1] 2001:db8:1:2::23 #2: received INTERNAL_IP6_ADDRESS 2001:db8:0:3:1::
"road"[1] 2001:db8:1:2::23 #2: initiator established Child SA using #1; IPsec tunnel [2001:db8:0:3:1::/128===::/0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
road #
 ping6 -n -q -w 5 -c 2 -I 2001:db8:0:3:1::0 2001:db8:0:2::254
PING 2001:db8:0:2::254 (2001:db8:0:2::254) from 2001:db8:0:3:1:: : 56 data bytes
--- 2001:db8:0:2::254 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 trafficstatus
#2: "road"[1] 2001:db8:1:2::23, type=ESP, add_time=1234567890, inBytes=208, outBytes=208, maxBytes=2^63B, id='@east.testing.libreswan.org', lease=2001:db8:0:3:1::/128
road #
 ../../guestbin/ip-addr-show.sh
eth0 inet 192.1.3.209/24
eth0 inet6 2001:db8:1:3::209/64
lo inet6 2001:db8:0:3:1::/128
road #
 ../../guestbin/ip.sh -6 route
2001:db8:0:3:1:: dev lo proto kernel metric 256 pref medium
2001:db8:1:3::/64 dev eth0 proto kernel metric 256 pref medium
2000::/3 via fe80::1000:ff:fe32:64ba dev eth0 src 2001:db8:0:3:1:: metric 1024 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via fe80::1000:ff:fe32:64ba dev eth0
road #
 ../../guestbin/ip.sh route get to 2001:db8:1:2::23
2001:db8:1:2::23 from :: via fe80::1000:ff:fe32:64ba dev eth0 src 2001:db8:0:3:1:: metric 1024 pref medium
road #
 #
road #
 # addconn need a non existing --ctlsocket
road #
 # otherwise this add bring the connection down.
road #
 #
road #
 # see the source address selection when the tunnel is established
road #
 ipsec auto --add --verbose --ctlsocket /run/pluto/foo road
opening file: /etc/ipsec.conf
debugging mode enabled
end of file /etc/ipsec.conf
Loading conn road
starter: left is KH_DEFAULTROUTE
loading named conns: road
resolving family = IPv6 src = <defaultroute> gateway = <defaultroute> peer east46.testing.libreswan.org
  seeking gateway
  query getroute +REQUEST +ROOT +MATCH
  add dst 2001:db8:1:2::23 (peer->addr)
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst ::1 dev lo priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst 2001:db8:0:3:1:: dev lo priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst 2001:db8:1:3:: dev eth0 priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc 2001:db8:0:3:1:: gateway fe80::1000:ff:fe32:64ba dst 2000:: dev eth0 priority 1024 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway <unset-address> dst fe80:: dev eth0 priority 256 pref 0 table 254 +cacheinfo
  src <unset-address> prefsrc <unset-address> gateway fe80::1000:ff:fe32:64ba dst <unset-address> dev eth0 priority 1024 pref 0 table 254 +cacheinfo
  found gateway (host_nexthop): fe80::1000:ff:fe32:64ba
  please-call-again: src = <defaultroute> gateway = fe80::1000:ff:fe32:64ba
resolving family = IPv6 src = <defaultroute> gateway = fe80::1000:ff:fe32:64ba peer east46.testing.libreswan.org
  seeking prefsrc
  query getroute +REQUEST
  add dst 2001:db8:1:2::23 (peer->addr)
  src :: prefsrc 2001:db8:0:3:1:: gateway fe80::1000:ff:fe32:64ba dst 2001:db8:1:2::23 dev eth0 priority 1024 pref 0 table 254 +cacheinfo
  found prefsrc (host_addr): 2001:db8:0:3:1::
  success: src = 2001:db8:0:3:1:: gateway = fe80::1000:ff:fe32:64ba
resolving family = IPv6 src = east46.testing.libreswan.org gateway = <not-set> peer 2001:db8:0:3:1::
  seeking nothing
conn: "road" modecfgdns=<unset>
conn: "road" modecfgdomains=<unset>
conn: "road" modecfgbanner=<unset>
conn: "road" mark=<unset>
conn: "road" mark-in=<unset>
conn: "road" mark-out=<unset>
conn: "road" vti_iface=<unset>
conn: "road" redirect-to=<unset>
conn: "road" accept-redirect-to=<unset>
conn: "road" esp=<unset>
conn: "road" ike=<unset>
connect(pluto_ctl) failed: No such file or directory
road #
 echo done
done
road #
 
