old-www/LDP/nag/node75.html

72 lines
2.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-c (Feb 29, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Displaying the Routing Table</TITLE>
</HEAD>
<BODY LANG="EN">
<A HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
<B> Next:</B> <A HREF="node76.html">Displaying Interface Statistics</A>
<B>Up:</B> <A HREF="node74.html">Checking with netstat</A>
<B> Previous:</B> <A HREF="node74.html">Checking with netstat</A>
<BR> <P>
<H2><A NAME="SECTION007910000">Displaying the Routing Table</A></H2>
When invoking netstat with the -r flag, it displays the
kernel routing table in the way we've been doing this with route
above. On vstout, it produces:
<pre>
# netstat -nr
Kernel routing table
Destination Gateway Genmask Flags Metric Ref Use
127.0.0.1 * 255.255.255.255 UH 1 0
191.72.1.0 * 255.255.255.0 U 1 0
191.72.2.0 191.72.1.1 255.255.255.0 UGN 1 0
</pre>
The -n option makes netstat print addresses as dotted
quad IP-numbers rather than the symbolic host and network names. This is
especially useful when you want to avoid address lookups over the network
(e.g. to a DNS or NIS server).
<P>
The second column of netstat's output shows the gateway the
routing entry points to. If no gateway is used, an asterisk is printed
instead. Column three shows the ``generality'' of the route. When given
an IP-address to find a suitable route for, the kernel goes through all
routing table entries, taking the bitwise AND of the address and the
genmask before comparing it to the target of the route.
<P>
The fourth column displays various flags that describe the route:
<dl>
<dt><b>G</b><dd> The route uses a gateway.
<dt><b>U</b><dd> The interface to be used is up.
<dt><b>H</b><dd> Only a single host can be reached through the route. For example, this is the case for the loopback entry 127.0.0.1.
<dt><b>D</b><dd> This is set if the table entry has been generated by an ICMP
redirect message (see section 3.5).
<dt><b>M</b><dd> This is set if the table entry was modified by an ICMP redi-
rect message.
</dl>
The Ref column of netstat's output shows the number of
references to this route, that is, how many other routes (e.g. through
gateways) rely on the presence of this route. The last two columns show
the number of times the routing entry has been used, and the interface
that datagrams are passed to for delivery.
<P>
<BR> <HR>
<P><ADDRESS>
<I>Andrew Anderson <BR>
Thu Mar 7 23:22:06 EST 1996</I>
</ADDRESS>
</BODY>
</HTML>