[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

routing problem for a simple network

I just install redhat linux 6.0 on a sony Z505RX laptop and have connected the laptop to our LAN at work on subnet A (network address, netmask 0xffff0000).    The subnet has a DHCP server and a DNS name server.    I successfully configured my laptap as a DCHP client using "control-panel" and am able to do DNS name resolution.    I can ping any other host on subnet A.   However, when I attempt to ping host banzai ( on subnet B (address, netmask 0xffff0000) or anything on the Internet, I get the following error:

    PING banzai ( 56 data bytes
    Ping: sindto: Network is unreachable
    Ping: wrote banzai 64 chars, ret=-1

I set the default route using

   "Route add default netmask 0xffff0000 gw eth0"

The netstat -r command shows the routing table as

Destination  Gateway   Genmask              flags   metric  Ref Use Ifac     *        UH     0           0    0     lo
default          UG     0          0     0    eth0       *                U        0          0     0    eth0     *                    U        0          0     0     lo

The gateway interconnects subnet A, subnet B and the Internet.   It has the following NIC installed and UP., netmask 0xffff0000   on subnet A, netmask 0xffff0000   on subnet B
    some other IP address for the Internet

I know that the gateway is working because I can ping banzai using any other host on subnet A.   What is peculiar is that "ifconfig -a" shows packets received and transmitted in response to ping commands.   Yet, "netstat -r" always shows '0' for the "Use" statistic for the destination.   I know the route for distination is used to ping other host on sybnet A, yet the route "Use" statistics remains 0 after pinging hosts on subnet A.     What could possible be the problem?   Do I need to load some other module to get packets forwarded to the router as required?    Also, "traceroute" gave me the same error as ping.

Thank for your help.

  • 2
1 Solution

  On the laptop, try changing your command of:
"Route add default netmask 0xffff0000 gw eth0"
to the following:
"Route add default netmask 0xffffffff gw eth0"
and see if that works.  I don't think the default gateway needs a 16 bit subnet mask, I think you would specifiy it as if it were a direct host (IOW use a 32-bit subnet mask).

   --- Joel
Also, try not using the netmask parameter at all so that the command would become:
"Route add default gw eth0"

Good luck,

   --- Joel
donpulkAuthor Commented:

Thanks a MILLION!!!   It was your second suggestion of not specifying the netmask at all that worked.


Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now