Page 1 of 1
Turn VPN on/off before/after download in Linux?
Posted: January 3rd, 2014, 12:59 pm
by absteeve
Not sure if nobody's ever asked this, or if there is a minimum character limit for this forum's search ("vpn" gets zero hits)... probably the latter.
Anyway, are there any hooks or anything so that I can turn my VPN on right before a download starts and turn it off right after it ends, and have it fail (or pause) if the VPN fails to start?
Thanks.
Re: Turn VPN on/off before/after download in Linux?
Posted: January 3rd, 2014, 2:35 pm
by sander
Why do you want this? If you want to route your newsserver traffic through a VPN, it's maybe better to only do that: sudo ip route add <newsserver> via <vpn-interface>, and keep your default route to your local gateway.
Re: Turn VPN on/off before/after download in Linux?
Posted: January 3rd, 2014, 3:49 pm
by absteeve
You can do that!? Lol... you wouldn't believe how much I searched and asked on linux forums, etc... never got a hint like that till now! Thank you sir.
Re: Turn VPN on/off before/after download in Linux?
Posted: January 3rd, 2014, 3:53 pm
by absteeve
Hmm... although... how do I find out what "vpn-interface" is? Sorry, I'm not very familiar with networking or linux in general so I'm just limping along. If I don't have the VPN currently active, ifconfig (or ip -a or whatever) doesn't list my tun0... its only there when I have the vpn active, but then all traffic is going through it. The problem with that... well, that's no problem IF it were reliable, but I'm finding that if I have the VPN active full time that I lose the connection randomly about 2 or 3 time a day.
If you can hold my hand, just a little more... it'd be appreciated. Meanwhile, I'll use your tips above to try to find it on my own. Thanks again.
Re: Turn VPN on/off before/after download in Linux?
Posted: January 4th, 2014, 2:16 am
by sander
absteeve wrote:You can do that!? Lol... you wouldn't believe how much I searched and asked on linux forums, etc... never got a hint like that till now! Thank you sir.
Can you give the pointers/URLs to the forum where you asked?