Jump to content
Not connected, Your IP: 18.119.142.210
Flx11

ANSWERED Guide - Fix for TAP adapter in Windows

Recommended Posts

Hello,

Instead of reseting it manually every now and then, now you can do this automatically. And stay/be connected 24/7 through the VPN.
The issue then when trying to connect remotely (e.g. office/other location) to the home computer that's connected to AirVPN.
Your client IP will be reset to 10.3.0.1 or 169.x.x.x. In that case OpenVPN-GUI will still show Connected, but in fact it's not.
1)This small batch file(see below) will ensure that the TAP-adapter will not disconnect.
---------------------------------dhcp.tap.adapter.bat-------------------------------------------
@ECHO OFF
:LOOP
ECHO Waiting for 300 seconds....
timeout /t 300
netsh interface ip set address tapadapter DHCP
netsh interface ip set address tapadapter DHCP
netsh int ip set dns name = "tapadapter" source = dhcp
ipconfig /all
GOTO LOOP
---------------------------------dhcp.tap-adapter.bat-------------------------------------------

2)After the connection has been established to AirVPN(UDP/TCP or OpenVPN over SSL/SSH) run the above file dhcp.tap.adapter.bat.
Run as Admin if elevation is required.
Regards,
Flex

Share this post


Link to post

Thanks for this post

 

Hello,

Instead of reseting it manually every now and then, now you can do this automatically. And stay/be connected 24/7 through the VPN.
The issue then when trying to connect remotely (e.g. office/other location) to the home computer that's connected to AirVPN.
Your client IP will be reset to 10.3.0.1 or 169.x.x.x. In that case OpenVPN-GUI will still show Connected, but in fact it's not.
1)This small batch file(see below) will ensure that the TAP-adapter will not disconnect.
---------------------------------dhcp.tap.adapter.bat-------------------------------------------
@ECHO OFF
:LOOP
ECHO Waiting for 300 seconds....
timeout /t 300
netsh interface ip set address tapadapter DHCP
netsh interface ip set address tapadapter DHCP
netsh int ip set dns name = "tapadapter" source = dhcp
ipconfig /all
GOTO LOOP
---------------------------------dhcp.tap-adapter.bat-------------------------------------------

2)After the connection has been established to AirVPN(UDP/TCP or OpenVPN over SSL/SSH) run the above file dhcp.tap.adapter.bat.
Run as Admin if elevation is required.
Regards,
Flex

Thanks for this post... this does describe the problem I've been having. My tunnel seems to collapse at 11:59 am and pm with at lest one more random time during the day. 

I've done as instructed with the .bat file, now there is a cmd window open and counting down from 300, with "press any key to continue...." do I need to leave that open? 


Thanks again, I hope this keeps my connection on 24/7 with the client.

Share this post


Link to post

I left it running for about 6 hours, but eventually, the tunnel collapsed and the VPN client still thought it was connected. I still have to manually uninstall the tap and then run the VPN client and let it reinstall the tap. 

Share this post


Link to post

Hello !

 

@OP

Good stuff. Maybe you should change to title to include the word "Guide" somewhere, to make it more clear for people.

 

@3vSIM

Are you using the Eddie client by any chance and perhaps with Network Lock? Just curious.


Moderators do not speak on behalf of AirVPN. Only the Official Staff account does. Please also do not run Tor Exit Servers behind AirVPN, thank you.
Did you make a guide or how-to for something? Then contact me to get it listed in my new user guide's Guides Section, so that the community can find it more easily.

Share this post


Link to post

Thanks again, I hope this keeps my connection on 24/7 with the client.

Yes it will. Now you can also change the timeout /t 300. I now have it set to 100 seconds and it works. 

I left it running for about 6 hours, but eventually, the tunnel collapsed and the VPN client still thought it was connected. 

That will happen sometimes. If OpenVPN is diconnected it will just reconnect.

I still have to manually uninstall the tap and then run the VPN client and let it reinstall the tap. 

Then just disable the TAP adapter and Enable it again then reconnect.

 

Share this post


Link to post

I've done as instructed with the .bat file, now there is a cmd window open and counting down from 300, with "press any key to continue...." do I need to leave that open? 

You can minimize it ....let it run in the background.

Yes you need that to stay open.

Share this post


Link to post

As another choice would be to set DNS as static.......for the VPN tunnel.

-------------------------------------------------------------------------------------------------------

@ECHO OFF
:LOOP
timeout /t 60
@ECHO DISABLING IPV6/FLUSH DNS/DISABLE TCP TIMESTAMP(S)
netsh interface ip set address tapname DHCP
netsh int ip set dns name = "tapname" static 89.233.43.71(choose own DNS1)
netsh interface ip add dns name="tapname" 91.239.100.100(choose own DNS2) index=2
ipconfig /flushdns
ipconfig /all
@ECHO Waiting for 60...................... seconds...................................
GOTO LOOP
-----------------------------------------------------------------------------------------------------------------------

Share this post


Link to post

"Waiting for 300 seconds....

Waiting for 283 seconds, press a key to continue ...
The filename, directory name, or volume label syntax is incorrect.


The filename, directory name, or volume label syntax is incorrect."

 

from "dhcp.tap.adapter.bat"

 

I ran the batch file from desktop as administrater.


The filename, directory name, or volume label syntax is incorrect."
 


"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety". Benjamin Franklin

 

Share this post


Link to post

@trott3r

Have you changed the name of your TAP-adapter from "Local Area Network 2" to say "tap"? then modify the .bat file to 

-------------------------------------------------------------------------------------
@ECHO OFF
:LOOP
timeout /t 60
netsh interface ip set address tap DHCP
netsh int ip set dns name = "tap" source = dhcp
ipconfig /flushdns
ipconfig /all
@ECHO Waiting for 60...................... seconds...................................
GOTO LOOP
-------------------------------------------------------------------------------------

