LinuxQuestions.org
Review your favorite Linux distribution.
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 11-15-2007, 05:59 PM   #1
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Rep: Reputation: 15
Using two nics, telling programs which to use


Here's my "problem". I live near my school, and I can pick up a very good wireless signal, I would like to use its high speed connection as much as possible. I also have cheap dsl, which is not very fast.

The school naturally has a bunch (almost all) ports blocked, so I would like to use the dsl for apps that need certain ports, and the schools connection for things like ftp.

I'm considering going out and buying a second nic. My question is, suppose that I get both nics to work, one connected to school with ip 1.1.1.1 and the other connected to dsl with ip 192.xxx.xxx.xxx behind router with ip 2.2.2.2 .

Is there a way to tell programs which nic they need to use? For instance, I want to be able to ssh into my machine from somewhere else, which means I would need port forwarding, which means I would need to ssh to the dsl assigned IP. Then, while remotely logged in, I want to be able to use ftp over the schools much faster connection.

If anyone can point me in the right direction I would be thrilled.
 
Old 11-15-2007, 06:26 PM   #2
lcole
Member
 
Registered: Aug 2003
Location: Oregon
Distribution: Ubuntu
Posts: 51

Rep: Reputation: 18
It is easy to route based on destination. Find the IP address of your FTP destination then add a route that directs it over the schools Gateway. You can make it permanant or temporary but all services will be routed for that address while the route is active, not just FTP.
 
Old 11-15-2007, 06:44 PM   #3
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Original Poster
Rep: Reputation: 15
That is a good idea, but what about applications like bittorrent? I don't want it to get confused as to which nic to use, because that would kill its performance.

Can I add a default gateway, say the dsl line, so that bittorrent will be sure to use it no matter where I'm trying to connect?
 
Old 11-15-2007, 07:03 PM   #4
lcole
Member
 
Registered: Aug 2003
Location: Oregon
Distribution: Ubuntu
Posts: 51

Rep: Reputation: 18
You should have the default gateway and that will be used for everything that is not explicitly routed. The explicit route(s) will take precedence for the defined destinations for all services.
 
Old 11-16-2007, 04:42 PM   #5
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
In addition to assigning using plain-old routing tables, you can also use iptables to mark packets, and later use those marks for routing. You can use l7-filter for “smart” matching (to regular expressions or magic bytes), but if you are doing bittorrenting yourself, you probably already know the port, so you can mark based on that.
 
Old 11-16-2007, 06:41 PM   #6
flyco
LQ Newbie
 
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0
use l7-filter for “smart” matching ,have to say looks very good ..
 
  


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
What is this Firewall telling?? aq_mishu Linux - Security 3 11-15-2007 06:31 PM
Just telling everyone who I am Thedrew87 LinuxQuestions.org Member Intro 1 10-01-2006 04:26 PM
Telling FC 5 what TV Tuner I have fstab Linux - Hardware 2 08-01-2006 05:31 PM
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 02:30 PM
what is this error telling me? cadkins Linux - Newbie 1 03-18-2004 11:53 PM

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

All times are GMT -5. The time now is 07:26 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