Jump to content


Photo
- - - - -

Guide - Fix for TAP adapter in Windows

TAP issue disconnect

  • Please log in to reply
51 replies to this topic

#1 Flx11

Flx11

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 12 April 2016 - 09:00 PM

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


  • LZ1 likes this

#2 3vSIMdRVv6Q1TmbFsIiP8QV8

3vSIMdRVv6Q1TmbFsIiP8QV8

    Member

  • Members
  • PipPip
  • 16 posts

Posted 23 September 2016 - 07:00 PM

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.



#3 3vSIMdRVv6Q1TmbFsIiP8QV8

3vSIMdRVv6Q1TmbFsIiP8QV8

    Member

  • Members
  • PipPip
  • 16 posts

Posted 24 September 2016 - 03:02 AM

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. 



#4 LZ1

LZ1

    It's nice to be nice to nice people

  • Moderators
  • 1891 posts

Posted 25 September 2016 - 10:33 PM

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.


Hi there, are you new to AirVPN? Many of your questions are already answered in this guide. Its Guides Section has guides on Linux/Torrenting/Blocked sites & many other topics too.
Moderators do not speak on behalf of AirVPN. Only the Official Staff account does. Please read the First Questions section in the link above for more details, 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.

Tired of Windows? Why Linux Is Better.

#5 Flx11

Flx11

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 26 September 2016 - 06:18 PM

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.

 



#6 Flx11

Flx11

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 25 November 2016 - 06:10 PM

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.



#7 Flx11

Flx11

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 23 December 2016 - 06:39 PM

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
-----------------------------------------------------------------------------------------------------------------------


#8 trott3r

trott3r

    Member

  • Members
  • PipPip
  • 17 posts

Posted 27 December 2016 - 05:35 PM

"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

 


#9 Flx11

Flx11

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 27 December 2016 - 06:31 PM

@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
-------------------------------------------------------------------------------------


#10 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 February 2018 - 12:57 PM

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

You will see this when the tap adapter does not exist or it is under a different name.



#11 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 February 2018 - 01:24 PM

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

Attached File  tap.zip   391bytes   160 downloads

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,

FlxAttached File  tap.zip   391bytes   160 downloads



#12 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 February 2018 - 01:46 PM

connections side by side.

for each connection you will need to pick a different port 443/53/80/2018



#13 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 February 2018 - 02:16 PM

Ah...almost forgot....for your torrent client an extra step will be needed

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

Example"

 

 

Untitled.jpg



#14 LZ1

LZ1

    It's nice to be nice to nice people

  • Moderators
  • 1891 posts

Posted 07 February 2018 - 08:23 PM

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...

 

?


Hi there, are you new to AirVPN? Many of your questions are already answered in this guide. Its Guides Section has guides on Linux/Torrenting/Blocked sites & many other topics too.
Moderators do not speak on behalf of AirVPN. Only the Official Staff account does. Please read the First Questions section in the link above for more details, 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.

Tired of Windows? Why Linux Is Better.

#15 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 07 February 2018 - 10:40 PM

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

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...

global.rules1.jpg

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.

@LZ1 this should fix/resolve your problem.

Regards,

Flx


  • LZ1 likes this

#16 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 02 April 2018 - 03:43 PM

An update on the tap.bat Including IPV6 details etc.

Enjoy,

Flx

Attached Files



#17 sh4rp87

sh4rp87

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 03 April 2018 - 07:34 PM

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
 


#18 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 April 2018 - 01:24 AM

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, 02 August 2018 - 03:07 AM.


#19 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 04 April 2018 - 06:30 AM

Hello,

you may also consider this as an extra partial choice:

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

@title DISABLING IPV6/DISABLE TCP TIMESTAMP(S)
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



#20 Flx

Flx

    Advanced Member

  • Members2
  • PipPipPip
  • 170 posts

Posted 05 April 2018 - 12:38 PM

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 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.

Untitled.jpg

Most of you know how.

5.In Network Zone-->>Blocked Zones---->Block the default gateway(e.g. xxx.xxx.2.1) from main adapter before/after you connect.

I hope this helps,

Flx







Similar Topics Collapse

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Servers online. Online Sessions: 14215 - BW: 52287 Mbit/sYour IP: 54.226.36.60Guest Access.