In response to the following from Mike Easter:
> This askub does not address the drop protection/ killswitch issue; since
> NM network manager doesn't have a built-in 'killswitch' for VPN.
I know you know this Mike Easter, and I realize you're purposefully helpful
(unlike nospam), so I'll just let the others know that if they search for
Marek Novotney's posts on a killswitch, they'll find them in a.o.l, where,
I think, he had named it something like 'vpnkill' or something like that.
http://tinyurl.com/alt-os-linux
The use model Marek came up with was to let the user define the apps he
wanted killed when the VPN dropped out, such as torrent apps, or web
clients or MUAs, or whatever the user considered sensitive.
Then Marek spent a *lot* of effort finding the *fastest* way to kill those
apps, where it took quite a few iterations, as I recall, for him to come up
with something that worked great on Linux.
> That is just a pointer to GG for a.o.l. which GG search functions are
> much deprecated.
Hehhehheh... do you have something better?
(HINT: Complaining about the weather isn't helpful.)
> The earlier Marek scripts for drop protection are not extant.
I'm *sure* they're on a.o.l tribal knowledge archives since I know I posted
everything that Marek gave us as I tested them. So they *are* there, at
least twice for each script functionality.
There were many functionalities, as I recall, such as the wget script that
ran daily to download the ever changing VPN configuration files, to the
geolocation script that renamed them by country and city, and the testing
script that tested each one on the fly daily to put the "good" ones in a
pile (bearing in mind the good ones and bad ones flipflopped all the time),
to scripts for testing the network speeds, etc.
All those scripts should still be there in the tribal knowledge archives.
> Here is one article suggesting using UFW uncomplicated firewall to
> function to prevent any traffic other than the VPN and setting up a
> couple of scripts to do it and undo it. The author previously proposed
> VPNDemon script to monitor the NM connection and disconnect, but it
> wasn't consistently successful.
Yup. We have a thread, which I think you were part of, on the Windows ng,
as I recall, covering all the ways you can kill things when the VPN drops.
The firewall method was one of them.
On Windows, I use the LiquidVPN killswitch - but to each their own.
@echo off
:: GetAdmin
:-------------------------------------
:: Verify permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
:: On Error No Admin
if '%errorlevel%' NEQ '0' (
echo Getting administrative privileges...
goto DoUAC
) else ( goto getAdmin )
:DoUAC
echo Set UAC = CreateObject^("Shell.Application"^) >
"%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >>
"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:getAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
@echo off
:: CHANGE DEFAULT GW IP BELOW
set defgw=192.168.0.1
@For /f "tokens=3" %%1 in (
'route.exe print 0.0.0.0 ^|findstr "\<0.0.0.0.*0.0.0.0\>"') Do set
defgw=%%1
cls
:start
cls
echo.
color 0C
echo LiquidVPN's Simple VPN Kill Switch, ver. 0.1 - by LiquidVPN
echo.
echo.
echo Your routers gateway is probably "%defgw%"
echo -if nothing appears or its incorrect, add it manually (Press '3')
echo.
echo USAGE:
echo.
echo -Press "1" to Enable Kill Switch (IP "%defgw%")
echo -Press "2" to Disable Kill Switch (IP "%defgw%")
echo -Press "3" to manually set default gateway if its not detected above.
echo -Press "h" for Kill Switch Help
echo -Press "x" to exit Kill Switch.
echo.
set /p option=Your option:
if '%option%'=='1' goto :option1
if '%option%'=='2' goto :option2
if '%option%'=='3' goto :option3
if '%option%'=='x' goto :exit
if '%option%'=='h' goto :help
echo Insert 1, 2, x or h
timeout 3
goto start
:option1
route delete 0.0.0.0 %defgw%
echo Default gateway "%defgw%" removed
timeout 3
goto start
:option2
route add 0.0.0.0 mask 0.0.0.0 %defgw%
echo Defaulte gateway "%defgw%" restored
timeout 3
goto start
:option3
echo
set /p defgw=your gw IP (e.g. 192.168.0.1):
goto start
:help
cls
echo.
echo.
echo ======================
echo This simple kill switch removes your default gateway
echo and blocks traffic from reaching the internet when
echo your VPN gets disconnected.
echo.
echo Here is how you use it.
echo.
echo Step 1: Connect to LiquidVPN
echo Step 2: Enable LiquidVPN's Kill Switch (option "1")
echo.
echo Now Any internet traffic will pass through LiquidVPN only.
echo.
echo - If your VPN gets disconnected so will your internet.
echo - Disable the Kill Switch and reconnect.
echo.
echo.
echo When you disconnect from LiquidVPN follow these steps
echo to reconnect or to browse the internet normally.
echo.
echo Step 1: Close any software that may leak your real IP
echo Step 2: Disable the LiquidVPN kill switch (Option "2")
echo Step 3: Reconnect to LiquidVPN and enable the kill switch (Option "1")
echo.
timeout /T -1
goto start
:exit
exit
I would have set up a firewall if Marek didn't already write the scripts I
used for years for me before I knew about the firewall.
I agree with you that the firewall is a good idea.
Do you think it is a good approach for Android?
Or just Windows & Linux?
> Perhaps the vpndemon's weakness was related to a greater 'fail'
> sequence, ie not detecting a 'disconnect' *instantly*.
As I recall, Marek spent a *lot* of time detecting a failure as quickly as
possible. I tested all his scripts that he posted, where in the beginning,
I told him they were too slow and he vastly improved the speed such that I
was satisfied in the end.
I sure hope Marek the best, as none of us have heard from him in a very
long time so we hope he's fine, especially after his medical emergencies.