Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.