LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2013, 09:08 PM   #1
rcketscientist
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Rep: Reputation: Disabled
Dual ethernet routing


I'm looking to build a home server that will serve as an HTPC as well as a web/media server. Some of the data is on a separate VPN network. I'd therefore like to have access to both my direct network and my VPN network (two routers) at the same time, but for different applications.

I'm fairly certain I can do this with a virtual NIC in a VM, but I'm wondering if Linux will offer a more elegant solution.

Assuming dual NIC with one network on each is there a way in linux to route specific apps to a specific NIC? I'd like most network traffic to be direct, while specific apps get routed through the VPN.

I've had no luck searching for such a specific use case. I really appreciate any help. Thanks!

Last edited by rcketscientist; 05-27-2013 at 09:20 PM.
 
Old 05-27-2013, 09:15 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

have you considered using a socks proxy instead of a vpn?

Cheers,

Evo2.

Last edited by evo2; 05-27-2013 at 09:31 PM.
 
Old 05-27-2013, 09:18 PM   #3
rcketscientist
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
That's not my question at all. As noted in the post my question is related to managing two networks with two NICs on a per app basis.
 
Old 05-27-2013, 09:25 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by rcketscientist View Post
That's not my question at all. As noted in the post my question is related to managing two networks with two NICs on a per app basis.
Great.

Sorry, can't help with a 2 nic setup that but you could achieve something similar (and only requiring one nic), with a socks proxy using ssh with -D. Then, any programs that you want to use the proxy (that don't natively know how to use a socks proxy) can be run under tsocks.

HTH,

Evo2.
 
Old 05-27-2013, 09:50 PM   #5
rcketscientist
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply. I'm a complete noob on routing and I looked into the socks proxy, but I don't quite understand how that would get me on the VPN network.

Would the proxy basically be a tunnel to the VPN server?
Is the ssh acquiring the VPN connection?
And in Linux I can specify use of the tunnel on a per-app basis?

Do you have any recommended reading material online? Thanks!
 
Old 05-27-2013, 10:01 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

Quote:
Originally Posted by rcketscientist View Post
Thanks for the quick reply. I'm a complete noob on routing and I looked into the socks proxy, but I don't quite understand how that would get me on the VPN network.
No problem.

Quote:
Would the proxy basically be a tunnel to the VPN server?
Yes, but that machine does not need to be running a VPN server, just sshd.
Quote:
Is the ssh acquiring the VPN connection?
The tunnel/proxy is created by ssh.
Quote:
And in Linux I can specify use of the tunnel on a per-app basis?
Yes.

Quote:
Do you have any recommended reading material online? Thanks!
I don't know of any, but it is pretty trivial.

To set up the tunnel from your local machine "my.home.com" to the remote host, called "my.remote.com", you would do:
Code:
ssh -f -N -D localhost:6666 my.remote.com
Now, port 6666, on my.home.com provides a socks proxy to my.remote.com. So, for example you could then configure your web browser to use this (I do this with chromium). For other progarms that don't know how to use a socks proxy you can use of tsocks. So, on my.home.com you'd have an /etc/tsocks.conf that contains:
Code:
server 127.0.0.1
server_port 6666
Then you would launch the program like:
Code:
tsocks someprogram
Cheers,

Evo2.
 
1 members found this post helpful.
Old 05-28-2013, 09:38 PM   #7
rcketscientist
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Wow thanks for the extremely detailed response. That all makes perfect sense now. A lot simpler than using two networks anyway. Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] routing via an ethernet card mmhs Linux - Networking 3 10-02-2010 07:56 AM
Routing 52bps modem to ethernet - fedora ismithf Linux - Networking 2 08-30-2006 07:04 AM
routing through two ethernet SpY MaN Linux - Networking 10 04-28-2006 12:34 PM
Routing between a wired ethernet (internet connection) and a wireless card (home net) ner0 Linux - Wireless Networking 8 11-29-2004 01:12 AM
routing between wireless and ethernet puppetmaster Linux - Wireless Networking 1 07-24-2003 07:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration