/testing/guestbin/swan-prep --46
road #
 ip -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 #
 ip -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 #
 # %any
road #
 ip -4 route get to 0.0.0.0
local 0.0.0.0 dev lo src 127.0.0.1 uid 0
  cache <local>
road #
 ip -6 route get to ::
:: from :: via 2001:db8:1:3::254 dev eth0
road #
 # gateway
road #
 ip -4 route get to 192.1.3.254
192.1.3.254 dev eth0 src 192.1.3.209 uid 0
  cache
road #
 ip -6 route get to 2001:db8:1:3::254
2001:db8:1:3::254 from :: dev eth0 proto kernel src 2001:db8:1:3::209 metric 256 pref medium
road #
 # peer
road #
 ip -4 route get to 192.1.2.23
192.1.2.23 via 192.1.3.254 dev eth0 src 192.1.3.209 uid 0
  cache
road #
 ip -6 route get to 2001:db8:1:2::23
2001:db8:1:2::23 from :: via 2001:db8:1:3::254 dev eth0
road #
 # simple case, peer known
road #
 ipsec addconn --verbose ipv4-src 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv4 src=<defaultroute> gateway=<defaultroute> peer 192.1.2.23
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=192.1.3.254
resolving family=IPv4 src=<defaultroute> gateway=192.1.3.254 peer 192.1.2.23
  seeking PREFSRC
  processing response
  success: src=192.1.3.209 gateway=192.1.3.254
resolving family=IPv4 src=192.1.2.23 gateway=<not-set> peer 192.1.3.209
  seeking NOTHING
road #
 ipsec addconn --verbose ipv6-src 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv6 src=<defaultroute> gateway=<defaultroute> peer 2001:db8:1:2::23
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=2001:db8:1:3::254
resolving family=IPv6 src=<defaultroute> gateway=2001:db8:1:3::254 peer 2001:db8:1:2::23
  seeking PREFSRC
  processing response
  success: src=2001:db8:1:3::209 gateway=2001:db8:1:3::254
resolving family=IPv6 src=2001:db8:1:2::23 gateway=<not-set> peer 2001:db8:1:3::209
  seeking NOTHING
road #
 # now with no forced host
road #
 ipsec addconn --verbose ipv4-default 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv4 src=<defaultroute> gateway=<defaultroute> peer 192.1.2.23
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=192.1.3.254
resolving family=IPv4 src=<defaultroute> gateway=192.1.3.254 peer 192.1.2.23
  seeking PREFSRC
  processing response
  success: src=192.1.3.209 gateway=192.1.3.254
resolving family=IPv4 src=192.1.2.23 gateway=<not-set> peer 192.1.3.209
  seeking NOTHING
road #
 ipsec addconn --verbose ipv6-default 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv6 src=<defaultroute> gateway=<defaultroute> peer 2001:db8:1:2::23
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=2001:db8:1:3::254
resolving family=IPv6 src=<defaultroute> gateway=2001:db8:1:3::254 peer 2001:db8:1:2::23
  seeking PREFSRC
  processing response
  success: src=2001:db8:1:3::209 gateway=2001:db8:1:3::254
resolving family=IPv6 src=2001:db8:1:2::23 gateway=<not-set> peer 2001:db8:1:3::209
  seeking NOTHING
road #
 # newoe case, peer is group (see newoe-20-ipv6)
road #
 ipsec addconn --verbose ipv4-src-group 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv4 src=<defaultroute> gateway=<defaultroute> peer <group>
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=192.1.3.254
resolving family=IPv4 src=<defaultroute> gateway=192.1.3.254 peer <group>
  seeking PREFSRC
  processing response
  success: src=192.1.3.209 gateway=192.1.3.254
resolving family=IPv4 src=<group> gateway=<not-set> peer 192.1.3.209
  seeking NOTHING
