From owner-svn-doc-head@FreeBSD.ORG Wed Mar 5 21:39:21 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DD43618; Wed, 5 Mar 2014 21:39:21 +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 8937A139; Wed, 5 Mar 2014 21:39:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25LdLGO016220; Wed, 5 Mar 2014 21:39:21 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25LdLV6016219; Wed, 5 Mar 2014 21:39:21 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201403052139.s25LdLV6016219@svn.freebsd.org> From: Dru Lavigne Date: Wed, 5 Mar 2014 21:39:21 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44141 - 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-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 21:39:21 -0000 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 @@ subnet - 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 - routing. A route is a - defined pair of addresses: a destination and a - gateway. The pair indicates that when trying - to get to this destination, communicate - through this gateway. There are three + Routing is the mechanism that allows + a system to find the network path to another system. + A route is a + defined pair of addresses which represent the destination and a + gateway. 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 default. The default route is - used if none of the other routes apply. There are also three - types of gateways: individual hosts, interfaces (also called - links), and Ethernet hardware - (MAC) addresses. + used if no other routes apply. There are also three + types of gateways: individual hosts, interfaces, also called + links, and Ethernet hardware + (MAC) addresses. Known routes are stored in + a routing table. + + 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. - - An Example + + Routing Basics - This example &man.netstat.1; output illustrates several - aspects of routing: + To view the routing table of a &os; system, use &man.netstat.1;: &prompt.user; netstat -r 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 - - default route - + The entries in this example are as follows: - The first two lines specify the default route, described - in more detail in , - and the localhost route. + + + default + + The first line specifies the + 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. - - loopback device - + 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. + + + - The interface (Netif column) that this + + 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 out over the network. + + - - Ethernet - MAC address - - + + MAC address + The addresses beginning with 0:e0: are Ethernet - hardware addresses, also known as MAC + class="etheraddress">0:e0: are MAC addresses. &os; will automatically identify any hosts, test0 in the example, on the local Ethernet and add a route for that host over the Ethernet - interface, ed0. This type of route has a + interface, re0. This type of route has a timeout, seen in the Expire 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 (RIP), which calculates routes to local hosts based upon a shortest path determination. + + - - subnet - - + + subnet + &os; will add subnet routes for the local subnet. 10.20.30.255 is the broadcast address for the subnet + + + + host + The host1 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 link#1 line for such routes. + + + + 224 + The final line (destination subnet 224) deals with multicasting. + + + - Finally, various attributes of each route can be seen in + 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: @@ -271,30 +303,8 @@ host2.example.com link#1 UC - - - - Default Routes - - - 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. - - The default route for a machine which itself is + + 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). @@ -409,11 +419,24 @@ host2.example.com link#1 UC &prompt.root; route add default 10.20.30.1 For more information on manual manipulation of network - routing tables, refer to &man.route.8;. + routing tables, refer to &man.route.8;. - - Dual Homed Hosts + + + Configuring a Router with Static Routes + + + + + Al + Hoang + + Contributed by + + + + dual homed hosts @@ -440,10 +463,6 @@ host2.example.com link#1 UC For this machine to forward packets between the two interfaces, &os; must be configured as a router, as demonstrated in the next section. - - - - Building a Router router @@ -482,26 +501,6 @@ host2.example.com link#1 UC sophisticated routing protocols is available with the net/zebra package or port. - - - - - Setting Up Static Routes - - - - - Al - Hoang - - Contributed by - - - - - - - Manual Configuration Consider the following network: @@ -575,7 +574,6 @@ default 10.0.0.1 UG on the 192.168.2.0/24 network. - Persistent Configuration