svn commit: r44141 - head/en_US.ISO8859-1/books/handbook/advanced-networking
Dru Lavigne
dru at FreeBSD.org
Wed Mar 5 21:39:21 UTC 2014
Author: dru
Date: Wed Mar 5 21:39:21 2014
New Revision: 44141
URL: http://svnweb.freebsd.org/changeset/doc/44141
Log:
Initial shuffle in prep for technical review of this chapter.
More commits to come.
Sponsored by: iXsystems
Modified:
head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml
Modified: head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml Wed Mar 5 20:29:33 2014 (r44140)
+++ head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml Wed Mar 5 21:39:21 2014 (r44141)
@@ -103,73 +103,91 @@
<primary>subnet</primary>
</indexterm>
- <para>For one machine to be able to find another over a network,
- there must be a mechanism in place to describe how to get from
- one to the other. This is called
- <firstterm>routing</firstterm>. A <quote>route</quote> is a
- defined pair of addresses: a <quote>destination</quote> and a
- <quote>gateway</quote>. The pair indicates that when trying
- to get to this <emphasis>destination</emphasis>, communicate
- through this <emphasis>gateway</emphasis>. There are three
+ <para><firstterm>Routing</firstterm> is the mechanism that allows
+ a system to find the network path to another system.
+ A <firstterm>route</firstterm> is a
+ defined pair of addresses which represent the <quote>destination</quote> and a
+ <quote>gateway</quote>. The route indicates that when trying
+ to get to the specified destination, send the packets
+ through the specified gateway. There are three
types of destinations: individual hosts, subnets, and
<quote>default</quote>. The <quote>default route</quote> is
- used if none of the other routes apply. There are also three
- types of gateways: individual hosts, interfaces (also called
- <quote>links</quote>), and Ethernet hardware
- (<acronym>MAC</acronym>) addresses.</para>
+ used if no other routes apply. There are also three
+ types of gateways: individual hosts, interfaces, also called
+ links, and Ethernet hardware
+ (<acronym>MAC</acronym>) addresses. Known routes are stored in
+ a routing table.</para>
+
+ <para>This section provides an overview of routing basics. It
+ then demonstrates how to configure a &os; system as a router and
+ offers some troubleshooting tips.</para>
- <sect2>
- <title>An Example</title>
+ <sect2 xml:id="network-routing-default">
+ <title>Routing Basics</title>
- <para>This example &man.netstat.1; output illustrates several
- aspects of routing:</para>
+ <para>To view the routing table of a &os; system, use &man.netstat.1;:</para>
<screen>&prompt.user; <userinput>netstat -r</userinput>
Routing tables
+Internet:
Destination Gateway Flags Refs Use Netif Expire
-
-default outside-gw UGSc 37 418 ppp0
+default outside-gw UGSc 37 418 em0
localhost localhost UH 0 181 lo0
-test0 0:e0:b5:36:cf:4f UHLW 5 63288 ed0 77
+test0 0:e0:b5:36:cf:4f UHLW 5 63288 re0 77
10.20.30.255 link#1 UHLW 1 2421
example.com link#1 UC 0 0
host1 0:e0:a8:37:8:1e UHLW 3 4601 lo0
host2 0:e0:a8:37:8:1e UHLW 0 5 lo0 =>
-host2.example.com link#1 UC 0 0
+host2.example.com link#1 UC 0 0
224 link#1 UC 0 0</screen>
- <indexterm>
- <primary>default route</primary>
- </indexterm>
+ <para>The entries in this example are as follows:</para>
- <para>The first two lines specify the default route, described
- in more detail in <xref linkend="network-routing-default"/>,
- and the <systemitem>localhost</systemitem> route.</para>
+ <variablelist>
+ <varlistentry>
+ <term>default</term>
+ <listitem>
+ <para>The first line specifies the <literal></literal>
+ route. When the local system needs to make a connection to a
+ remote host, it checks the routing table to determine if a
+ known path exists. If the remote host falls into a subnet
+ that it knows how to reach, the system checks to see if it
+ can connect using that interface.</para>
- <indexterm>
- <primary>loopback device</primary>
- </indexterm>
+ <para>If all known paths fail, the system has one last option:
+ the <quote>default</quote> route. This route is a special
+ type of gateway route (usually the only one present in the
+ system), and is always marked with a <literal>c</literal> in
+ the flags field. For hosts on a local area network, this
+ gateway is set to the system which has a direct connection to
+ the Internet.</para>
+
+ </listitem>
+ </varlistentry>
- <para>The interface (<literal>Netif</literal> column) that this
+ <varlistentry>
+ <term>localhost</term>
+ <listitem>
+ <para>The second line is the <literal>localhost</literal> route.
+ The interface (<literal>Netif</literal> column) that this
routing table specifies to use for
<literal>localhost</literal> is <filename>lo0</filename>,
also known as the loopback device. This says to keep all
traffic for this destination internal, rather than sending it
out over the network.</para>
+ </listitem>
+ </varlistentry>
- <indexterm>
- <primary>Ethernet</primary>
- <secondary>MAC address</secondary>
- </indexterm>
-
+ <varlistentry>
+ <term>MAC address</term>
+ <listitem>
<para>The addresses beginning with <systemitem
- class="etheraddress">0:e0:</systemitem> are Ethernet
- hardware addresses, also known as <acronym>MAC</acronym>
+ class="etheraddress">0:e0:</systemitem> are <acronym>MAC</acronym>
addresses. &os; will automatically identify any hosts,
<systemitem>test0</systemitem> in the example, on the local
Ethernet and add a route for that host over the Ethernet
- interface, <filename>ed0</filename>. This type of route has a
+ interface, <filename>re0</filename>. This type of route has a
timeout, seen in the <literal>Expire</literal> column, which
is used if the host does not respond in a specific amount of
time. When this happens, the route to this host will be
@@ -177,11 +195,12 @@ host2.example.com link#1 UC
Routing Information Protocol (<acronym>RIP</acronym>), which
calculates routes to local hosts based upon a shortest path
determination.</para>
+ </listitem>
+ </varlistentry>
- <indexterm>
- <primary>subnet</primary>
- </indexterm>
-
+ <varlistentry>
+ <term>subnet</term>
+ <listitem>
<para>&os; will add subnet routes for the local subnet.
<systemitem class="ipaddress">10.20.30.255</systemitem> is the
broadcast address for the subnet <systemitem
@@ -195,7 +214,12 @@ host2.example.com link#1 UC
automatically configured by a daemon called &man.routed.8;.
If it is not running, only routes which are statically defined
by the administrator will exist.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>host</term>
+ <listitem>
<para>The <literal>host1</literal> line refers to the host
by its Ethernet address. Since it is the sending host, &os;
knows to use the loopback interface
@@ -210,12 +234,20 @@ host2.example.com link#1 UC
show up on the host that supports the alias; all other hosts
on the local network will have a
<literal>link#1</literal> line for such routes.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>224</term>
+ <listitem>
<para>The final line (destination subnet <systemitem
class="ipaddress">224</systemitem>) deals with
multicasting.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para>Finally, various attributes of each route can be seen in
+ <para>Various attributes of each route can be seen in
the <literal>Flags</literal> column. Below is a short table
of some of these flags and their meanings:</para>
@@ -271,30 +303,8 @@ host2.example.com link#1 UC
</tbody>
</tgroup>
</informaltable>
- </sect2>
-
- <sect2 xml:id="network-routing-default">
- <title>Default Routes</title>
-
- <indexterm>
- <primary>default route</primary>
- </indexterm>
-
- <para>When the local system needs to make a connection to a
- remote host, it checks the routing table to determine if a
- known path exists. If the remote host falls into a subnet
- that it knows how to reach, the system checks to see if it
- can connect using that interface.</para>
-
- <para>If all known paths fail, the system has one last option:
- the <quote>default</quote> route. This route is a special
- type of gateway route (usually the only one present in the
- system), and is always marked with a <literal>c</literal> in
- the flags field. For hosts on a local area network, this
- gateway is set to the system which has a direct connection to
- the Internet.</para>
-
- <para>The default route for a machine which itself is
+
+ <para>The default route for a machine which itself is
functioning as the gateway to the outside world, will be the
gateway machine at the Internet Service Provider
(<acronym>ISP</acronym>).</para>
@@ -409,11 +419,24 @@ host2.example.com link#1 UC
<screen>&prompt.root; <userinput>route add default 10.20.30.1</userinput></screen>
<para>For more information on manual manipulation of network
- routing tables, refer to &man.route.8;.</para>
+ routing tables, refer to &man.route.8;.</para>
</sect2>
- <sect2 xml:id="network-dual-homed-hosts">
- <title>Dual Homed Hosts</title>
+ <sect2 xml:id="network-static-routes">
+ <info>
+ <title>Configuring a Router with Static Routes</title>
+
+ <authorgroup>
+ <author>
+ <personname>
+ <firstname>Al</firstname>
+ <surname>Hoang</surname>
+ </personname>
+ <contrib>Contributed by </contrib>
+ </author>
+ </authorgroup>
+ </info>
+ <!-- Feb 2004 -->
<indexterm>
<primary>dual homed hosts</primary>
@@ -440,10 +463,6 @@ host2.example.com link#1 UC
<para>For this machine to forward packets between the two
interfaces, &os; must be configured as a router, as
demonstrated in the next section.</para>
- </sect2>
-
- <sect2 xml:id="network-dedicated-router">
- <title>Building a Router</title>
<indexterm>
<primary>router</primary>
@@ -482,26 +501,6 @@ host2.example.com link#1 UC
sophisticated routing protocols is available with the
<package>net/zebra</package> package or
port.</para>
- </sect2>
-
- <sect2 xml:id="network-static-routes">
- <info>
- <title>Setting Up Static Routes</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Al</firstname>
- <surname>Hoang</surname>
- </personname>
- <contrib>Contributed by </contrib>
- </author>
- </authorgroup>
- </info>
- <!-- Feb 2004 -->
-
- <sect3>
- <title>Manual Configuration</title>
<para>Consider the following network:</para>
@@ -575,7 +574,6 @@ default 10.0.0.1 UG
on the <systemitem
class="ipaddress">192.168.2.0/24</systemitem>
network.</para>
- </sect3>
<sect3>
<title>Persistent Configuration</title>
More information about the svn-doc-head
mailing list