Networking Forums

Networking Forums > Computer Networking > Linux Networking > netstat output question -- gateways?

Reply
Thread Tools Display Modes

netstat output question -- gateways?

 
 
Duane Evenson
Guest
Posts: n/a

 
      09-21-2006, 03:24 AM
looking at the output from netstat -rn...

My books and some internet sites use the interface's IP address for
networks' gateway. My computer and other internet sites use 0.0.0.0
as the gateway.
eg.
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 eth1
192.168.0.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.0.1 0.0.0.0 UG 0 0 0 eth0

Where can I go to get this difference explained? This seems to be an "of
course" topic I'm missing. A wild guess is that newer versions of the
router daemon don't need the interface's IP address.

TIA,
Duane

 
Reply With Quote
 
 
 
 
Allen Kistler
Guest
Posts: n/a

 
      09-21-2006, 05:40 AM
Duane Evenson wrote:
> looking at the output from netstat -rn...
>
> My books and some internet sites use the interface's IP address for
> networks' gateway. My computer and other internet sites use 0.0.0.0
> as the gateway.
> eg.
> 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 eth1
> 192.168.0.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.0.1 0.0.0.0 UG 0 0 0 eth0
>
> Where can I go to get this difference explained? This seems to be an "of
> course" topic I'm missing. A wild guess is that newer versions of the
> router daemon don't need the interface's IP address.


I'm not certain what you mean by "gateway" above. The only gateway that
netstat reveals above is the default route of 192.168.0.1. That's what
the G flag means.

Locally connected networks don't need a gateway. That's why none of the
other lines have a gateway.

What are you really trying to ask? Are you saying you're disturbed by
the lack of info in the "Gateway" column for networks that don't use a
gateway?
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      09-21-2006, 07:53 PM
On Thu, 21 Sep 2006, in the Usenet newsgroup comp.os.linux.networking, in
article <(E-Mail Removed)> , Duane Evenson wrote:

>looking at the output from netstat -rn...


/sbin/route -n would be another way to look at the same information

>My books and some internet sites use the interface's IP address for
>networks' gateway. My computer and other internet sites use 0.0.0.0
>as the gateway.


Hmmm, none of the UNIX boxes I have access to use the interface address,
and I don't recall any off the top of the head. On the other hand,
when microsoft invented networking, they put their own weird twist on
things, probably because they didn't understand it, and didn't want to
use tools and standards that had been around 13 years before.

In windoze, (host = 192.168.1.2 default gateway = 192.168.1.1), you'd see

route print
Network Address Netmask Gateway Address Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2 1
192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2 1
224.0.0.0 224.0.0.0 192.168.1.2 192.168.1.2 1
255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2 1

compared to (in this case Linux)

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
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
224.0.0.0 0.0.0.0 240.0.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

so four lines instead of seven. Incidentally, windoze got it wrong above, as
the network mask for Multicast is not 224.0.0.0 (which would be 224.0.0.0
through 255.255.255.255), but is 240.0.0.0 (224.0.0.0 - 239.255.255.255).
Also, the main difference between the various *nix is the name given to the
interface. Linux used 'ethX', but others use different letters, such as hmeX
or leX (Sun), ecX or etX (IRIX) and so on (where the X is a number).

>Where can I go to get this difference explained? This seems to be an "of
>course" topic I'm missing.


In *nix, we refer to the interface by name - while microsoft refers to it
by IP address. This appears to be part of the "baffle 'em with bullsh!t"
techno-babble used to scare away the curious. What to read... how about
the "Linux Network Administrator's Guide" from the Linux Documentation
Project (http://tldp.org/guides.html), or you can buy the dead-tree edition
from O'Reilly and Associates (www.ora.com) as ISBN 0-596-00548-2 for US$35.

>A wild guess is that newer versions of the router daemon don't need the
>interface's IP address.


Some of this is semantics - you use a "gateway" to reach some _other_
network that isn't directly attached to your system. In the above listing,
the networking code doesn't use a gateway to send to local addresses,
because they can be reached directly.

Old guy
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      09-22-2006, 09:53 PM
Hello,

Moe Trin a écrit :
>
> In windoze, (host = 192.168.1.2 default gateway = 192.168.1.1), you'd see
>
> route print
> Network Address Netmask Gateway Address Interface Metric
> 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 1
> 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
> 192.168.1.0 255.255.255.0 192.168.1.2 192.168.1.2 1
> 192.168.1.2 255.255.255.255 127.0.0.1 127.0.0.1 1
> 192.168.1.255 255.255.255.255 192.168.1.2 192.168.1.2 1
> 224.0.0.0 224.0.0.0 192.168.1.2 192.168.1.2 1
> 255.255.255.255 255.255.255.255 192.168.1.2 192.168.1.2 1


In the Windows world, it seems that gateway address = interface address
means no gateway, i.e. the destination is directly reachable.

> compared to (in this case Linux)
>
> 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
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
> 224.0.0.0 0.0.0.0 240.0.0.0 U 0 0 0 eth0
> 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
>
> so four lines instead of seven.


Well, this is because you show only the "main" routing table and hide
the "local" routing table which contains the missing local and broadcast
routes :

$ ip route show table local
broadcast 192.168.1.255 dev eth0 proto kernel scope link src 192.168.1.2
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
local 192.168.1.2 dev eth0 proto kernel scope host src 192.168.1.2
broadcast 192.168.1.0 dev eth0 proto kernel scope link src 192.168.1.2
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1

Note that the local destination 127.0.0.0/8 must be in the local table,
and is not supposed to be in the main table.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: what does "::ffff" mean in netstat output? Rick Jones Linux Networking 1 01-28-2010 10:50 AM
Re: what does "::ffff" mean in netstat output? David W. Hodgins Linux Networking 0 01-27-2010 07:29 PM
Netstat Question amerar@iwc.net Linux Networking 3 11-29-2006 07:44 PM
netstat question ChristineLWilson@gmail.com Linux Networking 2 05-25-2006 10:22 AM
What Causes TCP Send Queue to Grow ("netstat" -an output)? John Davis Linux Networking 4 08-14-2003 03:23 PM



1 2 3 4 5 6 7 8 9 10 11