LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-31-2008, 02:11 PM   #1
core09
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Routing Between Lans


Hi All,

I'm trying to setup a router which will route traffic between the following networks 10.0.0.0 and 172.16.0.0

The network is setup like this:

laptop ip 172.16.0.2 --lan/switch-- eth1 172.16.0.1 router A eth0 10.0.0.2 ---lan/switch--- eth0 10.0.0.1 router B eth1 inet ip.

I have added the following on router B

route add -net 172.0.0.0 netmask 255.255.255.0 dev eth0
route add -net 172.0.0.0 netmask 255.255.255.0 gw 172.16.0.1

router A

route add -net 10.0.0.0 netmask 255.255.255.0 dev eth0
route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.20

I can ping router a's ip 10.0.0.1 from a machine behind router a and can ping from router b to 172.16.0.1

Machines on the 10 subnet have 10.0.0.1 set as thier gw.

The problem is I cannot ping any lan machines on the 10 subnet from the laptop 172.16.0.2 sitting behind router A 172.16.0.1 subnet and its the same from the 10.0.0.0 subnet with out adding a static route on each machine.

Any ideas?

core09

Last edited by core09; 08-31-2008 at 02:23 PM.
 
Old 09-01-2008, 05:43 PM   #2
normscherer
Member
 
Registered: Sep 2005
Location: Prescott, AZ
Distribution: Ubuntu Mate 18 LTS
Posts: 50

Rep: Reputation: 15
I am a little confused by your configuration. You have two routers where I only see the need for one. Is there a third network hiding somwhere? The function of a router is to move traffic from one network (like your 10 network) to another network (like your 172 network). I would expect you to have only one router with one net on eth0 and the other net on eth1.

I would set up your net with a switch/hub connected to each of the interfaces on one router and then approach your routing.
 
Old 09-01-2008, 06:58 PM   #3
beadyallen
Member
 
Registered: Mar 2008
Location: UK
Distribution: Fedora, Gentoo
Posts: 209

Rep: Reputation: 36
I'm guessing you've got the second router since you've technically got 3 networks (10.x, 172.x and t'internet). However, normsherer is right, you could get away with just one router. It all depends on the physical locations of the machines.

Anyway, back to the problem at hand. Have you enabled ip forwarding on the routers?
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
Also, I assume it's a typo in router A's gateway specification (10.0.0.20?)

If the forwarding isn't the problem, post the result of running 'route -n' on all the machines. Enclose the results in [CODE] tags to make them readable.
 
  


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
how to connect two lans? DrKranium Linux - Networking 3 08-27-2006 12:09 PM
Problem in routing between two LANs burrito Linux - Networking 2 07-03-2005 08:33 PM
Routing through 2 LANs LeifWiderberg Linux - Networking 3 03-12-2004 11:00 AM
iptables and ftp from the LANs fddi1 Linux - Networking 4 10-17-2001 12:19 PM
LANs andymay27 Linux - Networking 1 10-14-2001 02:14 PM

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

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