[CentOS] Simple routing question

John R Pierce pierce at hogranch.com
Tue Sep 4 20:51:45 UTC 2012


On 09/04/12 1:25 PM, James B. Byrne wrote:
> I have host A with eth0[aaa.bbb.ccc.A] and eth1[192.168.216.A]
>
> I have host B with eth0[aaa.bbb.ccc.B] and eth1[192.168.209.B]

what are the subnet masks defined on 192.168.216.A and 192.168.209.B ?


> and I have host C as the gateway with eth0 being the WAN and eth1
> being the LAN.  Eth1 on C has the address [aaa.bbb.ccc.1] assigned to
> it and has the alias [192.168.0.1] as well.

assuming the answer to my above question is 255.255.255.0, then noone 
has a route to this 192.168.0.1 as its in an entirely different 
subnet.     you can't overlap subnets with different size masks without 
creating some serious messes.


> I want traffic from 192.168.216.A addressed to 192.168.209.B to go to
> eth1 on B.  Instead it goes to Eth0 on C where it dies as one would
> expect.

there's no route defined to do that, since 192.168.209.B is not in any 
network that A has knowlege of.   A would need an IP in the B subnet, 
and B would need an IP in the A subnet for this to work.

why do you have two seperate LAN subnets?  are you running two seperate 
LANs ?   there have to be some really good reasons before I create 
anything this messy.

for instance...

host A with eth0[aaa.bbb.ccc.A] and eth1[192.168.216.A] and eth1[192.168.209.A]
host B with eth0[aaa.bbb.ccc.B] and eth1[192.168.209.B] and eth1[192.168.216.B]

now A can reach B via its eth1 as it now has a route to 192.168.216/24





-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast




More information about the CentOS mailing list