Fill out the attempt-reconnect handler

  • iproute2: Find all routes that match the VPN gateway (excluding those matching dev $TUNDEV, since the goal is to prevent loopback), and simply try adding them one-by-one.
  • route/ifconfig: Unlike with iproute2, 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 in get_default_gw need to be fixed:
    1. Exclude $TUNDEV (since the goal is to prevent loopback)
    2. Only return the first default route found

See:

Edited by Daniel Lenski

Merge request reports

Loading