Re: how to interpret route command

From: Paul Colquhoun (postmaster_at_andor.dropbear.id.au)
Date: 03/17/05


Date: Thu, 17 Mar 2005 01:40:02 GMT

On Wed, 16 Mar 2005 18:49:34 -0600, Charles <charles97@dunjas.com> wrote:
| I am trying to understand what this means...
|
| [charles@host ~]$ /sbin/route -n
| Kernel IP routing table
| Destination Gateway Genmask Flags Metric Ref Use 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.1 0.0.0.0 UG 0 0 0 eth0

| [charles@host ~]$
|
| The first number, 192.168.1.0, is not a real address. So how can it be
| a destination for anything.
|
| The 0.0.0.0 for Gateway make no sense
|
| The 169.254.0.0 means absolutely nothing to me. I do not believe
| I have anything associated with that number.
|
| The one number that makes sense is 192.168.1.1. That *IS* my gateway.
|
| Where can I read more about how to interpret the output
| of the route command?

I'm not sure where this is all written down, but here is my stab at it.

Column 1 (Destination) is where you want to get. This needs to be read
in conjunction with column 3 (Genmask). The 0.0.0.0 entry (with mask
0.0.0.0) matches anything and is called the "default" route.

Column 2 (Gateway) is where packets that match Columns 1 & 3 are sent.
An entry of 0.0.0.0 here means that matching packets can be sent directly
to their destination, generally because it is on the same network segment
as the sender. The network will be attached to the interface in Column 8.

Columns 4, 5, 6 & 7 contain information about where the route came from,
what preference it has in case of multiple routes, and how often it has
been used.

I hope this helps.

-- 
Reverend Paul Colquhoun, ULC.    http://andor.dropbear.id.au/~paulcol
     Asking for technical help in newsgroups?  Read this first:
        http://catb.org/~esr/faqs/smart-questions.html#intro


Relevant Pages

  • Re: Routing with windows 2000
    ... netmask Specifies a subnet mask value for this route entry. ... gateway Specifies gateway. ... ie. cost for the destination. ...
    (microsoft.public.win2000.general)
  • Re: Ip forwarding
    ... This MAC address is obtained by doing an ARP query to the router's local IP address, which is the gateway address in the routing table. ... ROUTE: bad gateway address interface ... According to route help, the correct keyword to specify an interface is "IF", not "INTERFACE". ... The gateway column optionnally contains the address of the next hop router if the destination is not directly reachable on the network attached to the output interface. ...
    (comp.os.linux.networking)
  • Re: How do I add a network route permanently using "route add" commandin linux.
    ... 'destination' via 'gateway ip' ... However it looks like you want to add a default gateway? ... How do I add a network route permanently using "route add" ...
    (RedHat)
  • libnetlink, routing sockets
    ... everything works fine and the program sets a default route on the ... route, I get the answer "RTNETLINK answers: ... addroute(unsigned long *destination, unsigned long *gateway) ... addattr_l, RTA_DST, &destination, 4); ...
    (comp.os.linux.development.system)
  • libnetlink, routing sockets
    ... everything works fine and the program sets a default route on the ... route, I get the answer "RTNETLINK answers: ... addroute(unsigned long *destination, unsigned long *gateway) ... addattr_l, RTA_DST, &destination, 4); ...
    (comp.os.linux.networking)