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 07-02-2006, 03:36 PM   #1
kewlemer
LQ Newbie
 
Registered: Apr 2005
Location: Los Angeles, CA
Posts: 20

Rep: Reputation: 0
Static Routing Problem


I am trying to have box A and box C communicate on a set up like this :-

Code:
------------------------------------------------------
[Box A] <==========> [Box B] <===========> [Box C]
------------------------------------------------------
192.168.1.103<---->192.168.1.101    
255.255.255.0      255.255.255.0
eth0               eth1
------------------------------------------------------
                   192.168.2.1<--------> 192.168.2.2
                   255.255.255.0         255.255.255.0
                   eth2                  eth0
------------------------------------------------------
                   192.168.1.100
                   255.255.255.0
                   eth0
                   [to Internet]
------------------------------------------------------
Here is the routing table on B :-
Code:
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.2.0     192.168.2.2     255.255.255.0   UG        0 0          0 eth2
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth2
192.168.1.0     192.168.1.103   255.255.255.0   UG        0 0          0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0
[root@localhost ~]#
Here is the routing table on A :-
Code:
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.1.101   0.0.0.0         UG        0 0          0 eth0
[root@localhost ~]#
Here is the routing table on C:-
Code:
[root@postel ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0
[root@postel ~]#
Any anyone see something wrong here that is preventing A and C from communicating ?

Please note that A and B can communicate; so also B and C. But NOT A and C.

Thank you very much,
K

Last edited by kewlemer; 07-02-2006 at 03:39 PM.
 
Old 07-02-2006, 04:41 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
the first two bold routes on B don't make any sense. that machine is already on those networks yet you are somehow telling to route to the local network via another box??? the only route B needs is a default out to the net as everythign is locally attached an implicitly known to it. also i assume you have enabled ip forwarding?
 
Old 07-02-2006, 04:58 PM   #3
fataldata
Member
 
Registered: Jun 2002
Location: Breckenridge, Colorado
Distribution: Ubuntu Hardy 8.04
Posts: 101

Rep: Reputation: 15
Acid_kewpie is right to ask whether ip forwarding is enabled first. If it is, well then I probably would not use the same networks for A and B as you are using for B and the internet.

When A tries to ping C with 192.168.2.2 the packet arrives at machine B where the route is directing packets for network 192.168.2.0/24 to 0.0.0.0 the default gateway which by the last line is Eth0 going to the internet.

Just my 2 cents.
 
Old 07-02-2006, 05:56 PM   #4
kewlemer
LQ Newbie
 
Registered: Apr 2005
Location: Los Angeles, CA
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks a ton for the responses folks. You guys were right in asking me if I had IP forwarding enabled. I had'nt . Used this thread to set it up :-

http://www.linuxforums.org/forum/red...orwarding.html
Actually I just put net.ipv4.ip_forward = 1 in /etc/sysctl.conf .

This is the routing table on B:-
Code:
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.3.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0
[root@localhost ~]#
I moved A and eth1(on B) onto 192.168.3.*; C and eth2(on B) on 192.168.2.* bacause of the bold line entry which came up each time I configured the default route on eth0 (192.168.1.1).

The set-up works now.

Thanks again,
K
 
  


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
Static Routing Troubles Rundi Linux - Networking 2 07-16-2004 11:38 AM
routing problem with 2 static (external) IPs gjmwalsh Linux - Networking 3 05-23-2004 09:17 PM
Static Routing =!= uplink? jpbarto Linux - Networking 12 10-02-2003 11:30 AM
Static Routing in Linux suvajit Linux - Networking 4 05-16-2003 02:54 AM
Static Ip's and Routing Sarcha Linux - Networking 5 02-28-2003 08:19 AM

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

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