You are not logged in.

#1 2014-11-01 18:40:39

klenamenis
Member
Registered: 2014-07-03
Posts: 101

run program on specific network device

Hey,

some of my programs require using a VPN connection to work, and I'm wondering, how one can instruct a specific program to only run on a specific network device. There are actually two possible scenarios (rather the desired ways to work):

1. I'm browsing the web, fetch my emails, etc. but program X must connect through a VPN, so all my traffic gets routed through the default adapter eth0/enp0s25, except X uses tun0/vpn0
2. I'm using a VPN by default, everything runs through tun0/vpn0, except program X must only be connected via eth0/enp0s25 in order to work.

Both cases happen to me and as of now I'm forced to either 1) route all other traffic through the VPN or 2) stop doing everything until program X can disconnect I can connect to my VPN again.
Can someone help me? Any suggestion would be highly appreciated!

Last edited by klenamenis (2014-11-01 18:41:49)

Offline

#2 2014-11-06 06:37:29

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

Re: run program on specific network device

I just remembered this blog post that i read maybe it helps you, although is kind of complicated solution.

https://www.stgraber.org/2014/09/26/vpn-in-containers/

Maybe configuring some proxies in your computer???

Offline

#3 2014-11-06 06:51:29

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,532

Re: run program on specific network device

Is not that all programs with a network connection may have a proxy configuration ?


do it good first, it will be faster than do it twice the saint wink

Offline

#4 2014-11-06 08:13:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: run program on specific network device

What programs exactly? "Some of my programs", "program X", etc is all a bit vague.

When I used a VPN, I made sure the right traffic went in the right direction by configuring the particular application e.g. I pointed irssi at 10.8.0.1, an irc server within the VPN, and in my fstab, I used 10.8.0.1 to mount the NFS shares within the VPN.

Offline

#5 2014-11-09 02:22:02

klenamenis
Member
Registered: 2014-07-03
Posts: 101

Re: run program on specific network device

I think I'll try to accomplish it using network namespaces. No additional software required, "just" some ip and ifconfig lines.

hydrosIII wrote:

I just remembered this blog post that i read maybe it helps you, although is kind of complicated solution.

https://www.stgraber.org/2014/09/26/vpn-in-containers/

Maybe configuring some proxies in your computer???

I already stumbled across network namespaces and LXC, vpn-container seems to be kind of a front end to that. Thanks for the link, though!

TheSaint wrote:

Is not that all programs with a network connection may have a proxy configuration ?

No, not all, and yes, but there is no possibility for me to use a proxy.

tomk wrote:

What programs exactly? "Some of my programs", "program X", etc is all a bit vague.

When I used a VPN, I made sure the right traffic went in the right direction by configuring the particular application e.g. I pointed irssi at 10.8.0.1, an irc server within the VPN, and in my fstab, I used 10.8.0.1 to mount the NFS shares within the VPN.

Sadly, they don't offer specific network configuration options.

Offline

Board footer

Powered by FluxBB