Share this post


Link to post

The batch script works in Windows 7/8/8.1/10 etc.

tap.zip

The new file uploaded is based on 4 tap adapters by the name quad/quad1/quad2/quad3....main connection named as lan.

Details:

This ensures 4 udp/tcp vpn connections keep-alive/and keep running...thx to the new introduced fancy Devices/Keys.

I run 4 UDP connections side by side.

Each connection has its own new key created under Devices/Keys.

You can modify the file any way you like according to your own configuration.

Regards and happy browsing,

Flx

Share this post


Link to post

for your torrent client an extra step will be needed

In Comodo Firewall-Rulesets block.lan.wifi.ipv6. BY mac and iP.

Example

1.

post-98252-0-55602600-1547245393_thumb.jpg

 

2.

block_new.thumb.jpg.ed72fd6e301f2255536f165308410b51.jpg

The 2 "examples" that you see above either one will work just fine.

You can expand the list depending on your config/system.

Regards,

Flx

block.lan.wifi.ipv6.tap.ipv6.fe80.jpg

Share this post


Link to post

OP do you think this would work for when:

 

OpenVPN > TEST ROUTES: 0/0 succeeded len=-1 ret=0 a=0 u/d=down . 2018.02.07 18:55:16 - OpenVPN > Route: Waiting for TUN/TAP interface to come up...

 

?


Moderators do not speak on behalf of AirVPN. Only the Official Staff account does. Please also do not run Tor Exit Servers behind AirVPN, thank you.
Did you make a guide or how-to for something? Then contact me to get it listed in my new user guide's Guides Section, so that the community can find it more easily.

Share this post


Link to post

Yup....in Global Rules...add this at the top of your Rules already defined....image example

Quote

OP do you think this would work for when:

 

OpenVPN > TEST ROUTES: 0/0 succeeded len=-1 ret=0 a=0 u/d=down . 2018.02.07 18:55:16 - OpenVPN > Route: Waiting for TUN/TAP interface to come up...

where quad.mac is the mac address of your quad tap adapter found in Network Zones->quad.mac.

and where tap.mac or tapall.mac in Network Zones->tap.mac or tapall.mac zone which contains all your tap adapter mac addresses.

post-98252-0-25036500-1518043235_thumb.jpg

@LZ1 this should fix/resolve your problem.

Regards,

Flx

Share this post


Link to post

Don't know if it helps... but I'm using this .bat on my connection with lot of disconnects and client/TAP adapters hangs with great success

Replace VPN with the name of your TAP inteface

 

This is the script that runs on VPN down

 

@echo off
netsh interface set interface VPN admin=disable
timeout /t 2 /nobreak
netsh interface set interface VPN admin=enable
timeout /t 2 /nobreak
taskkill /IM AirVpn.exe /F
taskkill /IM openvpn.exe /F
timeout /t 5 /nobreak
start "" "C:\Program Files\AirVPN\AirVPN.exe" & exit
 

Share this post


Link to post
Posted ... (edited)

but I'm using this .bat on my connection with lot of disconnects

Your connection client to the AirVPN server just drops and tries to do a reconnect....in Eddie?

@echo off

netsh interface set interface VPN admin=disable

timeout /t 2 /nobreak

netsh interface set interface VPN admin=enable

 

netsh interface ip set address VPN DHCP

netsh int ip set dns name = "VPN" source = dhcp

timeout /t 2 /nobreak

taskkill /IM AirVpn.exe /F

taskkill /IM openvpn.exe /F

timeout /t 5 /nobreak

start "" "C:\Program Files\AirVPN\AirVPN.exe" & exit

Just make sure that VPN/TAP adapter is in DHCP mode.(See above)

Edited ... by Flx

Share this post


Link to post

Hello,

you may also consider this as an extra partial choice:

----------------------------------------------------------------------------------------------
netsh int tcp set global timestamps=disabled
netsh interface ipv6 set privacy state=disable
netsh interface ipv6 6to4 set state state=disabled
netsh interface ipv6 isatap set state state=disabled
netsh interface ipv6 set teredo disabled

-----------------------------------------------------------------------------------------------

Regards,

Flx

Share this post


Link to post

Windows 10 breaking the tap adapter:

1.If you have Comodo A/V Firewall and Windows OS as your config...turn WIndows Firewall OFF.

Windows Defender can run side by side with Comodo.(Your choice)

2.Before/After you manage to connect to an AirVPN server.

Use one of the scripts provided to fix this TAP issue.

You can use Eddie app or native OpenVPN(2 or more connections/sessions).

The batch scripts do exactly that(e.g. Prevent WIndows to break the VPN connection/tap adapter)

3.Disable in gpedit.msc anything you do not need (Store/maps/Telemetry etc)

4.Comodo-Rules.Set a local rule...

Block/Prevent any app/wermgr.exe/System/WIndows Operating System process to send data to (e.g. Microsoft) for port 80/443/ etc.

post-98252-0-41248300-1522931132_thumb.jpg

5.In Network Zone-->>Blocked Zones---->Block the default gateway(e.g. xxx.xxx.2.1) from main adapter before/after you connect.
6.Set a master password in/for Comodo. Only the person that knows the password set will be able to do any actual changes (e.g. Disable the Firewall etc.)

Regards,

Flx

Share this post


Link to post

FOR------------svchost.exe----------------

where svc.block contains the blocked ports 80/443/others

---------------------------------------------------

SET dllhost.exe/dashost.exe/explorer.exe/etc. as local (above example how to do so)

 

Comodo Global Rules https://airvpn.org/topic/3405-windows-comodo-prevent-leaks/ is only the minimum/beginner needed.

Regards,

Flex

 

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...