[Solved] Disable/enable TAP-Windows before connect (on pre-up)?

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
pavelvpn
OpenVpn Newbie
Posts: 3
Joined: Thu Aug 23, 2018 3:12 am

[Solved] Disable/enable TAP-Windows before connect (on pre-up)?

Post by pavelvpn » Thu Aug 23, 2018 3:26 am

Hi all,

I've noticed that, sometimes, on some Win7 machines the client connection faults out after numerous "Waiting for TUN/TAP interface to come up" messages.
I resolve it by manually disabling and re-enabling TAP-Windows Adapter, or restarting the system.
Is there a way to run a pre-up script that would reset the adapter before attempting to connect?

Currently I use

Code: Select all

up up.bat
where up.bat is

Code: Select all

ipconfig /renew *
that seems to solve the problem 80% of the time, however it doesn't seem like the right solution for the problem.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Disable/enable TAP-Windows before connect (on pre-up)?

Post by TinCanTech » Thu Aug 23, 2018 11:39 am

There are specific options for that.

See --tap-sleep, --dhcp-renew & --register-dns in The Manual v24x

pavelvpn
OpenVpn Newbie
Posts: 3
Joined: Thu Aug 23, 2018 3:12 am

Re: Disable/enable TAP-Windows before connect (on pre-up)?

Post by pavelvpn » Thu Aug 23, 2018 7:36 pm

--dhcp-renew !!!

Got it. Thanks!

Post Reply