Latest LQ Deal: Linux Power User Bundle
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 02-17-2005, 03:41 PM   #1
LQ Newbie
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
Connecting 2 routers


I tried to setup a linux server to route packets between 2 routers, here is my configuration:

Linux Server:
eth 0 ( -> to Router A
eth 1 ( -> to Router B

Other Devices:

router A ( -> client 1 and linux server connected to it's LAN

router B ( -> client 2 and linux server connected to it's LAN

client 1 ( -> to Router A
client 2 ( -> to Router B

Both routers doesn's have internet connection (WAN port is not used), I want to be able to connect client 1 to client 2 without internet connection. To do so, I want the linux server to act as the router between this 2 private networks. Right now client 2 is invisible to client 1, but client 1 and client 2 are both visible to the linux server. I added an entry for static routes on both routers:

router A:
Destination Network :
Destination Netmask :
Gateway :

router B:
Destination Network :
Destination Netmask :
Gateway :

The Gateways are the IP addresses of the Linux server, my problem now is that it didn't work, I believe I need to set some rules to forward the packet from eth 0 to eth 1, vice versa. Anyone have any suggestion on what should I do (Perhaps some iptables rules, or routed)? I'm running Linux Enterprise AS 3.0.


Last edited by godong; 02-17-2005 at 03:46 PM.
Old 02-17-2005, 05:07 PM   #2
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150

Rep: Reputation: 15
In your set up there, you have no need for routers A and B. Eth0 of the Linux server and client1 can both connect to the same switch or hub. Client1's default gateway should be eth0's IP address of Eth1 of the Linux server and client2 can both connect to the same hub or switch. Client2's default gateway dould be eth1's IP address of
To start the Linux server forwarding packets between eth0 and eth1, enter this command as root:

echo 1 > /proc/sys/net/ipv4/ip_forward

For routerA and routerB to actually be routers, they'll need to have 2 interfaces on them with IP addresses on different subnets.


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
Digikam connecting as root/not connecting as regular user jayhel Slackware 5 09-29-2005 05:57 PM
can i have more than 1 routers? dimgr Linux - Wireless Networking 19 11-21-2004 01:47 PM
connecting 2 routers together... dissolved soul Linux - Wireless Networking 2 07-29-2004 03:11 AM
routers ralisch General 16 07-18-2003 03:14 PM
Mysql is not connecting from servlet.But connecting from java, help pls Harish_f Linux - General 0 05-08-2002 03:21 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration