LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-18-2009, 08:14 PM   #1
Ronin_tekorei
Member
 
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=192.168.10.1/24, eth1:1=192.168.20.1/24 and eth1:2=192.168.30.1/24

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:
Code:
server1
 eth0=internet
 eth1=192.168.10.1/24 (connected to server2 and other clients)

clients on eth1 in server1
 c1=192.168.10.10/24
 c2=192.168.10.20/24
 c3=192.168.10.30/24
 c4=server2

server2
 eth0=192.168.10.254/24 (this one connect to server2)
 eth1=192.168.40.254/24 (this connected to clients)

clients on eth1 in server2
 c5=192.168.40.10/24
 c6=192.168.40.20/24
 c7=192.168.40.30/24
The problem is how do i route all traffic from networks 192.168.40.0/24 to server1 so that server1 continues to be the internet server and responds to the network 192.168.40.0/24 routed from server2 ?.

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

I have research google.com for info on this, but without any success.
Have try this commands on server2
Code:
ip route add 192.168.10.0/24 via 192.168.10.254 dev eth0
ip route add 192.168.40.0/24 via 192.168.40.254 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, 10:45 PM   #2
Berhanie
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 192.168.10.1 as its gateway.
2. server1 needs to have a static route to the 192.168.40.0/24 network (via 192.168.10.254).
You can use "ip route add" manually, but it's better to use config files like this if possible.
 
Old 05-19-2009, 01:40 PM   #3
Ronin_tekorei
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 57

Original Poster
Rep: Reputation: 15
Ready

Thanks for the info Berhanie

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

Thanks again
 
  


Reply

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


All times are GMT -5. The time now is 07:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration