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.
I have a Debian server which I would like to connect to 2 routers. One to access the internet and the other to be available to other devices on my LAN. The server will use a lot of bandwidth which isn't possible via the router on which my other devices are connected (ISP limitations) so I want internet traffic to go via another router which also is a WAP and functions as a hotspot.
You can see my setup in this image: http://i.imgur.com/Tw39xXG.png
Device1 & 2 (in the image) should be able to connect to my server via router2 and any requests I make with my router to access devices outside of my LAN (=internet) should go via router1.
Somebody here who can point me in the right direction on how to make this possible?
Last edited by arijspieter; 02-09-2014 at 01:15 PM.
No, alternate routing tables are only used for policy routing. All you need to do, is to configure the network interfaces and point the default route to Router1.
Gateways are not set per interface, they are set per routing table, of which you have exactly one.
Several Linux distributions (and Windows) muddle the waters by having a gateway setting among the IP settings for each interface. If Debian does this, just leave the gateway setting under eth0 blank.
I'm not sure to understand exactly what you need. Do you want to configure your debian server to use Router2 as default route EXCEPTED if the queries come from Device1 and Device2, in that case, it must forward the packets through Router1 is that right ?
In that case, I would suggest :
- configure Device1 and Device2 default gateways to Router2
- on router2 configure a source route for every packets comming from Device1 and Device2 to forward it to the debian server
- on the debian server, configure the default gateway to Device1
- on the debian server, configure a source route for all packets comming from the LAN (excepted its own IP address), to be forwarded to Router1
You can configure source routing with iptables -t NAT
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.