Translation

(itstool) path: note/para

For large networks, static routes quickly become unscalable. FreeBSD comes with the standard <acronym>BSD</acronym> routing daemon <citerefentry><refentrytitle>routed</refentrytitle><manvolnum>8</manvolnum></citerefentry>, which provides the routing protocols <acronym>RIP</acronym>, versions 1 and 2, and <acronym>IRDP</acronym>. Support for the <acronym>BGP</acronym> and <acronym>OSPF</acronym> routing protocols can be installed using the <package>net/zebra</package> package or port.
0/4880
Context English Spanish State
defaultrouter="10.20.30.1"
It is also possible to manually add the route using <command>route</command>:
<prompt>#</prompt> <userinput>route add default 10.20.30.1</userinput>
Note that manually added routes will not survive a reboot. For more information on manual manipulation of network routing tables, refer to <citerefentry><refentrytitle>route</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Configuring a Router with Static Routes
<personname> <firstname>Al</firstname> <surname>Hoang</surname> </personname> <contrib>Contributed by </contrib>
<primary>dual homed hosts</primary>
A FreeBSD 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 <acronym>IP</acronym> aliasing can be used to bind multiple addresses, each on a different subnet, to one physical interface.
In order for the system to forward packets between interfaces, FreeBSD must be configured as a router. Internet standards and good engineering practice prevent the FreeBSD Project from enabling this feature by default, but it can be configured to start at boot by adding this line to <filename>/etc/rc.conf</filename>:
gateway_enable="YES" # Set to YES if this host will be a gateway
To enable routing now, set the <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> variable <varname>net.inet.ip.forwarding</varname> to <literal>1</literal>. To stop routing, reset this variable to <literal>0</literal>.
<primary>BGP</primary>
<primary>RIP</primary>
<primary>OSPF</primary>
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.
For large networks, static routes quickly become unscalable. FreeBSD comes with the standard <acronym>BSD</acronym> routing daemon <citerefentry><refentrytitle>routed</refentrytitle><manvolnum>8</manvolnum></citerefentry>, which provides the routing protocols <acronym>RIP</acronym>, versions 1 and 2, and <acronym>IRDP</acronym>. Support for the <acronym>BGP</acronym> and <acronym>OSPF</acronym> routing protocols can be installed using the <package>net/zebra</package> package or port.
Consider the following network:
_ external ref='advanced-networking/static-routes' md5='__failed__'

INTERNET
| (10.0.0.1/24) Default Router to Internet
|
|Interface xl0
|10.0.0.10/24
+------+
| | RouterA
| | (FreeBSD gateway)
+------+
| Interface xl1
| 192.168.1.1/24
|
+--------------------------------+
Internal Net 1 | 192.168.1.2/24
|
+------+
| | RouterB
| |
+------+
| 192.168.2.1/24
|
Internal Net 2
In this scenario, <systemitem>RouterA</systemitem> is a FreeBSD machine that is acting as a router to the rest of the Internet. It has a default route set to <systemitem class="ipaddress">10.0.0.1</systemitem> which allows it to connect with the outside world. <systemitem>RouterB</systemitem> is already configured to use <systemitem class="ipaddress">192.168.1.1</systemitem> as its default gateway.
Before adding any static routes, the routing table on <systemitem>RouterA</systemitem> looks like this:
<prompt>%</prompt> <userinput>netstat -nr</userinput>
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.0.0.1 UGS 0 49378 xl0
127.0.0.1 127.0.0.1 UH 0 6 lo0
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, <systemitem>RouterA</systemitem> does not have a route to the <systemitem class="ipaddress">192.168.2.0/24</systemitem> network. The following command adds the <literal>Internal Net 2</literal> network to <systemitem>RouterA</systemitem>'s routing table using <systemitem class="ipaddress">192.168.1.2</systemitem> as the next hop:
<prompt>#</prompt> <userinput>route add -net 192.168.2.0/24 192.168.1.2</userinput>
Now, <systemitem>RouterA</systemitem> can reach any host on the <systemitem class="ipaddress">192.168.2.0/24</systemitem> network. However, the routing information will not persist if the FreeBSD system reboots. If a static route needs to be persistent, add it to <filename>/etc/rc.conf</filename>:
# 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 <literal>static_routes</literal> configuration variable is a list of strings separated by a space, where each string references a route name. The variable <literal>route_<replaceable>internalnet2</replaceable></literal> contains the static route for that route name.
Using more than one string in <literal>static_routes</literal> creates multiple static routes. The following shows an example of adding static routes for the <systemitem class="ipaddress">192.168.0.0/24</systemitem> and <systemitem class="ipaddress">192.168.1.0/24</systemitem> networks:
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"
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 <acronym>ISP</acronym>?
There is a system that keeps track of all assigned address spaces and defines their point of connection to the Internet backbone, or the main trunk lines that carry Internet traffic across the country and around the world. Each backbone machine has a copy of a master set of tables, which direct traffic for a particular network to a specific backbone carrier, and from there down the chain of service providers until it reaches a particular network.

Loading…

User avatar None

New source string

FreeBSD Doc / books_handbookSpanish

New source string a year ago
Browse all component changes

Glossary

English Spanish
No related strings found in the glossary.

Source information

Source string comment

(itstool) path: note/para

Source string location
book.translate.xml:62415
String age
a year ago
Source string age
a year ago
Translation file
books/es_ES/handbook.po, string 10234