From owner-svn-doc-all@FreeBSD.ORG Thu Mar 6 02:34:18 2014 Return-Path: Delivered-To: svn-doc-all@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 716E6CEC; Thu, 6 Mar 2014 02:34:18 +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 5D3F4E09; Thu, 6 Mar 2014 02:34:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s262YIM2037626; Thu, 6 Mar 2014 02:34:18 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s262YI1a037625; Thu, 6 Mar 2014 02:34:18 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201403060234.s262YI1a037625@svn.freebsd.org> From: Dru Lavigne Date: Thu, 6 Mar 2014 02:34:18 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44144 - 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: Thu, 06 Mar 2014 02:34:18 -0000 Author: dru Date: Thu Mar 6 02:34:17 2014 New Revision: 44144 URL: http://svnweb.freebsd.org/changeset/doc/44144 Log: White space fix only. Translators can ignore. 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 Thu Mar 6 02:08:27 2014 (r44143) +++ head/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.xml Thu Mar 6 02:34:17 2014 (r44144) @@ -104,20 +104,19 @@ 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 + 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 no other routes apply. There are also three - types of gateways: individual hosts, interfaces, also called - links, and Ethernet hardware + 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 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. @@ -125,7 +124,8 @@ Routing Basics - To view the routing table of a &os; system, use &man.netstat.1;: + To view the routing table of a &os; system, use + &man.netstat.1;: &prompt.user; netstat -r Routing tables @@ -148,111 +148,120 @@ host2.example.com link#1 UC default - 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 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 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. - - + 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 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). + + - - MAC address - - The addresses beginning with 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, 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 - automatically deleted. These hosts are identified using the - Routing Information Protocol (RIP), which - calculates routes to local hosts based upon a shortest path - determination. - - + + localhost + + 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. + + - - subnet - - &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 - name associated with that subnet. The designation - link#1 refers to the first Ethernet card in - the machine. - - Local network hosts and local subnets have their routes - 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. - - + + MAC address + + The addresses beginning with 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, 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 + automatically deleted. These hosts are identified using + the Routing Information Protocol + (RIP), which calculates routes to + local hosts based upon a shortest path + determination. + + - - 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 - (lo0) rather than the Ethernet - interface. + + subnet + + &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 name associated with that subnet. The + designation link#1 refers to the + first Ethernet card in the machine. + + Local network hosts and local subnets have their + routes 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. + + - The two host2 lines represent aliases - which were created using &man.ifconfig.8;. The - => 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 and all other hosts - on the local network will have a - link#1 line for such routes. - - + + 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 + (lo0) rather than the Ethernet + interface. + + The two host2 lines represent + aliases which were created using &man.ifconfig.8;. The + => 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 + and 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. - - - + + 224 + + The final line (destination subnet 224) deals with + multicasting. + + + - Various attributes of each route can be seen in - the Flags column. + Various attributes of each route can be seen in the + Flags column. summarizes some of these flags and their meanings: @@ -274,15 +283,14 @@ host2.example.com link#1 UC H - The route destination is a single - host. + The route destination is a single host. G - Send anything for this destination on to - this gateway, which will figure out from there - where to send it. + Send anything for this destination on to this + gateway, which will figure out from there where to + send it. @@ -292,16 +300,15 @@ host2.example.com link#1 UC C - Clones a new route based upon this - route for machines to connect to. This type of route - is normally used for local networks. + Clones a new route based upon this route for + machines to connect to. This type of route is + normally used for local networks. W - The route was - auto-configured based upon a local area network - (clone) route. + The route was auto-configured based upon a local + area network (clone) route. @@ -326,7 +333,7 @@ host2.example.com link#1 UC 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;. + routing tables, refer to &man.route.8;. @@ -352,20 +359,20 @@ host2.example.com link#1 UC A &os; system can be configured as the default gateway, or router, for a network if it is a dual-homed system. A dual-homed system is a host which resides on at least two - different networks. Typically, each network is connected to a separate - network interface, though IP aliasing can - be used to bind multiple addresses, each on a different - subnet, to one physical interface. + different networks. Typically, each network is connected to a + separate network interface, though IP + aliasing can be used to bind multiple addresses, each on a + different subnet, to one physical interface. router In order for the system to forward packets between - interfaces, &os; must be configured as a router. Internet standards and good - engineering practice prevent the &os; Project from enabling - this feature by default, but it can be configured to start at boot - by adding this line to + interfaces, &os; must be configured as a router. Internet + standards and good engineering practice prevent the &os; + Project from enabling this feature by default, but it can be + configured to start at boot by adding this line to /etc/rc.conf: gateway_enable="YES" # Set to YES if this host will be a gateway @@ -387,31 +394,30 @@ host2.example.com link#1 UC The routing table of a router needs additional routes so it knows how to reach other networks. Routes can be either - added manually using - static routes or routes can be automatically learned using a routing protocol. - Static routes are appropriate for small networks and this - section describes how to add a static routing entry for a - small network. + added manually using static routes or routes can be + automatically learned using a routing protocol. Static routes + are appropriate for small networks and this section describes + how to add a static routing entry for a small network. - + For large networks, static routes quickly become - unscalable. &os; comes with the standard BSD routing daemon - &man.routed.8;, which provides the routing protocols RIP, versions - 1 and 2, and IRDP. Support for the - BGP and OSPF - routing protocols can be installed using the - net/zebra package or - port. + unscalable. &os; comes with the standard + BSD routing daemon &man.routed.8;, which + provides the routing protocols RIP, + versions 1 and 2, and IRDP. Support for + the BGP and OSPF + routing protocols can be installed using the + net/zebra package or port. - Consider the following network: + Consider the following network: - - - - + + + + - + INTERNET | (10.0.0.1/24) Default Router to Internet @@ -435,23 +441,22 @@ host2.example.com link#1 UC | 192.168.2.1/24 | Internal Net 2 - - + + - In this scenario, RouterA is a - &os; machine that is acting as a router to the rest of the - Internet. It has a default route set to 10.0.0.1 which allows it to - connect with the outside world. - RouterB is already configured - to use 192.168.1.1 as its default - gateway. + In this scenario, RouterA is a + &os; machine that is acting as a router to the rest of the + Internet. It has a default route set to 10.0.0.1 which allows it to + connect with the outside world. + RouterB is already configured to use + 192.168.1.1 as its + default gateway. - Before adding any static routes, the routing table on RouterA - looks like this: + Before adding any static routes, the routing table on + RouterA looks like this: - &prompt.user; netstat -nr + &prompt.user; netstat -nr Routing tables Internet: @@ -461,56 +466,55 @@ default 10.0.0.1 UG 10.0.0.0/24 link#1 UC 0 0 xl0 192.168.1.0/24 link#2 UC 0 0 xl1 - With the current routing table, - RouterA - does not have a route to the 192.168.2.0/24 network. The - following command adds the Internal Net 2 network to - RouterA's routing table using - 192.168.1.2 as - the next hop: - - &prompt.root; route add -net 192.168.2.0/24 192.168.1.2 - - Now, RouterA can reach any host - on the 192.168.2.0/24 - network. However, the routing information will not - persist if the &os; system reboots. If a static route needs - to be persistent, add it to - /etc/rc.conf: + With the current routing table, + RouterA does not have a route to the + 192.168.2.0/24 + network. The following command adds the Internal Net + 2 network to RouterA's + routing table using 192.168.1.2 as the next + hop: + + &prompt.root; route add -net 192.168.2.0/24 192.168.1.2 + + Now, RouterA can reach any host + on the 192.168.2.0/24 network. + However, the routing information will not persist if the &os; + system reboots. If a static route needs to be persistent, add + it to /etc/rc.conf: - # Add Internal Net 2 as a persistent static route + # Add Internal Net 2 as a persistent static route static_routes="internalnet2" route_internalnet2="-net 192.168.2.0/24 192.168.1.2" - The static_routes configuration - variable is a list of strings separated by a space, where - each string references a route name. The variable - route_internalnet2 - contains the static route for that route name. - - Using more than one string in - static_routes creates multiple static - routes. The following shows an example of adding static - routes for the 192.168.0.0/24 and - 192.168.1.0/24 - networks: + The static_routes configuration + variable is a list of strings separated by a space, where + each string references a route name. The variable + route_internalnet2 contains the static + route for that route name. + + Using more than one string in + static_routes creates multiple static + routes. The following shows an example of adding static + routes for the 192.168.0.0/24 and + 192.168.1.0/24 + networks: - static_routes="net1 net2" + static_routes="net1 net2" route_net1="-net 192.168.0.0/24 192.168.0.1" route_net2="-net 192.168.1.0/24 192.168.1.1" - + Troubleshooting When an address space is assigned to a network, the service provider configures their routing tables so that all - traffic for the network will be sent to the link for the - site. But how do external sites know to send their packets - to the network's ISP? + traffic for the network will be sent to the link for the site. + But how do external sites know to send their packets to the + network's ISP? There is a system that keeps track of all assigned address spaces and defines their point of connection to the @@ -530,17 +534,18 @@ route_net2="-net 192.168.1.0/24 192.168. &man.traceroute.8; - Sometimes, there is a problem with route propagation - and some sites are unable to connect. Perhaps the most - useful command for trying to figure out where routing is - breaking down is traceroute. It is useful when + Sometimes, there is a problem with route propagation and + some sites are unable to connect. Perhaps the most useful + command for trying to figure out where routing is breaking + down is traceroute. It is useful when ping fails. - When using traceroute, include the address of the - remote host to connect to. The output will show the gateway - hosts along the path of the attempt, eventually either - reaching the target host, or terminating because of a lack of - connection. For more information, refer to &man.traceroute.8;. + When using traceroute, include the + address of the remote host to connect to. The output will + show the gateway hosts along the path of the attempt, + eventually either reaching the target host, or terminating + because of a lack of connection. For more information, refer + to &man.traceroute.8;. @@ -556,29 +561,29 @@ route_net2="-net 192.168.1.0/24 192.168. &os; natively supports both multicast applications and multicast routing. Multicast applications do not require any - special configuration in order to - run on &os;. Support for multicast routing requires that the - following option - be compiled into a custom kernel: + special configuration in order to run on &os;. Support for + multicast routing requires that the following option be + compiled into a custom kernel: options MROUTING The multicast routing daemon, - mrouted can be installed - using the net/mrouted package or port. - This daemon implements - the DVMRP multicast routing protocol and is - configured by editing /usr/local/etc/mrouted.conf - in order to set up the tunnels and DVMRP. - The installation of mrouted also installs - map-mbone and + mrouted can be installed using the + net/mrouted package or port. This daemon + implements the DVMRP multicast routing + protocol and is configured by editing + /usr/local/etc/mrouted.conf in order to + set up the tunnels and DVMRP. The + installation of mrouted also + installs map-mbone and mrinfo, as well as their associated man pages. Refer to these for configuration examples. - DVMRP has largely been replaced by the - PIM protocol in many - multicast installations. Refer to &man.pim.4; for more information. + DVMRP has largely been replaced by + the PIM protocol in many multicast + installations. Refer to &man.pim.4; for more + information.