LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-17-2005, 04:41 PM   #1
godong
LQ Newbie
 
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
Connecting 2 routers


Hi,

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


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

Other Devices:

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

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

client 1 (192.168.1.3) -> to Router A
client 2 (10.1.1.3) -> 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 : 10.1.1.0
Destination Netmask : 255.255.255.0
Gateway : 192.168.1.2

router B:
Destination Network : 192.168.1.0
Destination Netmask : 255.255.255.0
Gateway : 10.1.1.2

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.

Thanks.

Last edited by godong; 02-17-2005 at 04:46 PM.
 
Old 02-17-2005, 06:07 PM   #2
cowanrl
Member
 
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 192.168.1.2. 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 10.1.1.2.
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.
 
  


Reply


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 06:57 PM
can i have more than 1 routers? dimgr Linux - Wireless Networking 19 11-21-2004 02:47 PM
connecting 2 routers together... dissolved soul Linux - Wireless Networking 2 07-29-2004 04:11 AM
routers ralisch General 16 07-18-2003 04:14 PM
Mysql is not connecting from servlet.But connecting from java, help pls Harish_f Linux - General 0 05-08-2002 04:21 AM


All times are GMT -5. The time now is 06:33 PM.

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