D
Deleted member 27741
Guest
This is obviously for those who redirect all internet traffic.
Openvpn does not do a good job of telling you when your tunnel is down this can be annoying! This will remove the default route to your router, so that when your openvpn tunnel goes down, your internet is cut off.
In the same directory that your ovpn file is located, create a file. The file format is: xxx_up.bat
you substitute the name (before .ovpn) of your ovpn file for xxx.
In that file, type the following command and save-
route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1
Substitute the ip address of YOUR router for 192.168.1.1 if it is different!!
When your tunnel connects the default route to your router is deleted. If the tunnel goes down you will no longer have internet access. If you want the internet back, reboot or run cmd.exe as an admin and type in the command:
route add 00.0.0 mask 0.0.0.0 192.168.1.1
Again, substitute the ip address of your router for 192.168.1.1 if it is different.
***Do note that if your tunnel does go down, you will have to add the route back to reconnect as you will have no internet access (DNS won't work).
Of course, you can use the xxx_up.bat file to execute other commands. There is also xxx_pre.bat and xxx_down.bat. I have not tested this extensively, so if you try it out let me know how it goes. Do note that all the routing changes go away if you reboot, so there is no worry playing with routes this way. However, using route with the -p flag makes route changes persist across boots, something I would not advise you do unless you are pretty good (much better than myself) at routing.
Openvpn does not do a good job of telling you when your tunnel is down this can be annoying! This will remove the default route to your router, so that when your openvpn tunnel goes down, your internet is cut off.
In the same directory that your ovpn file is located, create a file. The file format is: xxx_up.bat
you substitute the name (before .ovpn) of your ovpn file for xxx.
In that file, type the following command and save-
route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1
Substitute the ip address of YOUR router for 192.168.1.1 if it is different!!
When your tunnel connects the default route to your router is deleted. If the tunnel goes down you will no longer have internet access. If you want the internet back, reboot or run cmd.exe as an admin and type in the command:
route add 00.0.0 mask 0.0.0.0 192.168.1.1
Again, substitute the ip address of your router for 192.168.1.1 if it is different.
***Do note that if your tunnel does go down, you will have to add the route back to reconnect as you will have no internet access (DNS won't work).
Of course, you can use the xxx_up.bat file to execute other commands. There is also xxx_pre.bat and xxx_down.bat. I have not tested this extensively, so if you try it out let me know how it goes. Do note that all the routing changes go away if you reboot, so there is no worry playing with routes this way. However, using route with the -p flag makes route changes persist across boots, something I would not advise you do unless you are pretty good (much better than myself) at routing.
Last edited by a moderator: