Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


Search this Thread
Old 05-18-2009, 09:14 PM   #1
Registered: May 2006
Distribution: Fedora
Posts: 57

Rep: Reputation: 15
Routing table for 2 servers.

Hello to everyone,

My question is about routing tables using "ip route 2"

Here's the deal:

I have a server(server1 from now on) with eth0(internet connection) and eth1(lan connection).
eth1 have 2 more alias devices = eth1:1 and eth1:2

On my server 1 the eth0=public ip, on eth1=, eth1:1= and eth1:2=

server1 is running squid and iptables to all 3 networks (eth1, eth1:1 and eth1:2) All of the clients have access to internet.

Now what i want to do is add 3 more networks via a router(linuxBox = server2 from now on) connected to server1 in eth1.

so the network will be like this:
 eth1= (connected to server2 and other clients)

clients on eth1 in server1

 eth0= (this one connect to server2)
 eth1= (this connected to clients)

clients on eth1 in server2
The problem is how do i route all traffic from networks to server1 so that server1 continues to be the internet server and responds to the network routed from server2 ?.

so that i can put the following configuration on clients c5,c6 and c7:
ip= an so on...
server2 will only work for routing and a little of firewall.

I have research for info on this, but without any success.
Have try this commands on server2
ip route add via dev eth0
ip route add via dev eth1
The iptables in server2 is clean an with policy ACCEPT for all.

Please help, if you need more info just ask please
Old 05-18-2009, 11:45 PM   #2
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Seems to me that you need two things:

1. server2 should have as its gateway.
2. server1 needs to have a static route to the network (via
You can use "ip route add" manually, but it's better to use config files like this if possible.
Old 05-19-2009, 02:40 PM   #3
Registered: May 2006
Distribution: Fedora
Posts: 57

Original Poster
Rep: Reputation: 15

Thanks for the info Berhanie

It was exactly like you say, i was going on the other way XD

Thanks again


routing, server

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
routing table scofiled83 Linux - Networking 1 11-08-2008 08:40 PM
routing table selie Linux - Networking 2 05-04-2007 10:12 AM
routing table arvind kumar Linux - Networking 2 06-09-2005 12:59 AM
Help with a Routing Table maginotjr Linux - Networking 4 06-06-2005 10:49 AM
routing table upr8830 Linux - Networking 6 06-18-2003 04:04 AM

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

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