Fill out the attempt-reconnect handler
-
iproute2: Find all routes that match the VPN gateway (excluding those matchingdev $TUNDEV, since the goal is to prevent loopback), and simply try adding them one-by-one. -
route/ifconfig: Unlike withiproute2, there is no way to determine which interface(s) have routes that actually match the VPN gateway, so we simply try finding a default-route gateway, as upon initial connection. For this to work properly on reconnection, a couple bugs inget_default_gwneed to be fixed:- Exclude
$TUNDEV(since the goal is to prevent loopback) - Only return the first default route found
- Exclude
See:
-
openconnect#17 (closed) (motivation for existence of
reason=attempt-reconnect) -
1000e0f6 (addition of
reason=attempt-reconnectstub here) - https://github.com/dlenski/vpn-slice/pull/14#issuecomment-489293114 (discussion of some of the complexities of determining the correct route to the VPN gateway after a change in the underlying network devices)
Edited by Daniel Lenski