LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-09-2014, 01:14 PM   #1
arijspieter
Member
 
Registered: Oct 2012
Location: /home
Distribution: Debian
Posts: 32

Rep: Reputation: 1
Configuring multiple network interfaces


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.
 
Old 02-09-2014, 01:49 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
The "default gateway" setting on the Debian server determines where the server will send traffic destined for non-local networks.

Make sure there's only one gateway setting on the Debian box, and that it points to Router1.
 
2 members found this post helpful.
Old 02-09-2014, 02:21 PM   #3
arijspieter
Member
 
Registered: Oct 2012
Location: /home
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 1
Thanks for your answer. Would I need to setup a second routing table to do this?
 
Old 02-09-2014, 02:24 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
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.
 
Old 02-09-2014, 03:06 PM   #5
arijspieter
Member
 
Registered: Oct 2012
Location: /home
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 1
Tried setting the gateway for eth0 (interface to router2) to 10.117.x.x (ip of default gateway for wlan0) and then ifup wlan0 eth0. This doesn't work
 
Old 02-09-2014, 03:17 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
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.
 
Old 02-10-2014, 07:11 AM   #7
akiuni
Member
 
Registered: Sep 2012
Location: France
Distribution: debian
Posts: 56

Rep: Reputation: Disabled
Hi

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
 
Old 02-11-2014, 03:08 AM   #8
arijspieter
Member
 
Registered: Oct 2012
Location: /home
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 1
I didn't find the solution but I've decided to do things different. Thanks for the help anyway guys.
 
  


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
configuring static IP: questions about /etc/network/interfaces sneakyimp Linux - Server 3 02-18-2011 10:03 AM
Configuring Multiple Interfaces with Separate Parameters fossks Linux - Networking 1 07-26-2008 06:18 PM
configuring network interfaces with udev komuthan Slackware 3 10-08-2006 10:06 AM
Configuring network interfaces..takes AGES! coolblue Linux - Newbie 6 07-20-2005 07:33 AM
What file does debian use for configuring network interfaces? Royle Debian 2 02-10-2005 04:43 PM

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

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