From owner-svn-doc-all@FreeBSD.ORG Wed Mar 5 22:34:27 2014 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E5C8589; Wed, 5 Mar 2014 22:34:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E459861; Wed, 5 Mar 2014 22:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25MYRm7040288; Wed, 5 Mar 2014 22:34:27 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25MYRaD040287; Wed, 5 Mar 2014 22:34:27 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201403052234.s25MYRaD040287@svn.freebsd.org> From: Dru Lavigne Date: Wed, 5 Mar 2014 22:34:27 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44142 - head/en_US.ISO8859-1/books/handbook/advanced-networking X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 22:34:27 -0000 Author: dru Date: Wed Mar 5 22:34:26 2014 New Revision: 44142 URL: http://svnweb.freebsd.org/changeset/doc/44142 Log: Editorial pass through Routing Basics. Add name to table. 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 21:39:21 2014 (r44141) +++ head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml Wed Mar 5 22:34:26 2014 (r44142) @@ -132,7 +132,7 @@ Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire -default outside-gw UGSc 37 418 em0 +default outside-gw UGS 37 418 em0 localhost localhost UH 0 181 lo0 test0 0:e0:b5:36:cf:4f UHLW 5 63288 re0 77 10.20.30.255 link#1 UHLW 1 2421 @@ -148,33 +148,37 @@ host2.example.com link#1 UC default - The first line specifies the + The first route in this table specifies the default 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. - - If all known paths fail, the system has one last option: - the default route. This route is a special - type of gateway route (usually the only one present in the - system), and is always marked with a c 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. + known path exists. If the remote host matches an entry in the + table, the system checks to see if it + can connect using the interface specified in that entry. + + If the destination does not match an entry, or if all known + paths fail, the system uses the entry for the + default route. For hosts on a local area network, the + Gateway field in the default route is set + to the system which has a direct connection to + the Internet. When reading this entry, verify that the + Flags column indicates that the gateway is + usable (UG). + 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 + (ISP). localhost - The second line is the localhost route. - The interface (Netif column) that this - routing table specifies to use for - localhost is lo0, - also known as the loopback device. This says to keep all - traffic for this destination internal, rather than sending it + The second route is the localhost route. + The interface specified in the Netif column + for localhost is lo0, + also known as the loopback device. This indicates that all + traffic for this destination should be internal, rather than sending it out over the network. @@ -201,8 +205,8 @@ host2.example.com link#1 UC subnet - &os; will add subnet routes for the local subnet. - 10.20.30.255 is the + &os; will automatically add subnet routes for the local subnet. + In this example, 10.20.30.255 is the broadcast address for the subnet 10.20.30 and example.com is the domain @@ -231,7 +235,7 @@ host2.example.com link#1 UC => symbol after the lo0 interface says that an alias has been set in addition to the loopback address. Such routes only - show up on the host that supports the alias; all other hosts + show up on the host that supports the alias and all other hosts on the local network will have a link#1 line for such routes. @@ -248,177 +252,80 @@ host2.example.com link#1 UC Various attributes of each route can be seen in - the Flags column. Below is a short table - of some of these flags and their meanings: + the Flags column. + summarizes some of these flags and their meanings: + + + Commonly Seen Routing Table Flags - - - + + + Command + Purpose + + U - Up: The route is active. + The route is active (up). H - Host: The route destination is a single + The route destination is a single host. G - Gateway: Send anything for this destination on to - this remote system, which will figure out from there + Send anything for this destination on to + this gateway, which will figure out from there where to send it. S - Static: This route was configured manually, not - automatically generated by the system. + This route was statically configured. C - Clone: Generates a new route based upon this + Clones a new route based upon this route for machines to connect to. This type of route is normally used for local networks. W - WasCloned: Indicated a route that was + The route was auto-configured based upon a local area network - (Clone) route. + (clone) route. L - Link: Route involves references to Ethernet + Route involves references to Ethernet (link) hardware. - - - 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 - (ISP). - - This example is a common configuration for a default - route: - - - - - - - - -[Local2] <--ether--> [Local1] <--PPP--> [ISP-Serv] <--ether--> [T1-GW] - - - - The hosts Local1 and - Local2 are on the local network. - Local1 is connected to an - ISP using a - PPP connection. This - PPP server is connected through a local - area network to another gateway computer through an external - interface to the ISP. - - The default routes for each machine will be: - - - - - - Host - Default Gateway - Interface - - - - - - Local2 - Local1 - Ethernet - - - - Local1 - T1-GW - PPP - - - - - - A common question is Why is - T1-GW configured as the default - gateway for Local1, rather than the - ISP server it is connected - to?. - - Since the PPP interface is using an - address on the ISP's local network for the - local side of the connection, routes for any other machines on - the ISP's local network will be - automatically generated. The system already knows how to - reach the T1-GW machine, so there is - no need for the intermediate step of sending traffic to the - ISP's server. - - It is common to use the address X.X.X.1 as the gateway - address for the local network. So, if the local class C - address space is 10.20.30 and the - ISP is using 10.9.9, the default routes - would be: - - - - - - Host - Default Route - - - - - Local2 (10.20.30.2) - Local1 (10.20.30.1) - - - - Local1 (10.20.30.1, 10.9.9.30) - T1-GW (10.9.9.1) - - - - +
- The default route can be easily defined in - /etc/rc.conf. In this example, on - Local2, add the following line to - /etc/rc.conf: + On a &os; system, the default route can defined in + /etc/rc.conf by specifying the + IP address of the default gateway: defaultrouter="10.20.30.1" - It is also possible to add the route directly using - &man.route.8;: + It is also possible to manually add the route using + route: &prompt.root; route add default 10.20.30.1 - For more information on manual manipulation of network + Note that manually added routes will not survive a reboot. + For more information on manual manipulation of network routing tables, refer to &man.route.8;.