[PATCH 2/4] Helper functions for uplink dev and gateway

David Woodhouse dwmw2 at infradead.org
Tue Oct 17 01:07:10 PDT 2017


On Wed, 2017-10-11 at 22:40 +0200, Gernot Hillier wrote:
> 
> +       get_uplink_gw() {
> +               # If we have a specific route to VPNGATEWAY, then this is our
> +               # Internet uplink (VPN tunnel active). If tunnel is not active,
> +               # then the default route should be our uplink.
> +               uplink_route=`netstat -r -n | grep "^$VPNGATEWAY"`
> +               if [ -n "$uplink_route" ]; then
> +                       echo "$uplink_route" | awk '{ print $2; }'
> +               else
> +                       get_default_gw
> +               fi

That isn't strictly true. I've certainly seen reports from German
universities where they have some weird wifi setup with a VPN server on
the *local* network, not accessible via the default route. I thought we
fixed that... but maybe we did so only for the iproute2 case, where 'ip
route get' works more sanely?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4938 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20171017/47a352f3/attachment-0001.bin>


More information about the openconnect-devel mailing list