road #
 ipsec addconn --verbose ipv6-src-group 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv6 src=<defaultroute> gateway=<defaultroute> peer <group>
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=2001:db8:1:3::254
resolving family=IPv6 src=<defaultroute> gateway=2001:db8:1:3::254 peer <group>
  seeking PREFSRC
  processing response
  success: src=2001:db8:1:3::209 gateway=2001:db8:1:3::254
resolving family=IPv6 src=<group> gateway=<not-set> peer 2001:db8:1:3::209
  seeking NOTHING
road #
 # re-adding while route is up (see ikev1-hostpair-02)
road #
 ip -4 address add dev eth0     192.0.2.1/32
road #
 ip -6 address add dev eth0  2001:db8:0:2::1 nodad
road #
 ip -4 route   add dev eth0       192.1.2.23 via       192.1.3.254 src       192.0.2.1
road #
 ip -6 route   add dev eth0 2001:db8:1:2::23 via 2001:db8:1:3::254 src 2001:db8:0:2::1
road #
 ip -4 route
default via 192.1.3.254 dev eth0
192.1.2.23 via 192.1.3.254 dev eth0 src 192.0.2.1
192.1.3.0/24 dev eth0 proto kernel scope link src 192.1.3.209
road #
 ip -6 route
2001:db8:0:2::1 dev eth0 proto kernel metric 256 pref medium
2001:db8:1:2::23 via 2001:db8:1:3::254 dev eth0 src 2001:db8:0:2::1 metric 1024 pref medium
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 #
 ipsec addconn --verbose ipv4-src-group 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv4 src=<defaultroute> gateway=<defaultroute> peer <group>
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=192.1.3.254
resolving family=IPv4 src=<defaultroute> gateway=192.1.3.254 peer <group>
  seeking PREFSRC
  processing response
  success: src=192.1.3.209 gateway=192.1.3.254
resolving family=IPv4 src=<group> gateway=<not-set> peer 192.1.3.209
  seeking NOTHING
road #
 ipsec addconn --verbose ipv6-src-group 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv6 src=<defaultroute> gateway=<defaultroute> peer <group>
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=2001:db8:1:3::254
resolving family=IPv6 src=<defaultroute> gateway=2001:db8:1:3::254 peer <group>
  seeking PREFSRC
  processing response
  success: src=2001:db8:1:3::209 gateway=2001:db8:1:3::254
resolving family=IPv6 src=<group> gateway=<not-set> peer 2001:db8:1:3::209
  seeking NOTHING
road #
 ip -4 route   del dev eth0       192.1.2.23 via       192.1.3.254 src       192.0.2.1
road #
 ip -6 route   del dev eth0 2001:db8:1:2::23 via 2001:db8:1:3::254 src 2001:db8:0:2::1
road #
 ip -4 address del dev eth0     192.0.2.1/32
road #
 ip -6 address del dev eth0  2001:db8:0:2::1
road #
 ip -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 #
 ip -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 #
 # messed up default (see ipv6-addresspool-05-dual-stack)
road #
 ip -6 route del default
road #
 ip -6 route add default dev eth0 via fe80::1000:ff:fe32:64ba
road #
 ip -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 fe80::1000:ff:fe32:64ba dev eth0
road #
 ipsec addconn --verbose ipv6-src 2>&1 | grep -e '^resolving ' -e '^  [^ ]'
resolving family=IPv6 src=<defaultroute> gateway=<defaultroute> peer 2001:db8:1:2::23
  seeking GATEWAY
  processing response
  please-call-again: src=<defaultroute> gateway=fe80::1000:ff:fe32:64ba
resolving family=IPv6 src=<defaultroute> gateway=fe80::1000:ff:fe32:64ba peer 2001:db8:1:2::23
  seeking PREFSRC
  processing response
  success: src=2001:db8:1:3::209 gateway=fe80::1000:ff:fe32:64ba
resolving family=IPv6 src=2001:db8:1:2::23 gateway=<not-set> peer 2001:db8:1:3::209
  seeking NOTHING
road #
 
