English Turkish (tr_TR)
Know how to install additional third-party software (crossref:ports[ports,Installing Applications: Packages and Ports]).
Gateways and Routes
_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 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 FreeBSD system as a router and offers some troubleshooting tips.
Routing Basics
To view the routing table of a FreeBSD system, use man:netstat[1]:
% netstat -r
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
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
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
224 link#1 UC 0 0
The entries in this example are as follows: Bu örnekteki girişler aşağıdaki gibidir:
default geçerli
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. Bu tablodaki ilk rota <literal>default</literal> rotayı belirtir. Yerel sistemin uzak bir ana makineyle bağlantı kurması gerektiğinde, bilinen bir yol olup olmadığını belirlemek için yönlendirme tablosunu kontrol eder. Uzak ana bilgisayar tablodaki bir girdiyle eşleşirse, sistem bu girdide belirtilen ara birimi kullanarak bağlanıp bağlanamayacağını denetler.
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`). Hedef bir girişle eşleşmezse veya bilinen tüm yollar başarısız olursa, sistem varsayılan rota için girişi kullanır.
Yerel ağdaki ana bilgisayarlar için, <literal>Gateway</literal> varsayılan yoldaki kaynak internet'e doğrudan bağlantısı olan sisteme ayarlanır. Bu girişi okurken <literal>Flags</literal> ağ geçidinin kullanılabilir olduğunu doğrulayın (<literal>UG</literal>).
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 Yerel hizmet bilgisayarı
The second route is the `localhost` route. The interface specified in the `Netif` column for `localhost` is [.filename]#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.
MAC address MAC adresi
The addresses beginning with `0:e0:` are MAC addresses. FreeBSD will automatically identify any hosts, `test0` in the example, on the local Ethernet and add a route for that host over the Ethernet interface, [.filename]#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.
subnet Alt ağ
FreeBSD 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.