[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Forcing dhclient to not ignore tun0 interface when it's available



On Thu, 2 Mar 2023, davenull@tuxfamily.org wrote:

Hello

On 2023-02-24 10:19, davenull@tuxfamily.org wrote:
Hello,

[?]

Otherwise, when VPN is disconnected, I DO want /etc/resolv.conf to be
generated according to my home router's DHCP tells the computer

? yes, that one.

Cheers,
David.

I?finally had the time to dig into the logs from two days ago, when the problem happens again It seems that dhclient does it requests trying different interfaces EXCEPT tun0 (see syslog below)


New to this thread, so might be totally off-piste but openvpn has hooks
to run scripts like this:

script-security 2
route-up "/etc/network/scripts/openvpn-tun0-up"
route-pre-down "/etc/network/scripts/openvpn-tun0-down"
client-connect "/etc/network/scripts/openvpn-client-connect"
client-disconnect "/etc/network/scripts/openvpn-client-disconnect"

This is server side but the route-up/pre-down work client side too.

Presumably you can do something here to renew dhcp leases or restore
resolv.conf.

I'd assume whatever vpn you're using will have similar hooks, or
possibly you xan use the default ones in /etc/network?

Tim


Reply to: