Turn VPN on/off before/after download in Linux?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
absteeve
Newbie
Newbie
Posts: 21
Joined: January 3rd, 2014, 12:57 pm

Turn VPN on/off before/after download in Linux?

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Turn VPN on/off before/after download in Linux?

Post 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.
absteeve
Newbie
Newbie
Posts: 21
Joined: January 3rd, 2014, 12:57 pm

Re: Turn VPN on/off before/after download in Linux?

Post 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.
absteeve
Newbie
Newbie
Posts: 21
Joined: January 3rd, 2014, 12:57 pm

Re: Turn VPN on/off before/after download in Linux?

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Turn VPN on/off before/after download in Linux?

Post 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?
Post Reply