# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR The FreeBSD Project # This file is distributed under the same license as the FreeBSD Documentation package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" "POT-Creation-Date: 2025-05-01 19:56-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: YAML Front Matter: description #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1 #, no-wrap msgid "Advanced networking in FreeBSD: basics of gateways and routes, CARP, how to configure multiple VLANs on FreeBSD, etc" msgstr "" #. type: YAML Front Matter: part #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1 #, no-wrap msgid "IV. Network Communication" msgstr "" #. type: YAML Front Matter: title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1 #, no-wrap msgid "Chapter 34. Advanced Networking" msgstr "" #. type: Title = #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:15 #, no-wrap msgid "Advanced Networking" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:53 #, no-wrap msgid "Synopsis" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:56 msgid "This chapter covers a number of advanced networking topics." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:58 msgid "After reading this chapter, you will know:" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:60 msgid "The basics of gateways and routes." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:61 msgid "How to set up USB tethering." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:62 msgid "How to set up IEEE(R) 802.11 and Bluetooth(R) devices." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:63 msgid "How to make FreeBSD act as a bridge." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:64 msgid "How to set up network PXE booting." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:65 msgid "" "How to enable and utilize the features of the Common Address Redundancy " "Protocol (CARP) in FreeBSD." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:66 msgid "How to configure multiple VLANs on FreeBSD." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:67 msgid "Configure bluetooth headset." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:69 msgid "Before reading this chapter, you should:" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:71 msgid "Understand the basics of the [.filename]#/etc/rc# scripts." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:72 msgid "Be familiar with basic network terminology." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:73 msgid "" "Understand basic network configuration on FreeBSD " "(crossref:network[network,FreeBSD network])." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:74 msgid "" "Know how to configure and install a new FreeBSD kernel " "(crossref:kernelconfig[kernelconfig,Configuring the FreeBSD Kernel])." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:75 msgid "" "Know how to install additional third-party software " "(crossref:ports[ports,Installing Applications: Packages and Ports])." msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:77 #, no-wrap msgid "Gateways and Routes" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:86 msgid "" "_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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:89 msgid "" "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." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:91 #, no-wrap msgid "Routing Basics" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:94 msgid "To view the routing table of a FreeBSD system, use man:netstat[1]:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:99 #, no-wrap msgid "" "% netstat -r\n" "Routing tables\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:111 #, no-wrap msgid "" "Internet:\n" "Destination Gateway Flags Refs Use Netif Expire\n" "default outside-gw UGS 37 418 em0\n" "localhost localhost UH 0 181 lo0\n" "test0 0:e0:b5:36:cf:4f UHLW 5 63288 re0 77\n" "10.20.30.255 link#1 UHLW 1 2421\n" "example.com link#1 UC 0 0\n" "host1 0:e0:a8:37:8:1e UHLW 3 4601 lo0\n" "host2 0:e0:a8:37:8:1e UHLW 0 5 lo0 =>\n" "host2.example.com link#1 UC 0 0\n" "224 link#1 UC 0 0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:114 msgid "The entries in this example are as follows:" msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:115 #, no-wrap msgid "default" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:119 msgid "" "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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:123 msgid "" "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`)." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:125 msgid "" "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)." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:126 #, no-wrap msgid "localhost" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:130 msgid "" "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." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:131 #, no-wrap msgid "MAC address" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:137 msgid "" "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." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:138 #, no-wrap msgid "subnet" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:142 msgid "" "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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:145 msgid "" "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." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:146 #, no-wrap msgid "host" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:149 msgid "" "The `host1` line refers to the host by its Ethernet address. Since it is " "the sending host, FreeBSD knows to use the loopback interface " "([.filename]#lo0#) rather than the Ethernet interface." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:153 msgid "" "The two `host2` lines represent aliases which were created using " "man:ifconfig[8]. The `=>` symbol after the [.filename]#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." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:154 #, no-wrap msgid "224" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:156 msgid "The final line (destination subnet `224`) deals with multicasting." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:159 msgid "" "Various attributes of each route can be seen in the `Flags` column. " "crossref:advanced-networking[routeflags,Commonly Seen Routing Table Flags] " "summarizes some of these flags and their meanings:" msgstr "" #. type: Block title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:161 #, no-wrap msgid "Commonly Seen Routing Table Flags" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:165 #, no-wrap msgid "Flag" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:167 #, no-wrap msgid "Purpose" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:168 #, no-wrap msgid "U" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:170 #, no-wrap msgid "The route is active (up)." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:171 #, no-wrap msgid "H" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:173 #, no-wrap msgid "The route destination is a single host." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:174 #, no-wrap msgid "G" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:176 #, no-wrap msgid "Send anything for this destination on to this gateway, which will figure out from there where to send it." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:177 #, no-wrap msgid "S" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:179 #, no-wrap msgid "This route was statically configured." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:180 #, no-wrap msgid "C" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:182 #, no-wrap msgid "Clones a new route based upon this route for machines to connect to. This type of route is normally used for local networks." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:183 #, no-wrap msgid "W" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:185 #, no-wrap msgid "The route was auto-configured based upon a local area network (clone) route." msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:186 #, no-wrap msgid "L" msgstr "" #. type: Table #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:187 #, no-wrap msgid "Route involves references to Ethernet (link) hardware." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:190 msgid "" "On a FreeBSD system, the default route can defined in [.filename]#/etc/" "rc.conf# by specifying the IP address of the default gateway:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:194 #, no-wrap msgid "defaultrouter=\"10.20.30.1\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:197 msgid "It is also possible to manually add the route using `route`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:201 #, no-wrap msgid "# route add default 10.20.30.1\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:205 msgid "" "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]." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:207 #, no-wrap msgid "Configuring a Router with Static Routes" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:212 msgid "" "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 IP aliasing can be used to " "bind multiple addresses, each on a different subnet, to one physical " "interface." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:215 msgid "" "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#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:219 #, no-wrap msgid "gateway_enable=\"YES\" # Set to YES if this host will be a gateway\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:223 msgid "" "To enable routing now, set the man:sysctl[8] variable " "`net.inet.ip.forwarding` to `1`. To stop routing, reset this variable to " "`0`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:227 msgid "" "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." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:233 msgid "" "For large networks, static routes quickly become unscalable. FreeBSD 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 package:net/quagga[] " "package or port." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:236 msgid "Consider the following network:" msgstr "" #. type: Target for macro image #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:237 #, no-wrap msgid "static-routes.png" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:242 msgid "" "In this scenario, `RouterA` is a FreeBSD 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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:244 msgid "" "Before adding any static routes, the routing table on `RouterA` looks like " "this:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:249 #, no-wrap msgid "" "% netstat -nr\n" "Routing tables\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:256 #, no-wrap msgid "" "Internet:\n" "Destination Gateway Flags Refs Use Netif Expire\n" "default 10.0.0.1 UGS 0 49378 xl0\n" "127.0.0.1 127.0.0.1 UH 0 6 lo0\n" "10.0.0.0/24 link#1 UC 0 0 xl0\n" "192.168.1.0/24 link#2 UC 0 0 xl1\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:260 msgid "" "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:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:264 #, no-wrap msgid "# route add -net 192.168.2.0/24 192.168.1.2\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:269 msgid "" "Now, `RouterA` can reach any host on the `192.168.2.0/24` 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#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:275 #, no-wrap msgid "" "# Add Internal Net 2 as a persistent static route\n" "static_routes=\"internalnet2\"\n" "route_internalnet2=\"-net 192.168.2.0/24 192.168.1.2\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:279 msgid "" "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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:282 msgid "" "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:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:288 #, no-wrap msgid "" "static_routes=\"net1 net2\"\n" "route_net1=\"-net 192.168.0.0/24 192.168.0.1\"\n" "route_net2=\"-net 192.168.1.0/24 192.168.1.1\"\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:291 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1324 #, no-wrap msgid "Troubleshooting" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:295 msgid "" "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?" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:298 msgid "" "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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:301 msgid "" "It is the task of the service provider to advertise to the backbone sites " "that they are the point of connection, and thus the path inward, for a " "site. This is known as route propagation." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:305 msgid "" "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." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:309 msgid "" "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]." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:311 #, no-wrap msgid "Multicast Considerations" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:316 msgid "" "FreeBSD natively supports both multicast applications and multicast " "routing. Multicast applications do not require any special configuration in " "order to run on FreeBSD. Support for multicast routing requires that the " "following option be compiled into a custom kernel:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:320 #, no-wrap msgid "options MROUTING\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:326 msgid "" "The multicast routing daemon, mrouted can be installed using the package:net/" "mrouted[] package or port. This daemon implements the DVMRP multicast " "routing protocol and is configured by editing [.filename]#/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." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:331 msgid "" "DVMRP has largely been replaced by the PIM protocol in many multicast " "installations. Refer to man:pim[4] for more information." msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:334 #, no-wrap msgid "Virtual Hosts" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:338 msgid "" "A common use of FreeBSD is virtual site hosting, where one server appears to " "the network as many servers. This is achieved by assigning multiple network " "addresses to a single interface." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:341 msgid "" "A given network interface has one \"real\" address, and may have any number " "of \"alias\" addresses. These aliases are normally added by placing alias " "entries in [.filename]#/etc/rc.conf#, as seen in this example:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:345 #, no-wrap msgid "# sysrc ifconfig_fxp0_alias0=\"inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:349 msgid "" "Alias entries must start with `alias__0__` using a sequential number such as " "`alias0`, `alias1`, and so on. The configuration process will stop at the " "first missing number." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:353 msgid "" "The calculation of alias netmasks is important. For a given interface, " "there must be one address which correctly represents the network's netmask. " "Any other addresses which fall within this network must have a netmask of " "all ``1``s, expressed as either `255.255.255.255` or `0xffffffff`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:358 msgid "" "For example, consider the case where the `fxp0` interface is connected to " "two networks: `10.1.1.0` with a netmask of `255.255.255.0` and `202.0.75.16` " "with a netmask of `255.255.255.240`. The system is to be configured to " "appear in the ranges `10.1.1.1` through `10.1.1.5` and `202.0.75.17` through " "`202.0.75.20`. Only the first address in a given network range should have " "a real netmask. All the rest (`10.1.1.2` through `10.1.1.5` and " "`202.0.75.18` through `202.0.75.20`) must be configured with a netmask of " "`255.255.255.255`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:360 msgid "" "The following [.filename]#/etc/rc.conf# entries configure the adapter " "correctly for this scenario:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:372 #, no-wrap msgid "" "# sysrc ifconfig_fxp0=\"inet 10.1.1.1 netmask 255.255.255.0\"\n" "# sysrc ifconfig_fxp0_alias0=\"inet 10.1.1.2 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias1=\"inet 10.1.1.3 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias2=\"inet 10.1.1.4 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias3=\"inet 10.1.1.5 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias4=\"inet 202.0.75.17 netmask 255.255.255.240\"\n" "# sysrc ifconfig_fxp0_alias5=\"inet 202.0.75.18 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias6=\"inet 202.0.75.19 netmask 255.255.255.255\"\n" "# sysrc ifconfig_fxp0_alias7=\"inet 202.0.75.20 netmask 255.255.255.255\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:376 msgid "" "A simpler way to express this is with a space-separated list of IP address " "ranges. The first address will be given the indicated subnet mask and the " "additional addresses will have a subnet mask of `255.255.255.255`." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:380 #, no-wrap msgid "# sysrc ifconfig_fxp0_aliases=\"inet 10.1.1.1-5/24 inet 202.0.75.17-20/28\"\n" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:383 #, no-wrap msgid "Wireless Advanced Authentication" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:387 msgid "" "FreeBSD supports different ways of connecting to a wireless network. This " "section describes how to perform advanced authentication to a Wireless " "Network." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:389 msgid "" "To make a connection and basic authentication to a wireless network the " "section crossref:network[wireless-authentication,Connection and " "Authentication to a Wireless Network] in the Network Chapter describes how " "to do it." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:391 #, no-wrap msgid "WPA with EAP-TLS" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:396 msgid "" "The second way to use WPA is with an 802.1X backend authentication server. " "In this case, WPA is called WPA Enterprise to differentiate it from the less " "secure WPA Personal. Authentication in WPA Enterprise is based on the " "Extensible Authentication Protocol (EAP)." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:400 msgid "" "EAP does not come with an encryption method. Instead, EAP is embedded " "inside an encrypted tunnel. There are many EAP authentication methods, but " "EAP-TLS, EAP-TTLS, and EAP-PEAP are the most common." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:404 msgid "" "EAP with Transport Layer Security (EAP-TLS) is a well-supported wireless " "authentication protocol since it was the first EAP method to be certified by " "the http://www.wi-fi.org/[Wi-Fi Alliance]. EAP-TLS requires three " "certificates to run: the certificate of the Certificate Authority (CA) " "installed on all machines, the server certificate for the authentication " "server, and one client certificate for each wireless client. In this EAP " "method, both the authentication server and wireless client authenticate each " "other by presenting their respective certificates, and then verify that " "these certificates were signed by the organization's CA." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:406 msgid "" "As previously, the configuration is done via [.filename]#/etc/" "wpa_supplicant.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:420 #, no-wrap msgid "" "network={\n" " ssid=\"freebsdap\" <.>\n" " proto=RSN <.>\n" " key_mgmt=WPA-EAP <.>\n" " eap=TLS <.>\n" " identity=\"loader\" <.>\n" " ca_cert=\"/etc/certs/cacert.pem\" <.>\n" " client_cert=\"/etc/certs/clientcert.pem\" <.>\n" " private_key=\"/etc/certs/clientkey.pem\" <.>\n" " private_key_passwd=\"freebsdmallclient\" <.>\n" "}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:423 msgid "This field indicates the network name (SSID)." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:424 msgid "This example uses the RSN IEEE(R) 802.11i protocol, also known as WPA2." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:425 msgid "" "The `key_mgmt` line refers to the key management protocol to use. In this " "example, it is WPA using EAP authentication." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:426 msgid "This field indicates the EAP method for the connection." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:427 msgid "The `identity` field contains the identity string for EAP." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:428 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:492 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:562 msgid "" "The `ca_cert` field indicates the pathname of the CA certificate file. This " "file is needed to verify the server certificate." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:429 msgid "" "The `client_cert` line gives the pathname to the client certificate file. " "This certificate is unique to each wireless client of the network." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:430 msgid "" "The `private_key` field is the pathname to the client certificate private " "key file." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:431 msgid "" "The `private_key_passwd` field contains the passphrase for the private key." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:433 msgid "Then, add the following lines to [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:438 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:500 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:571 #, no-wrap msgid "" "wlans_ath0=\"wlan0\"\n" "ifconfig_wlan0=\"WPA DHCP\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:441 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:503 msgid "The next step is to bring up the interface:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:460 #, no-wrap msgid "" "# service netif start\n" "Starting wpa_supplicant.\n" "DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7\n" "DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15\n" "DHCPACK from 192.168.0.20\n" "bound to 192.168.0.254 -- renewal in 300 seconds.\n" "wlan0: flags=8843 mtu 1500\n" " ether 00:11:95:d5:43:62\n" " inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255\n" " media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g\n" " status: associated\n" " ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac\n" " country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF\n" " AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan\n" " bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS\n" " wme burst roaming MANUAL\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:463 msgid "" "It is also possible to bring up the interface manually using " "man:wpa_supplicant[8] and man:ifconfig[8]." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:465 #, no-wrap msgid "WPA with EAP-TTLS" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:471 msgid "" "With EAP-TLS, both the authentication server and the client need a " "certificate. With EAP-TTLS, a client certificate is optional. This method " "is similar to a web server which creates a secure SSL tunnel even if " "visitors do not have client-side certificates. EAP-TTLS uses an encrypted " "TLS tunnel for safe transport of the authentication data." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:473 msgid "" "The required configuration can be added to [.filename]#/etc/" "wpa_supplicant.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:486 #, no-wrap msgid "" "network={\n" " ssid=\"freebsdap\"\n" " proto=RSN\n" " key_mgmt=WPA-EAP\n" " eap=TTLS <.>\n" " identity=\"test\" <.>\n" " password=\"test\" <.>\n" " ca_cert=\"/etc/certs/cacert.pem\" <.>\n" " phase2=\"auth=MD5\" <.>\n" "}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:489 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:559 msgid "This field specifies the EAP method for the connection." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:490 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:560 msgid "" "The `identity` field contains the identity string for EAP authentication " "inside the encrypted TLS tunnel." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:491 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:561 msgid "" "The `password` field contains the passphrase for the EAP authentication." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:493 msgid "" "This field specifies the authentication method used in the encrypted TLS " "tunnel. In this example, EAP with MD5-Challenge is used. The \"inner " "authentication\" phase is often called \"phase2\"." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:495 msgid "Next, add the following lines to [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:523 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:594 #, no-wrap msgid "" "# service netif start\n" "Starting wpa_supplicant.\n" "DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7\n" "DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15\n" "DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 21\n" "DHCPACK from 192.168.0.20\n" "bound to 192.168.0.254 -- renewal in 300 seconds.\n" "wlan0: flags=8843 mtu 1500\n" " ether 00:11:95:d5:43:62\n" " inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255\n" " media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g\n" " status: associated\n" " ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac\n" " country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF\n" " AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan\n" " bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS\n" " wme burst roaming MANUAL\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:526 #, no-wrap msgid "WPA with EAP-PEAP" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:532 msgid "" "PEAPv0/EAP-MSCHAPv2 is the most common PEAP method. In this chapter, the " "term PEAP is used to refer to that method." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:536 msgid "" "Protected EAP (PEAP) is designed as an alternative to EAP-TTLS and is the " "most used EAP standard after EAP-TLS. In a network with mixed operating " "systems, PEAP should be the most supported standard after EAP-TLS." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:540 msgid "" "PEAP is similar to EAP-TTLS as it uses a server-side certificate to " "authenticate clients by creating an encrypted TLS tunnel between the client " "and the authentication server, which protects the ensuing exchange of " "authentication information. PEAP authentication differs from EAP-TTLS as it " "broadcasts the username in the clear and only the password is sent in the " "encrypted TLS tunnel. EAP-TTLS will use the TLS tunnel for both the " "username and password." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:542 msgid "" "Add the following lines to [.filename]#/etc/wpa_supplicant.conf# to " "configure the EAP-PEAP related settings:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:556 #, no-wrap msgid "" "network={\n" " ssid=\"freebsdap\"\n" " proto=RSN\n" " key_mgmt=WPA-EAP\n" " eap=PEAP <.>\n" " identity=\"test\" <.>\n" " password=\"test\" <.>\n" " ca_cert=\"/etc/certs/cacert.pem\" <.>\n" " phase1=\"peaplabel=0\" <.>\n" " phase2=\"auth=MSCHAPV2\" <.>\n" "}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:563 msgid "" "This field contains the parameters for the first phase of authentication, " "the TLS tunnel. According to the authentication server used, specify a " "specific label for authentication. Most of the time, the label will be " "\"client EAP encryption\" which is set by using `peaplabel=0`. More " "information can be found in man:wpa_supplicant.conf[5]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:564 msgid "" "This field specifies the authentication protocol used in the encrypted TLS " "tunnel. In the case of PEAP, it is `auth=MSCHAPV2`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:566 msgid "Add the following to [.filename]#/etc/rc.conf#:" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:574 msgid "Then, bring up the interface:" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:597 #, no-wrap msgid "Wireless Ad-hoc Mode" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:601 msgid "" "IBSS mode, also called ad-hoc mode, is designed for point to point " "connections. For example, to establish an ad-hoc network between the " "machines `A` and `B`, choose two IP addresses and a SSID." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:603 msgid "On `A`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:617 #, no-wrap msgid "" "# ifconfig wlan0 create wlandev ath0 wlanmode adhoc\n" "# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap\n" "# ifconfig wlan0\n" " wlan0: flags=8843 metric 0 mtu 1500\n" "\t ether 00:11:95:c3:0d:ac\n" "\t inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255\n" "\t media: IEEE 802.11 Wireless Ethernet autoselect mode 11g \n" "\t status: running\n" "\t ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac\n" "\t country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60\n" "\t protmode CTS wme burst\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:620 msgid "" "The `adhoc` parameter indicates that the interface is running in IBSS mode." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:622 msgid "`B` should now be able to detect `A`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:629 #, no-wrap msgid "" "# ifconfig wlan0 create wlandev ath0 wlanmode adhoc\n" "# ifconfig wlan0 up scan\n" " SSID/MESH ID BSSID CHAN RATE S:N INT CAPS\n" " freebsdap 02:11:95:c3:0d:ac 2 54M -64:-96 100 IS WME\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:633 msgid "" "The `I` in the output confirms that `A` is in ad-hoc mode. Now, configure " "`B` with a different IP address:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:646 #, no-wrap msgid "" "# ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap\n" "# ifconfig wlan0\n" " wlan0: flags=8843 metric 0 mtu 1500\n" "\t ether 00:11:95:d5:43:62\n" "\t inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255\n" "\t media: IEEE 802.11 Wireless Ethernet autoselect mode 11g \n" "\t status: running\n" "\t ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac\n" "\t country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60\n" "\t protmode CTS wme burst\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:649 msgid "Both `A` and `B` are now ready to exchange information." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:651 #, no-wrap msgid "FreeBSD Host Access Points" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:655 msgid "" "FreeBSD can act as an Access Point (AP) which eliminates the need to buy a " "hardware AP or run an ad-hoc network. This can be particularly useful when " "a FreeBSD machine is acting as a gateway to another network such as the " "Internet." msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:657 #, no-wrap msgid "Basic Settings" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:661 msgid "" "Before configuring a FreeBSD machine as an AP, the kernel must be configured " "with the appropriate networking support for the wireless card as well as the " "security protocols being used. For more details, see crossref:advanced-" "networking[network-wireless-ap-basic, Basic Settings]." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:666 msgid "" "The NDIS driver wrapper for Windows(R) drivers does not currently support AP " "operation. Only native FreeBSD wireless drivers support AP mode." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:669 msgid "" "Once wireless networking support is loaded, check if the wireless device " "supports the host-based access point mode, also known as hostap mode:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:676 #, no-wrap msgid "" "# ifconfig wlan0 create wlandev ath0\n" "# ifconfig wlan0 list caps\n" "drivercaps=6f85edc1\n" "cryptocaps=1f\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:682 msgid "" "This output displays the card's capabilities. The `HOSTAP` word confirms " "that this wireless card can act as an AP. Various supported ciphers are " "also listed: WEP, TKIP, and AES. This information indicates which security " "protocols can be used on the AP." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:684 msgid "" "The wireless device can only be put into hostap mode during the creation of " "the network pseudo-device, so a previously created device must be destroyed " "first:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:688 #, no-wrap msgid "# ifconfig wlan0 destroy\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:691 msgid "" "then regenerated with the correct option before setting the other parameters:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:696 #, no-wrap msgid "" "# ifconfig wlan0 create wlandev ath0 wlanmode hostap\n" "# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:699 msgid "" "Use man:ifconfig[8] again to see the status of the [.filename]#wlan0# " "interface:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:711 #, no-wrap msgid "" "# ifconfig wlan0\n" " wlan0: flags=8843 metric 0 mtu 1500\n" "\t ether 00:11:95:c3:0d:ac\n" "\t inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255\n" "\t media: IEEE 802.11 Wireless Ethernet autoselect mode 11g \n" "\t status: running\n" "\t ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac\n" "\t country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60\n" "\t protmode CTS wme burst dtimperiod 1 -dfs\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:714 msgid "" "The `hostap` parameter indicates the interface is running in the host-based " "access point mode." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:716 msgid "" "The interface configuration can be done automatically at boot time by adding " "the following lines to [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:722 #, no-wrap msgid "" "wlans_ath0=\"wlan0\"\n" "create_args_wlan0=\"wlanmode hostap\"\n" "ifconfig_wlan0=\"inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1\"\n" msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:724 #, no-wrap msgid "Host-based Access Point Without Authentication or Encryption" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:728 msgid "" "Although it is not recommended to run an AP without any authentication or " "encryption, this is a simple way to check if the AP is working. This " "configuration is also important for debugging client issues." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:730 msgid "" "Once the AP is configured, initiate a scan from another wireless machine to " "find the AP:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:737 #, no-wrap msgid "" "# ifconfig wlan0 create wlandev ath0\n" "# ifconfig wlan0 up scan\n" "SSID/MESH ID BSSID CHAN RATE S:N INT CAPS\n" "freebsdap 00:11:95:c3:0d:ac 1 54M -66:-96 100 ES WME\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:740 msgid "The client machine found the AP and can be associated with it:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:754 #, no-wrap msgid "" "# ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap\n" "# ifconfig wlan0\n" " wlan0: flags=8843 metric 0 mtu 1500\n" "\t ether 00:11:95:d5:43:62\n" "\t inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255\n" "\t media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g\n" "\t status: associated\n" "\t ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac\n" "\t country US ecm authmode OPEN privacy OFF txpower 21.5 bmiss 7\n" "\t scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7\n" "\t roam:rate 5 protmode CTS wme burst\n" msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:757 #, no-wrap msgid "WPA2 Host-based Access Point" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:762 msgid "" "This section focuses on setting up a FreeBSD access point using the WPA2 " "security protocol. More details regarding WPA and the configuration of WPA-" "based wireless clients can be found in crossref:advanced-networking[network-" "wireless-wpa, WPA with EAP-TLS]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:764 msgid "" "The man:hostapd[8] daemon is used to deal with client authentication and key " "management on the WPA2-enabled AP." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:767 msgid "" "The following configuration operations are performed on the FreeBSD machine " "acting as the AP. Once the AP is correctly working, man:hostapd[8] can be " "automatically started at boot with this line in [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:771 #, no-wrap msgid "hostapd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:775 msgid "" "Before trying to configure man:hostapd[8], first configure the basic " "settings introduced in crossref:advanced-networking[network-wireless-ap-" "basic, Basic Settings]." msgstr "" #. type: Title ===== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:776 #, no-wrap msgid "WPA2-PSK" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:779 msgid "" "WPA2-PSK is intended for small networks where the use of a backend " "authentication server is not possible or desired." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:781 msgid "The configuration is done in [.filename]#/etc/hostapd.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:793 #, no-wrap msgid "" "interface=wlan0 <.>\n" "debug=1 <.>\n" "ctrl_interface=/var/run/hostapd <.>\n" "ctrl_interface_group=wheel <.>\n" "ssid=freebsdap <.>\n" "wpa=2 <.>\n" "wpa_passphrase=freebsdmall <.>\n" "wpa_key_mgmt=WPA-PSK <.>\n" "wpa_pairwise=CCMP <.>\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:796 msgid "Wireless interface used for the access point." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:797 msgid "" "Level of verbosity used during the execution of man:hostapd[8]. A value of " "`1` represents the minimal level." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:798 msgid "" "Pathname of the directory used by man:hostapd[8] to store domain socket " "files for communication with external programs such as man:hostapd_cli[8]. " "The default value is used in this example." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:799 msgid "The group allowed to access the control interface files." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:800 msgid "The wireless network name, or SSID, that will appear in wireless scans." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:801 msgid "" "Enable WPA and specify which WPA authentication protocol will be required. A " "value of `2` configures the AP for WPA2 and is recommended. Set to `1` only " "if the obsolete WPA is required." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:802 msgid "ASCII passphrase for WPA authentication." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:803 msgid "The key management protocol to use. This example sets WPA-PSK." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:804 msgid "" "Encryption algorithms accepted by the access point. In this example, only " "the CCMP (AES) cipher is accepted. CCMP is an alternative to TKIP and is " "strongly preferred when possible. TKIP should be allowed only when there are " "stations incapable of using CCMP." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:806 msgid "The next step is to start man:hostapd[8]:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:810 #, no-wrap msgid "# service hostapd forcestart\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:827 #, no-wrap msgid "" "# ifconfig wlan0\n" "wlan0: flags=8943 metric 0 mtu 1500\n" "\tether 04:f0:21:16:8e:10\n" "\tinet6 fe80::6f0:21ff:fe16:8e10%wlan0 prefixlen 64 scopeid 0x9\n" "\tnd6 options=21\n" "\tmedia: IEEE 802.11 Wireless Ethernet autoselect mode 11na \n" "\tstatus: running\n" "\tssid No5ignal channel 36 (5180 MHz 11a ht/40+) bssid 04:f0:21:16:8e:10\n" "\tcountry US ecm authmode WPA2/802.11i privacy MIXED deftxkey 2\n" "\tAES-CCM 2:128-bit AES-CCM 3:128-bit txpower 17 mcastrate 6 mgmtrate 6\n" "\tscanvalid 60 ampdulimit 64k ampdudensity 8 shortgi wme burst\n" "\tdtimperiod 1 -dfs\n" "\tgroups: wlan\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:832 msgid "" "Once the AP is running, the clients can associate with it. See " "crossref:advanced-networking[network-wireless-ap-basic, Basic Settings] for " "more details. It is possible to see the stations associated with the AP " "using `ifconfig _wlan0_ list sta`." msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:834 #, no-wrap msgid "USB Tethering" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:838 msgid "" "Many cellphones provide the option to share their data connection over USB " "(often called \"tethering\"). This feature uses one of RNDIS, CDC, or a " "custom Apple(R) iPhone(R)/iPad(R) protocol." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:840 msgid "Android(TM) devices generally use the man:urndis[4] driver." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:841 msgid "Apple(R) devices use the man:ipheth[4] driver." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:842 msgid "Older devices will often use the man:cdce[4] driver." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:844 msgid "Before attaching a device, load the appropriate driver into the kernel:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:850 #, no-wrap msgid "" "# kldload if_urndis\n" "# kldload if_cdce\n" "# kldload if_ipheth\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:854 msgid "" "Once the device is attached ``ue``_0_ will be available for use like a " "normal network device. Be sure that the \"USB tethering\" option is enabled " "on the device." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:856 msgid "" "To make this change permanent and load the driver as a module at boot time, " "place the appropriate line of the following in [.filename]#/boot/" "loader.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:862 #, no-wrap msgid "" "if_urndis_load=\"YES\"\n" "if_cdce_load=\"YES\"\n" "if_ipheth_load=\"YES\"\n" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:865 #, no-wrap msgid "Bluetooth" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:870 msgid "" "Bluetooth is a wireless technology for creating personal networks operating " "in the 2.4 GHz unlicensed band, with a range of 10 meters. Networks are " "usually formed ad-hoc from portable devices such as cellular phones, " "handhelds, and laptops. Unlike Wi-Fi wireless technology, Bluetooth offers " "higher level service profiles, such as FTP-like file servers, file pushing, " "voice transport, serial line emulation, and more." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:873 msgid "" "This section describes the use of a USB Bluetooth dongle on a FreeBSD " "system. It then describes the various Bluetooth protocols and utilities." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:874 #, no-wrap msgid "Loading Bluetooth Support" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:881 msgid "" "The Bluetooth stack in FreeBSD is implemented using the man:netgraph[4] " "framework. A broad variety of Bluetooth USB dongles is supported by " "man:ng_ubt[4]. Broadcom BCM2033 based Bluetooth devices are supported by " "the man:ubtbcmfw[4] and man:ng_ubt[4] drivers. The 3Com Bluetooth PC Card " "3CRWB60-A is supported by the man:ng_bt3c[4] driver. Serial and UART based " "Bluetooth devices are supported by man:sio[4], man:ng_h4[4], and " "man:hcseriald[8]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:884 msgid "" "Before attaching a device, determine which of the above drivers it uses, " "then load the driver. For example, if the device uses the man:ng_ubt[4] " "driver:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:888 #, no-wrap msgid "# kldload ng_ubt\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:891 msgid "" "If the Bluetooth device will be attached to the system during system " "startup, the system can be configured to load the module at boot time by " "adding the driver to [.filename]#/boot/loader.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:895 #, no-wrap msgid "ng_ubt_load=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:899 msgid "" "Once the driver is loaded, plug in the USB dongle. If the driver load was " "successful, output similar to the following should appear on the console and " "in [.filename]#/var/log/messages#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:906 #, no-wrap msgid "" "ubt0: vendor 0x0a12 product 0x0001, rev 1.10/5.25, addr 2\n" "ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2\n" "ubt0: Interface 1 (alt.config 5) endpoints: isoc-in=0x83, isoc-out=0x3,\n" " wMaxPacketSize=49, nframes=6, buffer size=294\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:911 msgid "" "To start and stop the Bluetooth stack, use its startup script. It is a good " "idea to stop the stack before unplugging the device. Starting the bluetooth " "stack might require man:hcsecd[8] to be started. When starting the stack, " "the output should be similar to the following:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:926 #, no-wrap msgid "" "# service bluetooth start ubt0\n" "BD_ADDR: 00:02:72:00:d4:1a\n" "Features: 0xff 0xff 0xf 00 00 00 00 00\n" "<3-Slot> <5-Slot> \n" " \n" " \n" " \n" " \n" "Max. ACL packet size: 192 bytes\n" "Number of ACL packets: 8\n" "Max. SCO packet size: 64 bytes\n" "Number of SCO packets: 8\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:928 #, no-wrap msgid "Finding Other Bluetooth Devices" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:933 msgid "" "The Host Controller Interface (HCI) provides a uniform method for accessing " "Bluetooth baseband capabilities. In FreeBSD, a netgraph HCI node is created " "for each Bluetooth device. For more details, refer to man:ng_hci[4]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:940 msgid "" "One of the most common tasks is discovery of Bluetooth devices within RF " "proximity. This operation is called _inquiry_. Inquiry and other HCI " "related operations are done using man:hccontrol[8]. The example below shows " "how to find out which Bluetooth devices are in range. The list of devices " "should be displayed in a few seconds. Note that a remote device will only " "answer the inquiry if it is set to _discoverable_ mode." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:953 #, no-wrap msgid "" "% hccontrol -n ubt0hci inquiry\n" "Inquiry result, num_responses=1\n" "Inquiry result #0\n" " BD_ADDR: 00:80:37:29:19:a4\n" " Page Scan Rep. Mode: 0x1\n" " Page Scan Period Mode: 00\n" " Page Scan Mode: 00\n" " Class: 52:02:04\n" " Clock offset: 0x78ef\n" "Inquiry complete. Status: No error [00]\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:959 msgid "" "The `BD_ADDR` is the unique address of a Bluetooth device, similar to the " "MAC address of a network card. This address is needed for further " "communication with a device and it is possible to assign a human readable " "name to a `BD_ADDR`. Information regarding the known Bluetooth hosts is " "contained in [.filename]#/etc/bluetooth/hosts#. The following example shows " "how to obtain the human readable name that was assigned to the remote device:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:965 #, no-wrap msgid "" "% hccontrol -n ubt0hci remote_name_request 00:80:37:29:19:a4\n" "BD_ADDR: 00:80:37:29:19:a4\n" "Name: Pav's T39\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:969 msgid "" "If an inquiry is performed on a remote Bluetooth device, it will find the " "computer as \"your.host.name (ubt0)\". The name assigned to the local " "device can be changed at any time." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:972 msgid "" "Remote devices can be assigned aliases in [.filename]#/etc/bluetooth/" "hosts#. More information about [.filename]#/etc/bluetooth/hosts# file might " "be found in man:bluetooth.hosts[5]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:975 msgid "" "The Bluetooth system provides a point-to-point connection between two " "Bluetooth units, or a point-to-multipoint connection which is shared among " "several Bluetooth devices. The following example shows how to create a " "connection to a remote device:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:979 #, no-wrap msgid "% hccontrol -n ubt0hci create_connection BT_ADDR\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:982 msgid "" "`create_connection` accepts `BT_ADDR` as well as host aliases in " "[.filename]#/etc/bluetooth/hosts#." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:984 msgid "" "The following example shows how to obtain the list of active baseband " "connections for the local device:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:990 #, no-wrap msgid "" "% hccontrol -n ubt0hci read_connection_list\n" "Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State\n" "00:80:37:29:19:a4 41 ACL 0 MAST NONE 0 0 OPEN\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:994 msgid "" "A _connection handle_ is useful when termination of the baseband connection " "is required, though it is normally not required to do this by hand. The " "stack will automatically terminate inactive baseband connections." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1000 #, no-wrap msgid "" "# hccontrol -n ubt0hci disconnect 41\n" "Connection handle: 41\n" "Reason: Connection terminated by local host [0x16]\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1004 msgid "" "Type `hccontrol help` for a complete listing of available HCI commands. " "Most of the HCI commands do not require superuser privileges." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1005 #, no-wrap msgid "Device Pairing" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1016 msgid "" "By default, Bluetooth communication is not authenticated, and any device can " "talk to any other device. A Bluetooth device, such as a cellular phone, may " "choose to require authentication to provide a particular service. Bluetooth " "authentication is normally done with a _PIN code_, an ASCII string up to 16 " "characters in length. The user is required to enter the same PIN code on " "both devices. Once the user has entered the PIN code, both devices will " "generate a _link key_. After that, the link key can be stored either in the " "devices or in a persistent storage. Next time, both devices will use the " "previously generated link key. This procedure is called _pairing_. Note " "that if the link key is lost by either device, the pairing must be repeated." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1020 msgid "" "The man:hcsecd[8] daemon is responsible for handling Bluetooth " "authentication requests. The default configuration file is [.filename]#/etc/" "bluetooth/hcsecd.conf#. An example section for a cellular phone with the " "PIN code set to `1234` is shown below:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1029 #, no-wrap msgid "" "device {\n" " bdaddr 00:80:37:29:19:a4;\n" " name \"Pav's T39\";\n" " key nokey;\n" " pin \"1234\";\n" " }\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1039 msgid "" "The only limitation on PIN codes is length. Some devices, such as Bluetooth " "headsets, may have a fixed PIN code built in. The `-d` switch forces " "man:hcsecd[8] to stay in the foreground, so it is easy to see what is " "happening. Set the remote device to receive pairing and initiate the " "Bluetooth connection to the remote device. The remote device should " "indicate that pairing was accepted and request the PIN code. Enter the same " "PIN code listed in [.filename]#hcsecd.conf#. Now the computer and the " "remote device are paired. Alternatively, pairing can be initiated on the " "remote device." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1041 msgid "" "The following line can be added to [.filename]#/etc/rc.conf# to configure " "man:hcsecd[8] to start automatically on system start:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1045 #, no-wrap msgid "hcsecd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1048 msgid "The following is a sample of the man:hcsecd[8] daemon output:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1057 #, no-wrap msgid "" "hcsecd[16484]: Got Link_Key_Request event from 'ubt0hci', remote bdaddr 0:80:37:29:19:a4\n" "hcsecd[16484]: Found matching entry, remote bdaddr 0:80:37:29:19:a4, name 'Pav's T39', link key doesn't exist\n" "hcsecd[16484]: Sending Link_Key_Negative_Reply to 'ubt0hci' for remote bdaddr 0:80:37:29:19:a4\n" "hcsecd[16484]: Got PIN_Code_Request event from 'ubt0hci', remote bdaddr 0:80:37:29:19:a4\n" "hcsecd[16484]: Found matching entry, remote bdaddr 0:80:37:29:19:a4, name 'Pav's T39', PIN code exists\n" "hcsecd[16484]: Sending PIN_Code_Reply to 'ubt0hci' for remote bdaddr 0:80:37:29:19:a4\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1059 #, no-wrap msgid "Network Access with PPP Profiles" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1063 msgid "" "A Dial-Up Networking (DUN) profile can be used to configure a cellular phone " "as a wireless modem for connecting to a dial-up Internet access server. It " "can also be used to configure a computer to receive data calls from a " "cellular phone." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1066 msgid "" "Network access with a PPP profile can be used to provide LAN access for a " "single Bluetooth device or multiple Bluetooth devices. It can also provide " "PC to PC connection using PPP networking over serial cable emulation." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1070 msgid "" "In FreeBSD, these profiles are implemented with man:ppp[8] and the " "man:rfcomm_pppd[8] wrapper which converts a Bluetooth connection into " "something PPP can use. Before a profile can be used, a new PPP label must " "be created in [.filename]#/etc/ppp/ppp.conf#. Consult man:rfcomm_pppd[8] " "for examples." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1072 msgid "" "In this example, man:rfcomm_pppd[8] is used to open a connection to a remote " "device with a `BD_ADDR` of `00:80:37:29:19:a4` on a DUNRFCOMM channel:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1076 #, no-wrap msgid "# rfcomm_pppd -a 00:80:37:29:19:a4 -c -C dun -l rfcomm-dialup\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1081 msgid "" "The actual channel number will be obtained from the remote device using the " "SDP protocol. It is possible to specify the RFCOMM channel by hand, and in " "this case man:rfcomm_pppd[8] will not perform the SDP query. Use " "man:sdpcontrol[8] to find out the RFCOMM channel on the remote device." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1087 msgid "" "In order to provide network access with the PPPLAN service, man:sdpd[8] must " "be running and a new entry for LAN clients must be created in [.filename]#/" "etc/ppp/ppp.conf#. Consult man:rfcomm_pppd[8] for examples. Finally, start " "the RFCOMMPPP server on a valid RFCOMM channel number. The RFCOMMPPP server " "will automatically register the Bluetooth LAN service with the local SDP " "daemon. The example below shows how to start the RFCOMMPPP server." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1091 #, no-wrap msgid "# rfcomm_pppd -s -C 7 -l rfcomm-server\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1093 #, no-wrap msgid "Bluetooth Protocols" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1096 msgid "" "This section provides an overview of the various Bluetooth protocols, their " "function, and associated utilities." msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1097 #, no-wrap msgid "Logical Link Control and Adaptation Protocol (L2CAP)" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1101 msgid "" "The Logical Link Control and Adaptation Protocol (L2CAP) provides connection-" "oriented and connectionless data services to upper layer protocols. L2CAP " "permits higher level protocols and applications to transmit and receive " "L2CAP data packets up to 64 kilobytes in length." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1107 msgid "" "L2CAP is based around the concept of _channels_. A channel is a logical " "connection on top of a baseband connection, where each channel is bound to a " "single protocol in a many-to-one fashion. Multiple channels can be bound to " "the same protocol, but a channel cannot be bound to multiple protocols. " "Each L2CAP packet received on a channel is directed to the appropriate " "higher level protocol. Multiple channels can share the same baseband " "connection." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1112 msgid "" "In FreeBSD, a netgraph L2CAP node is created for each Bluetooth device. " "This node is normally connected to the downstream Bluetooth HCI node and " "upstream Bluetooth socket nodes. The default name for the L2CAP node is " "\"devicel2cap\". For more details refer to man:ng_l2cap[4]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1115 msgid "" "A useful command is man:l2ping[8], which can be used to ping other devices. " "Some Bluetooth implementations might not return all of the data sent to " "them, so `0 bytes` in the following example is normal." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1123 #, no-wrap msgid "" "# l2ping -a 00:80:37:29:19:a4\n" "0 bytes from 0:80:37:29:19:a4 seq_no=0 time=48.633 ms result=0\n" "0 bytes from 0:80:37:29:19:a4 seq_no=1 time=37.551 ms result=0\n" "0 bytes from 0:80:37:29:19:a4 seq_no=2 time=28.324 ms result=0\n" "0 bytes from 0:80:37:29:19:a4 seq_no=3 time=46.150 ms result=0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1127 msgid "" "The man:l2control[8] utility is used to perform various operations on L2CAP " "nodes. This example shows how to obtain the list of logical connections " "(channels) and the list of baseband connections for the local device:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1138 #, no-wrap msgid "" "% l2control -a 00:02:72:00:d4:1a read_channel_list\n" "L2CAP channels:\n" "Remote BD_ADDR SCID/ DCID PSM IMTU/ OMTU State\n" "00:07:e0:00:0b:ca 66/ 64 3 132/ 672 OPEN\n" "% l2control -a 00:02:72:00:d4:1a read_connection_list\n" "L2CAP connections:\n" "Remote BD_ADDR Handle Flags Pending State\n" "00:07:e0:00:0b:ca 41 O 0 OPEN\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1143 msgid "" "Another diagnostic tool is man:btsockstat[1]. It is similar to " "man:netstat[1], but for Bluetooth network-related data structures. The " "example below shows the same logical connection as man:l2control[8] above." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1156 #, no-wrap msgid "" "% btsockstat\n" "Active L2CAP sockets\n" "PCB Recv-Q Send-Q Local address/PSM Foreign address CID State\n" "c2afe900 0 0 00:02:72:00:d4:1a/3 00:07:e0:00:0b:ca 66 OPEN\n" "Active RFCOMM sessions\n" "L2PCB PCB Flag MTU Out-Q DLCs State\n" "c2afe900 c2b53380 1 127 0 Yes OPEN\n" "Active RFCOMM sockets\n" "PCB Recv-Q Send-Q Local address Foreign address Chan DLCI State\n" "c2e8bc80 0 250 00:02:72:00:d4:1a 00:07:e0:00:0b:ca 3 6 OPEN\n" msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1158 #, no-wrap msgid "Radio Frequency Communication (RFCOMM)" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1163 msgid "" "The RFCOMM protocol provides emulation of serial ports over the L2CAP " "protocol. RFCOMM is a simple transport protocol, with additional provisions " "for emulating the 9 circuits of RS-232 (EIATIA-232-E) serial ports. It " "supports up to 60 simultaneous connections (RFCOMM channels) between two " "Bluetooth devices." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1167 msgid "" "For the purposes of RFCOMM, a complete communication path involves two " "applications running on the communication endpoints with a communication " "segment between them. RFCOMM is intended to cover applications that make " "use of the serial ports of the devices in which they reside. The " "communication segment is a direct connect Bluetooth link from one device to " "another." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1170 msgid "" "RFCOMM is only concerned with the connection between the devices in the " "direct connect case, or between the device and a modem in the network case. " "RFCOMM can support other configurations, such as modules that communicate " "via Bluetooth wireless technology on one side and provide a wired interface " "on the other side." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1172 msgid "In FreeBSD, RFCOMM is implemented at the Bluetooth sockets layer." msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1173 #, no-wrap msgid "Service Discovery Protocol (SDP)" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1177 msgid "" "The Service Discovery Protocol (SDP) provides the means for client " "applications to discover the existence of services provided by server " "applications as well as the attributes of those services. The attributes of " "a service include the type or class of service offered and the mechanism or " "protocol information needed to utilize the service." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1184 msgid "" "SDP involves communication between a SDP server and a SDP client. The " "server maintains a list of service records that describe the characteristics " "of services associated with the server. Each service record contains " "information about a single service. A client may retrieve information from " "a service record maintained by the SDP server by issuing a SDP request. If " "the client, or an application associated with the client, decides to use a " "service, it must open a separate connection to the service provider in order " "to utilize the service. SDP provides a mechanism for discovering services " "and their attributes, but it does not provide a mechanism for utilizing " "those services." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1188 msgid "" "Normally, a SDP client searches for services based on some desired " "characteristics of the services. However, there are times when it is " "desirable to discover which types of services are described by an SDP " "server's service records without any prior information about the services. " "This process of looking for any offered services is called _browsing_." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1191 msgid "" "The Bluetooth SDP server, man:sdpd[8], and command line client, " "man:sdpcontrol[8], are included in the standard FreeBSD installation. The " "following example shows how to perform a SDP browse query." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1202 #, no-wrap msgid "" "% sdpcontrol -a 00:01:03:fc:6e:ec browse\n" "Record Handle: 00000000\n" "Service Class ID List:\n" " Service Discovery Server (0x1000)\n" "Protocol Descriptor List:\n" " L2CAP (0x0100)\n" " Protocol specific parameter #1: u/int/uuid16 1\n" " Protocol specific parameter #2: u/int/uuid16 1\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1206 #, no-wrap msgid "" "Record Handle: 0x00000001\n" "Service Class ID List:\n" " Browse Group Descriptor (0x1001)\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1216 #, no-wrap msgid "" "Record Handle: 0x00000002\n" "Service Class ID List:\n" " LAN Access Using PPP (0x1102)\n" "Protocol Descriptor List:\n" " L2CAP (0x0100)\n" " RFCOMM (0x0003)\n" " Protocol specific parameter #1: u/int8/bool 1\n" "Bluetooth Profile Descriptor List:\n" " LAN Access Using PPP (0x1102) ver. 1.0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1223 msgid "" "Note that each service has a list of attributes, such as the RFCOMM " "channel. Depending on the service, the user might need to make note of some " "of the attributes. Some Bluetooth implementations do not support service " "browsing and may return an empty list. In this case, it is possible to " "search for the specific service. The example below shows how to search for " "the OBEX Object Push (OPUSH) service:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1227 #, no-wrap msgid "% sdpcontrol -a 00:01:03:fc:6e:ec search OPUSH\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1231 msgid "" "Offering services on FreeBSD to Bluetooth clients is done with the " "man:sdpd[8] server. The following line can be added to [.filename]#/etc/" "rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1235 #, no-wrap msgid "sdpd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1238 msgid "Then the man:sdpd[8] daemon can be started with:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1242 #, no-wrap msgid "# service sdpd start\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1247 msgid "" "The local server application that wants to provide a Bluetooth service to " "remote clients will register the service with the local SDP daemon. An " "example of such an application is man:rfcomm_pppd[8]. Once started, it will " "register the Bluetooth LAN service with the local SDP daemon." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1249 msgid "" "The list of services registered with the local SDP server can be obtained by " "issuing a SDP browse query via the local control channel:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1253 #, no-wrap msgid "# sdpcontrol -l browse\n" msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1255 #, no-wrap msgid "OBEX Object Push (OPUSH)" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1259 msgid "" "Object Exchange (OBEX) is a widely used protocol for simple file transfers " "between mobile devices. Its main use is in infrared communication, where it " "is used for generic file transfers between notebooks or PDAs, and for " "sending business cards or calendar entries between cellular phones and other " "devices with Personal Information Manager (PIM) applications." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1261 msgid "" "The OBEX server and client are implemented by obexapp, which can be " "installed using the package:comms/obexapp[] package or port." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1269 msgid "" "The OBEX client is used to push and/or pull objects from the OBEX server. " "An example object is a business card or an appointment. The OBEX client can " "obtain the RFCOMM channel number from the remote device via SDP. This can " "be done by specifying the service name instead of the RFCOMM channel " "number. Supported service names are: `IrMC`, `FTRN`, and `OPUSH`. It is " "also possible to specify the RFCOMM channel as a number. Below is an " "example of an OBEX session where the device information object is pulled " "from the cellular phone, and a new object, the business card, is pushed into " "the phone's directory." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1279 #, no-wrap msgid "" "% obexapp -a 00:80:37:29:19:a4 -C IrMC\n" "obex> get telecom/devinfo.txt devinfo-t39.txt\n" "Success, response: OK, Success (0x20)\n" "obex> put new.vcf\n" "Success, response: OK, Success (0x20)\n" "obex> di\n" "Success, response: OK, Success (0x20)\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1286 msgid "" "In order to provide the OPUSH service, man:sdpd[8] must be running and a " "root folder, where all incoming objects will be stored, must be created. " "The default path to the root folder is [.filename]#/var/spool/obex#. " "Finally, start the OBEX server on a valid RFCOMM channel number. The OBEX " "server will automatically register the OPUSH service with the local SDP " "daemon. The example below shows how to start the OBEX server." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1290 #, no-wrap msgid "# obexapp -s -C 10\n" msgstr "" #. type: Title ==== #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1292 #, no-wrap msgid "Serial Port Profile (SPP)" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1296 msgid "" "The Serial Port Profile (SPP) allows Bluetooth devices to perform serial " "cable emulation. This profile allows legacy applications to use Bluetooth " "as a cable replacement, through a virtual serial port abstraction." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1301 msgid "" "In FreeBSD, man:rfcomm_sppd[1] implements SPP and a pseudo tty is used as a " "virtual serial port abstraction. The example below shows how to connect to " "a remote device's serial port service. A RFCOMM channel does not have to be " "specified as man:rfcomm_sppd[1] can obtain it from the remote device via " "SDP. To override this, specify a RFCOMM channel on the command line." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1307 #, no-wrap msgid "" "# rfcomm_sppd -a 00:07:E0:00:0B:CA -t\n" "rfcomm_sppd[94692]: Starting on /dev/pts/6...\n" "/dev/pts/6\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1310 msgid "Once connected, the pseudo tty can be used as serial port:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1314 #, no-wrap msgid "# cu -l /dev/pts/6\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1317 msgid "The pseudo tty is printed on stdout and can be read by wrapper scripts:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1322 #, no-wrap msgid "" "PTS=`rfcomm_sppd -a 00:07:E0:00:0B:CA -t`\n" "cu -l $PTS\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1330 msgid "" "By default, when FreeBSD is accepting a new connection, it tries to perform " "a role switch and become master. Some older Bluetooth devices which do not " "support role switching will not be able to connect. Since role switching is " "performed when a new connection is being established, it is not possible to " "ask the remote device if it supports role switching. However, there is a " "HCI option to disable role switching on the local side:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1334 #, no-wrap msgid "# hccontrol -n ubt0hci write_node_role_switch 0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1338 msgid "" "To display Bluetooth packets, use the third-party package hcidump, which can " "be installed using the package:comms/hcidump[] package or port. This " "utility is similar to man:tcpdump[1] and can be used to display the contents " "of Bluetooth packets on the terminal and to dump the Bluetooth packets to a " "file." msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1340 #, no-wrap msgid "Bridging" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1344 msgid "" "It is sometimes useful to divide a network, such as an Ethernet segment, " "into network segments without having to create IP subnets and use a router " "to connect the segments together. A device that connects two networks " "together in this fashion is called a \"bridge\"." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1349 msgid "" "A bridge works by learning the MAC addresses of the devices on each of its " "network interfaces. It forwards traffic between networks only when the " "source and destination MAC addresses are on different networks. In many " "respects, a bridge is like an Ethernet switch with very few ports. A " "FreeBSD system with multiple network interfaces can be configured to act as " "a bridge." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1351 msgid "Bridging can be useful in the following situations:" msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1352 #, no-wrap msgid "Connecting Networks" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1356 msgid "" "The basic operation of a bridge is to join two or more network segments. " "There are many reasons to use a host-based bridge instead of networking " "equipment, such as cabling constraints or firewalling. A bridge can also " "connect a wireless interface running in hostap mode to a wired network and " "act as an access point." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1357 #, no-wrap msgid "Filtering/Traffic Shaping Firewall" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1359 msgid "" "A bridge can be used when firewall functionality is needed without routing " "or Network Address Translation (NAT)." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1364 msgid "" "An example is a small company that is connected via DSL or ISDN to an ISP. " "There are thirteen public IP addresses from the ISP and ten computers on the " "network. In this situation, using a router-based firewall is difficult " "because of subnetting issues. A bridge-based firewall can be configured " "without any IP addressing issues." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1365 #, no-wrap msgid "Network Tap" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1367 msgid "" "A bridge can join two network segments in order to inspect all Ethernet " "frames that pass between them using man:bpf[4] and man:tcpdump[1] on the " "bridge interface, or by sending a copy of all frames out on an additional " "interface known as a span port." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1368 #, no-wrap msgid "Layer 2 VPN" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1370 msgid "" "Two Ethernet networks can be joined across an IP link by bridging the " "networks to an EtherIP tunnel or a man:tap[4] based solution such as OpenVPN." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1371 #, no-wrap msgid "Layer 2 Redundancy" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1373 msgid "" "A network can be connected together with multiple links and use the Spanning " "Tree Protocol (STP) to block redundant paths." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1376 msgid "" "This section describes how to configure a FreeBSD system as a bridge using " "man:if_bridge[4]. A netgraph bridging driver is also available, and is " "described in man:ng_bridge[4]." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1381 msgid "" "Packet filtering can be used with any firewall package that hooks into the " "man:pfil[9] framework. The bridge can be used as a traffic shaper with " "man:altq[4] or man:dummynet[4]." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1383 #, no-wrap msgid "Enabling the Bridge" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1387 msgid "" "In FreeBSD, man:if_bridge[4] is a kernel module which is automatically " "loaded by man:ifconfig[8] when creating a bridge interface. It is also " "possible to compile bridge support into a custom kernel by adding `device " "if_bridge` to the custom kernel configuration file." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1390 msgid "" "The bridge is created using interface cloning. To create the bridge " "interface:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1401 #, no-wrap msgid "" "# ifconfig bridge create\n" "bridge0\n" "# ifconfig bridge0\n" "bridge0: flags=8802 metric 0 mtu 1500\n" " ether 96:3d:4b:f1:79:7a\n" " id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15\n" " maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200\n" " root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1406 msgid "" "When a bridge interface is created, it is automatically assigned a randomly " "generated Ethernet address. The `maxaddr` and `timeout` parameters control " "how many MAC addresses the bridge will keep in its forwarding table and how " "many seconds before each entry is removed after it is last seen. The other " "parameters control how STP operates." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1409 msgid "" "Next, specify which network interfaces to add as members of the bridge. For " "the bridge to forward packets, all member interfaces and the bridge need to " "be up:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1415 #, no-wrap msgid "" "# ifconfig bridge0 addm fxp0 addm fxp1 up\n" "# ifconfig fxp0 up\n" "# ifconfig fxp1 up\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1419 msgid "" "The bridge can now forward Ethernet frames between [.filename]#fxp0# and " "[.filename]#fxp1#. Add the following lines to [.filename]#/etc/rc.conf# so " "the bridge is created at startup:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1426 #, no-wrap msgid "" "cloned_interfaces=\"bridge0\"\n" "ifconfig_bridge0=\"addm fxp0 addm fxp1 up\"\n" "ifconfig_fxp0=\"up\"\n" "ifconfig_fxp1=\"up\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1431 msgid "" "If the bridge host needs an IP address, set it on the bridge interface, not " "on the member interfaces. The address can be set statically or via DHCP. " "This example sets a static IP address:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1435 #, no-wrap msgid "# ifconfig bridge0 inet 192.168.0.1/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1439 msgid "" "It is also possible to assign an IPv6 address to a bridge interface. To " "make the changes permanent, add the addressing information to [.filename]#/" "etc/rc.conf#." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1445 msgid "" "When packet filtering is enabled, bridged packets will pass through the " "filter inbound on the originating interface on the bridge interface, and " "outbound on the appropriate interfaces. Either stage can be disabled. When " "direction of the packet flow is important, it is best to firewall on the " "member interfaces rather than the bridge itself." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1448 msgid "" "The bridge has several configurable settings for passing non-IP and IP " "packets, and layer2 firewalling with man:ipfw[8]. See man:if_bridge[4] for " "more information." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1450 #, no-wrap msgid "Enabling Spanning Tree" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1455 msgid "" "For an Ethernet network to function properly, only one active path can exist " "between two devices. The STP protocol detects loops and puts redundant " "links into a blocked state. Should one of the active links fail, STP " "calculates a different tree and enables one of the blocked paths to restore " "connectivity to all points in the network." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1459 msgid "" "The Rapid Spanning Tree Protocol (RSTP or 802.1w) provides backwards " "compatibility with legacy STP. RSTP provides faster convergence and " "exchanges information with neighboring switches to quickly transition to " "forwarding mode without creating loops. FreeBSD supports RSTP and STP as " "operating modes, with RSTP being the default mode." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1462 msgid "" "STP can be enabled on member interfaces using man:ifconfig[8]. For a bridge " "with [.filename]#fxp0# and [.filename]#fxp1# as the current interfaces, " "enable STP with:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1477 #, no-wrap msgid "" "# ifconfig bridge0 stp fxp0 stp fxp1\n" "bridge0: flags=8843 metric 0 mtu 1500\n" " ether d6:cf:d5:a0:94:6d\n" " id 00:01:02:4b:d4:50 priority 32768 hellotime 2 fwddelay 15\n" " maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200\n" " root id 00:01:02:4b:d4:50 priority 32768 ifcost 0 port 0\n" " member: fxp0 flags=1c7\n" " port 3 priority 128 path cost 200000 proto rstp\n" " role designated state forwarding\n" " member: fxp1 flags=1c7\n" " port 4 priority 128 path cost 200000 proto rstp\n" " role designated state forwarding\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1481 msgid "" "This bridge has a spanning tree ID of `00:01:02:4b:d4:50` and a priority of " "`32768`. As the `root id` is the same, it indicates that this is the root " "bridge for the tree." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1483 msgid "Another bridge on the network also has STP enabled:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1497 #, no-wrap msgid "" "bridge0: flags=8843 metric 0 mtu 1500\n" " ether 96:3d:4b:f1:79:7a\n" " id 00:13:d4:9a:06:7a priority 32768 hellotime 2 fwddelay 15\n" " maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200\n" " root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4\n" " member: fxp0 flags=1c7\n" " port 4 priority 128 path cost 200000 proto rstp\n" " role root state forwarding\n" " member: fxp1 flags=1c7\n" " port 5 priority 128 path cost 200000 proto rstp\n" " role designated state forwarding\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1501 msgid "" "The line `root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4` " "shows that the root bridge is `00:01:02:4b:d4:50` and has a path cost of " "`400000` from this bridge. The path to the root bridge is via `port 4` " "which is [.filename]#fxp0#." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1502 #, no-wrap msgid "Bridge Interface Parameters" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1507 msgid "" "Several `ifconfig` parameters are unique to bridge interfaces. This section " "summarizes some common uses for these parameters. The complete list of " "available parameters is described in man:ifconfig[8]." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1508 #, no-wrap msgid "private" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1512 msgid "" "A private interface does not forward any traffic to any other port that is " "also designated as a private interface. The traffic is blocked " "unconditionally so no Ethernet frames will be forwarded, including ARP " "packets. If traffic needs to be selectively blocked, a firewall should be " "used instead." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1513 #, no-wrap msgid "span" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1518 msgid "" "A span port transmits a copy of every Ethernet frame received by the " "bridge. The number of span ports configured on a bridge is unlimited, but " "if an interface is designated as a span port, it cannot also be used as a " "regular bridge port. This is most useful for snooping a bridged network " "passively on another host connected to one of the span ports of the bridge. " "For example, to send a copy of all frames out the interface named " "[.filename]#fxp4#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1522 #, no-wrap msgid "# ifconfig bridge0 span fxp4\n" msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1524 #, no-wrap msgid "sticky" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1529 msgid "" "If a bridge member interface is marked as sticky, dynamically learned " "address entries are treated as static entries in the forwarding cache. " "Sticky entries are never aged out of the cache or replaced, even if the " "address is seen on a different interface. This gives the benefit of static " "address entries without the need to pre-populate the forwarding table. " "Clients learned on a particular segment of the bridge cannot roam to another " "segment." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1532 msgid "" "An example of using sticky addresses is to combine the bridge with VLANs in " "order to isolate customer networks without wasting IP address space. " "Consider that `CustomerA` is on `vlan100`, `CustomerB` is on `vlan101`, and " "the bridge has the address `192.168.0.1`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1537 #, no-wrap msgid "" "# ifconfig bridge0 addm vlan100 sticky vlan100 addm vlan101 sticky vlan101\n" "# ifconfig bridge0 inet 192.168.0.1/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1541 msgid "" "In this example, both clients see `192.168.0.1` as their default gateway. " "Since the bridge cache is sticky, one host cannot spoof the MAC address of " "the other customer in order to intercept their traffic." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1543 msgid "" "Any communication between the VLANs can be blocked using a firewall or, as " "seen in this example, private interfaces:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1547 #, no-wrap msgid "# ifconfig bridge0 private vlan100 private vlan101\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1550 msgid "" "The customers are completely isolated from each other and the full `/24` " "address range can be allocated without subnetting." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1553 msgid "" "The number of unique source MAC addresses behind an interface can be " "limited. Once the limit is reached, packets with unknown source addresses " "are dropped until an existing host cache entry expires or is removed." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1555 msgid "" "The following example sets the maximum number of Ethernet devices for " "`CustomerA` on `vlan100` to 10:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1559 #, no-wrap msgid "# ifconfig bridge0 ifmaxaddr vlan100 10\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1565 msgid "" "Bridge interfaces also support monitor mode, where the packets are discarded " "after man:bpf[4] processing and are not processed or forwarded further. " "This can be used to multiplex the input of two or more interfaces into a " "single man:bpf[4] stream. This is useful for reconstructing the traffic for " "network taps that transmit the RX/TX signals out through two separate " "interfaces. For example, to read the input from four network interfaces as " "one stream:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1570 #, no-wrap msgid "" "# ifconfig bridge0 addm fxp0 addm fxp1 addm fxp2 addm fxp3 monitor up\n" "# tcpdump -i bridge0\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1572 #, no-wrap msgid "SNMP Monitoring" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1576 msgid "" "The bridge interface and STP parameters can be monitored via man:bsnmpd[1] " "which is included in the FreeBSD base system. The exported bridge MIBs " "conform to IETF standards so any SNMP client or monitoring package can be " "used to retrieve the data." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1578 msgid "" "To enable monitoring on the bridge, uncomment this line in [.filename]#/etc/" "snmpd.config# by removing the beginning `+#+` symbol:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1582 #, no-wrap msgid "begemotSnmpdModulePath.\"bridge\" = \"/usr/lib/snmp_bridge.so\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1587 msgid "" "Other configuration settings, such as community names and access lists, may " "need to be modified in this file. See man:bsnmpd[1] and man:snmp_bridge[3] " "for more information. Once these edits are saved, add this line to " "[.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1591 #, no-wrap msgid "bsnmpd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1594 msgid "Then, start man:bsnmpd[1]:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1598 #, no-wrap msgid "# service bsnmpd start\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1603 msgid "" "The following examples use the Net-SNMP software (package:net-mgmt/net-" "snmp[]) to query a bridge from a client system. The package:net-mgmt/" "bsnmptools[] port can also be used. From the SNMP client which is running " "Net-SNMP, add the following lines to [.filename]#$HOME/.snmp/snmp.conf# in " "order to import the bridge MIB definitions:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1608 #, no-wrap msgid "" "mibdirs +/usr/share/snmp/mibs\n" "mibs +BRIDGE-MIB:RSTP-MIB:BEGEMOT-MIB:BEGEMOT-BRIDGE-MIB\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1611 msgid "To monitor a single bridge using the IETF BRIDGE-MIB (RFC4188):" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1630 #, no-wrap msgid "" "% snmpwalk -v 2c -c public bridge1.example.com mib-2.dot1dBridge\n" "BRIDGE-MIB::dot1dBaseBridgeAddress.0 = STRING: 66:fb:9b:6e:5c:44\n" "BRIDGE-MIB::dot1dBaseNumPorts.0 = INTEGER: 1 ports\n" "BRIDGE-MIB::dot1dStpTimeSinceTopologyChange.0 = Timeticks: (189959) 0:31:39.59 centi-seconds\n" "BRIDGE-MIB::dot1dStpTopChanges.0 = Counter32: 2\n" "BRIDGE-MIB::dot1dStpDesignatedRoot.0 = Hex-STRING: 80 00 00 01 02 4B D4 50\n" "...\n" "BRIDGE-MIB::dot1dStpPortState.3 = INTEGER: forwarding(5)\n" "BRIDGE-MIB::dot1dStpPortEnable.3 = INTEGER: enabled(1)\n" "BRIDGE-MIB::dot1dStpPortPathCost.3 = INTEGER: 200000\n" "BRIDGE-MIB::dot1dStpPortDesignatedRoot.3 = Hex-STRING: 80 00 00 01 02 4B D4 50\n" "BRIDGE-MIB::dot1dStpPortDesignatedCost.3 = INTEGER: 0\n" "BRIDGE-MIB::dot1dStpPortDesignatedBridge.3 = Hex-STRING: 80 00 00 01 02 4B D4 50\n" "BRIDGE-MIB::dot1dStpPortDesignatedPort.3 = Hex-STRING: 03 80\n" "BRIDGE-MIB::dot1dStpPortForwardTransitions.3 = Counter32: 1\n" "RSTP-MIB::dot1dStpVersion.0 = INTEGER: rstp(2)\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1635 msgid "" "The `dot1dStpTopChanges.0` value is two, indicating that the STP bridge " "topology has changed twice. A topology change means that one or more links " "in the network have changed or failed and a new tree has been calculated. " "The `dot1dStpTimeSinceTopologyChange.0` value will show when this happened." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1637 msgid "" "To monitor multiple bridge interfaces, the private BEGEMOT-BRIDGE-MIB can be " "used:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1655 #, no-wrap msgid "" "% snmpwalk -v 2c -c public bridge1.example.com\n" "enterprises.fokus.begemot.begemotBridge\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseName.\"bridge0\" = STRING: bridge0\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseName.\"bridge2\" = STRING: bridge2\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseAddress.\"bridge0\" = STRING: e:ce:3b:5a:9e:13\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseAddress.\"bridge2\" = STRING: 12:5e:4d:74:d:fc\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseNumPorts.\"bridge0\" = INTEGER: 1\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeBaseNumPorts.\"bridge2\" = INTEGER: 1\n" "...\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpTimeSinceTopologyChange.\"bridge0\" = Timeticks: (116927) 0:19:29.27 centi-seconds\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpTimeSinceTopologyChange.\"bridge2\" = Timeticks: (82773) 0:13:47.73 centi-seconds\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpTopChanges.\"bridge0\" = Counter32: 1\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpTopChanges.\"bridge2\" = Counter32: 1\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpDesignatedRoot.\"bridge0\" = Hex-STRING: 80 00 00 40 95 30 5E 31\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeStpDesignatedRoot.\"bridge2\" = Hex-STRING: 80 00 00 50 8B B8 C6 A9\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1658 msgid "" "To change the bridge interface being monitored via the `mib-2.dot1dBridge` " "subtree:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1663 #, no-wrap msgid "" "% snmpset -v 2c -c private bridge1.example.com\n" "BEGEMOT-BRIDGE-MIB::begemotBridgeDefaultBridgeIf.0 s bridge2\n" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1666 #, no-wrap msgid "Link Aggregation and Failover" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1671 msgid "" "FreeBSD provides the man:lagg[4] interface which can be used to aggregate " "multiple network interfaces into one virtual interface in order to provide " "failover and link aggregation. Failover allows traffic to continue to flow " "as long as at least one aggregated network interface has an established " "link. Link aggregation works best on switches which support LACP, as this " "protocol distributes traffic bi-directionally while responding to the " "failure of individual links." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1674 msgid "" "The aggregation protocols supported by the lagg interface determine which " "ports are used for outgoing traffic and whether or not a specific port " "accepts incoming traffic. The following protocols are supported by " "man:lagg[4]:" msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1675 #, no-wrap msgid "failover" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1680 msgid "" "This mode sends and receives traffic only through the master port. If the " "master port becomes unavailable, the next active port is used. The first " "interface added to the virtual interface is the master port and all " "subsequently added interfaces are used as failover devices. If failover to " "a non-master port occurs, the original port becomes master once it becomes " "available again." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1681 #, no-wrap msgid "loadbalance" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1684 msgid "" "This provides a static setup and does not negotiate aggregation with the " "peer or exchange frames to monitor the link. If the switch supports LACP, " "that should be used instead." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1685 #, no-wrap msgid "lacp" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1690 msgid "" "The IEEE(R) 802.3ad Link Aggregation Control Protocol (LACP) negotiates a " "set of aggregable links with the peer into one or more Link Aggregated " "Groups (LAGs). Each LAG is composed of ports of the same speed, set to full-" "duplex operation, and traffic is balanced across the ports in the LAG with " "the greatest total speed. Typically, there is only one LAG which contains " "all the ports. In the event of changes in physical connectivity, LACP will " "quickly converge to a new configuration." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1693 msgid "" "LACP balances outgoing traffic across the active ports based on hashed " "protocol header information and accepts incoming traffic from any active " "port. The hash includes the Ethernet source and destination address and, if " "available, the VLAN tag, and the IPv4 or IPv6 source and destination address." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1694 #, no-wrap msgid "roundrobin" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1697 msgid "" "This mode distributes outgoing traffic using a round-robin scheduler through " "all active ports and accepts incoming traffic from any active port. Since " "this mode violates Ethernet frame ordering, it should be used with caution." msgstr "" #. type: Labeled list #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1698 #, no-wrap msgid "broadcast" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1700 msgid "" "This mode sends outgoing traffic to all ports configured on the lagg " "interface, and receives frames on any port." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1701 #, no-wrap msgid "Configuration Examples" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1705 msgid "" "This section demonstrates how to configure a Cisco(R) switch and a FreeBSD " "system for LACP load balancing. It then shows how to configure two Ethernet " "interfaces in failover mode as well as how to configure failover mode " "between an Ethernet and a wireless interface." msgstr "" #. type: Block title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1707 #, no-wrap msgid "LACP Aggregation with a Cisco(R) Switch" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1713 msgid "" "This example connects two man:fxp[4] Ethernet interfaces on a FreeBSD " "machine to the first two Ethernet ports on a Cisco(R) switch as a single " "load balanced and fault tolerant link. More interfaces can be added to " "increase throughput and fault tolerance. Replace the names of the Cisco(R) " "ports, Ethernet devices, channel group number, and IP address shown in the " "example to match the local configuration." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1716 msgid "" "Frame ordering is mandatory on Ethernet links and any traffic between two " "stations always flows over the same physical link, limiting the maximum " "speed to that of one interface. The transmit algorithm attempts to use as " "much information as it can to distinguish different traffic flows and " "balance the flows across the available interfaces." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1718 msgid "" "On the Cisco(R) switch, add the _FastEthernet0/1_ and _FastEthernet0/2_ " "interfaces to channel group _1_:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1728 #, no-wrap msgid "" "interface FastEthernet0/1\n" " channel-group 1 mode active\n" " channel-protocol lacp\n" "!\n" "interface FastEthernet0/2\n" " channel-group 1 mode active\n" " channel-protocol lacp\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1731 msgid "" "On the FreeBSD system, create the man:lagg[4] interface using the physical " "interfaces _fxp0_ and _fxp1_ and bring the interfaces up with an IP address " "of _10.0.0.3/24_:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1738 #, no-wrap msgid "" "# ifconfig fxp0 up\n" "# ifconfig fxp1 up\n" "# ifconfig lagg0 create\n" "# ifconfig lagg0 up laggproto lacp laggport fxp0 laggport fxp1 10.0.0.3/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1741 msgid "Next, verify the status of the virtual interface:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1754 #, no-wrap msgid "" "# ifconfig lagg0\n" "lagg0: flags=8843 metric 0 mtu 1500\n" " options=8\n" " ether 00:05:5d:71:8d:b8\n" " inet 10.0.0.3 netmask 0xffffff00 broadcast 10.0.0.255\n" " media: Ethernet autoselect\n" " status: active\n" " laggproto lacp\n" " laggport: fxp1 flags=1c\n" " laggport: fxp0 flags=1c\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1759 msgid "" "Ports marked as `ACTIVE` are part of the LAG that has been negotiated with " "the remote switch. Traffic will be transmitted and received through these " "active ports. Add `-v` to the above command to view the LAG identifiers." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1761 msgid "To see the port status on the Cisco(R) switch:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1768 #, no-wrap msgid "" "switch# show lacp neighbor\n" "Flags: S - Device is requesting Slow LACPDUs\n" " F - Device is requesting Fast LACPDUs\n" " A - Device is in Active mode P - Device is in Passive mode\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1770 #, no-wrap msgid "Channel group 1 neighbors\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1772 #, no-wrap msgid "Partner's information:\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1777 #, no-wrap msgid "" " LACP port Oper Port Port\n" "Port Flags Priority Dev ID Age Key Number State\n" "Fa0/1 SA 32768 0005.5d71.8db8 29s 0x146 0x3 0x3D\n" "Fa0/2 SA 32768 0005.5d71.8db8 29s 0x146 0x4 0x3D\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1780 msgid "For more detail, type `show lacp neighbor detail`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1782 msgid "" "To retain this configuration across reboots, add the following entries to " "[.filename]#/etc/rc.conf# on the FreeBSD system:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1789 #, no-wrap msgid "" "ifconfig_fxp0=\"up\"\n" "ifconfig_fxp1=\"up\"\n" "cloned_interfaces=\"lagg0\"\n" "ifconfig_lagg0=\"laggproto lacp laggport fxp0 laggport fxp1 10.0.0.3/24\"\n" msgstr "" #. type: Block title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1794 #, no-wrap msgid "Failover Mode" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1801 msgid "" "Failover mode can be used to switch over to a secondary interface if the " "link is lost on the master interface. To configure failover, make sure that " "the underlying physical interfaces are up, then create the man:lagg[4] " "interface. In this example, _fxp0_ is the master interface, _fxp1_ is the " "secondary interface, and the virtual interface is assigned an IP address of " "_10.0.0.15/24_:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1808 #, no-wrap msgid "" "# ifconfig fxp0 up\n" "# ifconfig fxp1 up\n" "# ifconfig lagg0 create\n" "# ifconfig lagg0 up laggproto failover laggport fxp0 laggport fxp1 10.0.0.15/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1811 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1912 msgid "The virtual interface should look something like this:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1824 #, no-wrap msgid "" "# ifconfig lagg0\n" "lagg0: flags=8843 metric 0 mtu 1500\n" " options=8\n" " ether 00:05:5d:71:8d:b8\n" " inet 10.0.0.15 netmask 0xffffff00 broadcast 10.0.0.255\n" " media: Ethernet autoselect\n" " status: active\n" " laggproto failover\n" " laggport: fxp1 flags=0<>\n" " laggport: fxp0 flags=5\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1829 msgid "" "Traffic will be transmitted and received on _fxp0_. If the link is lost on " "_fxp0_, _fxp1_ will become the active link. If the link is restored on the " "master interface, it will once again become the active link." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1831 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1935 msgid "" "To retain this configuration across reboots, add the following entries to " "[.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1838 #, no-wrap msgid "" "ifconfig_fxp0=\"up\"\n" "ifconfig_fxp1=\"up\"\n" "cloned_interfaces=\"lagg0\"\n" "ifconfig_lagg0=\"laggproto failover laggport fxp0 laggport fxp1 10.0.0.15/24\"\n" msgstr "" #. type: Block title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1843 #, no-wrap msgid "Failover Mode Between Ethernet and Wireless Interfaces" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1849 msgid "" "For laptop users, it is usually desirable to configure the wireless device " "as a secondary which is only used when the Ethernet connection is not " "available. With man:lagg[4], it is possible to configure a failover which " "prefers the Ethernet connection for both performance and security reasons, " "while maintaining the ability to transfer data over the wireless connection." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1851 msgid "" "This is achieved by overriding the Ethernet interface's MAC address with " "that of the wireless interface." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1857 msgid "" "In theory, either the Ethernet or wireless MAC address can be changed to " "match the other. However, some popular wireless interfaces lack support for " "overriding the MAC address. We therefore recommend overriding the Ethernet " "MAC address for this purpose." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1864 msgid "" "If the driver for the wireless interface is not loaded in the `GENERIC` or " "custom kernel, and the computer is running FreeBSD {rel121-current}, load " "the corresponding [.filename]#.ko# in [.filename]#/boot/loader.conf# by " "adding `*driver_load=\"YES\"*` to that file and rebooting. Another, better " "way is to load the driver in [.filename]#/etc/rc.conf# by adding it to " "`kld_list` (see man:rc.conf[5] for details) in that file and rebooting. " "This is needed because otherwise the driver is not loaded yet at the time " "the man:lagg[4] interface is set up." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1870 msgid "" "In this example, the Ethernet interface, _re0_, is the master and the " "wireless interface, _wlan0_, is the failover. The _wlan0_ interface was " "created from the _ath0_ physical wireless interface, and the Ethernet " "interface will be configured with the MAC address of the wireless " "interface. First, bring the wireless interface up (replacing _FR_ with your " "own 2-letter country code), but do not set an IP address. Replace _wlan0_ " "to match the system's wireless interface name:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1874 #, no-wrap msgid "# ifconfig wlan0 create wlandev ath0 country FR ssid my_router up\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1877 msgid "Now you can determine the MAC address of the wireless interface:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1892 #, no-wrap msgid "" "# ifconfig wlan0\n" "wlan0: flags=8843 metric 0 mtu 1500\n" "\tether b8:ee:65:5b:32:59\n" "\tgroups: wlan\n" "\tssid Bbox-A3BD2403 channel 6 (2437 MHz 11g ht/20) bssid 00:37:b7:56:4b:60\n" "\tregdomain ETSI country FR indoor ecm authmode WPA2/802.11i privacy ON\n" "\tdeftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60\n" "\tprotmode CTS ampdulimit 64k ampdudensity 8 shortgi -stbctx stbcrx\n" "\t-ldpc wme burst roaming MANUAL\n" "\tmedia: IEEE 802.11 Wireless Ethernet MCS mode 11ng\n" "\tstatus: associated\n" "\tnd6 options=29\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1896 msgid "" "The `ether` line will contain the MAC address of the specified interface. " "Now, change the MAC address of the Ethernet interface to match:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1900 #, no-wrap msgid "# ifconfig re0 ether b8:ee:65:5b:32:59\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1903 msgid "" "Make sure the _re0_ interface is up, then create the man:lagg[4] interface " "with _re0_ as master with failover to _wlan0_:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1909 #, no-wrap msgid "" "# ifconfig re0 up\n" "# ifconfig lagg0 create\n" "# ifconfig lagg0 up laggproto failover laggport re0 laggport wlan0\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1925 #, no-wrap msgid "" "# ifconfig lagg0\n" "lagg0: flags=8843 metric 0 mtu 1500\n" " options=8\n" " ether b8:ee:65:5b:32:59\n" " laggproto failover lagghash l2,l3,l4\n" " laggport: re0 flags=5\n" " laggport: wlan0 flags=0<>\n" " groups: lagg\n" " media: Ethernet autoselect\n" " status: active\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1928 msgid "Then, start the DHCP client to obtain an IP address:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1932 #, no-wrap msgid "# dhclient lagg0\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1944 #, no-wrap msgid "" "ifconfig_re0=\"ether b8:ee:65:5b:32:59\"\n" "wlans_ath0=\"wlan0\"\n" "ifconfig_wlan0=\"WPA\"\n" "create_args_wlan0=\"country FR\"\n" "cloned_interfaces=\"lagg0\"\n" "ifconfig_lagg0=\"up laggproto failover laggport re0 laggport wlan0 DHCP\"\n" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1949 #, no-wrap msgid "Diskless Operation with PXE" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1955 msgid "" "The Intel(R) Preboot eXecution Environment (PXE) allows an operating system " "to boot over the network. For example, a FreeBSD system can boot over the " "network and operate without a local disk, using file systems mounted from an " "NFS server. PXE support is usually available in the BIOS. To use PXE when " "the machine starts, select the `Boot from network` option in the BIOS setup " "or type a function key during system initialization." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1957 msgid "" "In order to provide the files needed for an operating system to boot over " "the network, a PXE setup also requires properly configured DHCP, TFTP, and " "NFS servers, where:" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1959 msgid "" "Initial parameters, such as an IP address, executable boot filename and " "location, server name, and root path are obtained from the DHCP server." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1960 msgid "The operating system loader file is booted using TFTP." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1961 msgid "The file systems are loaded using NFS." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1966 msgid "" "When a computer PXE boots, it receives information over DHCP about where to " "obtain the initial boot loader file. After the host computer receives this " "information, it downloads the boot loader via TFTP and then executes the " "boot loader. In FreeBSD, the boot loader file is [.filename]#/boot/" "pxeboot#. After [.filename]#/boot/pxeboot# executes, the FreeBSD kernel is " "loaded and the rest of the FreeBSD bootup sequence proceeds, as described in " "crossref:boot[boot,The FreeBSD Booting Process]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1971 msgid "" "For UEFI PXE based boot, the actual boot loader file to use is [.filename]#/" "boot/loader.efi#. See the below section crossref:advanced-" "networking[_debugging_pxe_problems,Debugging PXE Problems] on how to use " "[.filename]#/boot/loader.efi#." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1975 msgid "" "This section describes how to configure these services on a FreeBSD system " "so that other systems can PXE boot into FreeBSD. Refer to man:diskless[8] " "for more information." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1980 msgid "" "As described, the system providing these services is insecure. It should " "live in a protected area of a network and be untrusted by other hosts." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1983 #, no-wrap msgid "Setting Up the PXE Environment" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1989 msgid "" "The steps shown in this section configure the built-in NFS and TFTP " "servers. The next section demonstrates how to install and configure the " "DHCP server. In this example, the directory which will contain the files " "used by PXE users is [.filename]#/b/tftpboot/FreeBSD/install#. It is " "important that this directory exists and that the same directory name is set " "in both [.filename]#/etc/inetd.conf# and [.filename]#/usr/local/etc/" "dhcpd.conf#." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1994 msgid "" "The command examples below assume use of the man:sh[1] shell. man:csh[1] " "and man:tcsh[1] users will need to start a man:sh[1] shell or adapt the " "commands to man:csh[1] syntax." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:1998 msgid "" "Create the root directory which will contain a FreeBSD installation to be " "NFS mounted:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2003 #, no-wrap msgid "" "# export NFSROOTDIR=/b/tftpboot/FreeBSD/install\n" "# mkdir -p ${NFSROOTDIR}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2006 msgid "Enable the NFS server by adding this line to [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2010 #, no-wrap msgid "nfs_server_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2013 msgid "" "Export the diskless root directory via NFS by adding the following to " "[.filename]#/etc/exports#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2017 #, no-wrap msgid "/b -ro -alldirs -maproot=root\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2020 msgid "Start the NFS server:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2024 #, no-wrap msgid "# service nfsd start\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2027 msgid "" "Enable man:inetd[8] by adding the following line to [.filename]#/etc/" "rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2031 #, no-wrap msgid "inetd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2034 msgid "" "Uncomment the following line in [.filename]#/etc/inetd.conf# by making sure " "it does not start with a `+#+` symbol:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2038 #, no-wrap msgid "tftp dgram udp wait root /usr/libexec/tftpd tftpd blocksize 1468 -l -s /b/tftpboot\n" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2045 msgid "" "The specified tftp blocksize, e.g. 1468 bytes, replaces the default size 512 " "bytes. Some PXE versions require the TCP version of TFTP. In this case, " "uncomment the second `tftp` line which contains `stream tcp`." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2048 msgid "Start man:inetd[8]:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2052 #, no-wrap msgid "# service inetd start\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2055 msgid "" "Install the base system into [.filename]#${NFSROOTDIR}#, either by " "decompressing the official archives or by rebuilding the FreeBSD kernel and " "userland (refer to crossref:cutting-edge[makeworld,“Updating FreeBSD from " "Source”] for more detailed instructions, but do not forget to add `DESTDIR=_$" "{NFSROOTDIR}_` when running the `make installkernel` and `make installworld` " "commands." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2056 msgid "" "Test that the TFTP server works and can download the boot loader which will " "be obtained via PXE:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2062 #, no-wrap msgid "" "# tftp localhost\n" "tftp> get FreeBSD/install/boot/pxeboot\n" "Received 264951 bytes in 0.1 seconds\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2065 msgid "" "Edit [.filename]#${NFSROOTDIR}/etc/fstab# and create an entry to mount the " "root file system over NFS:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2070 #, no-wrap msgid "" "# Device Mountpoint FSType Options Dump Pass\n" "myhost.example.com:/b/tftpboot/FreeBSD/install / nfs ro 0 0\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2074 msgid "" "Replace _myhost.example.com_ with the hostname or IP address of the NFS " "server. In this example, the root file system is mounted read-only in order " "to prevent NFS clients from potentially deleting the contents of the root " "file system." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2075 msgid "" "Set the root password in the PXE environment for client machines which are " "PXE booting :" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2080 #, no-wrap msgid "" "# chroot ${NFSROOTDIR}\n" "# passwd\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2083 msgid "" "If needed, enable man:ssh[1] root logins for client machines which are PXE " "booting by editing [.filename]#${NFSROOTDIR}/etc/ssh/sshd_config# and " "enabling `PermitRootLogin`. This option is documented in man:sshd_config[5]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2084 msgid "" "Perform any other needed customizations of the PXE environment in " "[.filename]#${NFSROOTDIR}#. These customizations could include things like " "installing packages or editing the password file with man:vipw[8]." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2087 msgid "" "When booting from an NFS root volume, [.filename]#/etc/rc# detects the NFS " "boot and runs [.filename]#/etc/rc.initdiskless#. In this case, [.filename]#/" "etc# and [.filename]#/var# need to be memory backed file systems so that " "these directories are writable but the NFS root directory is read-only:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2094 #, no-wrap msgid "" "# chroot ${NFSROOTDIR}\n" "# mkdir -p conf/base\n" "# tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc\n" "# tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2099 msgid "" "When the system boots, memory file systems for [.filename]#/etc# and " "[.filename]#/var# will be created and mounted and the contents of the " "[.filename]#cpio.gz# files will be copied into them. By default, these file " "systems have a maximum capacity of 5 megabytes. If your archives do not " "fit, which is usually the case for [.filename]#/var# when binary packages " "have been installed, request a larger size by putting the number of 512 byte " "sectors needed (e.g., 5 megabytes is 10240 sectors) in [.filename]#$" "{NFSROOTDIR}/conf/base/etc/md_size# and [.filename]#${NFSROOTDIR}/conf/base/" "var/md_size# files for [.filename]#/etc# and [.filename]#/var# file systems " "respectively." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2101 #, no-wrap msgid "Configuring the DHCP Server" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2104 msgid "" "The DHCP server does not need to be the same machine as the TFTP and NFS " "server, but it needs to be accessible in the network." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2106 msgid "" "DHCP is not part of the FreeBSD base system but can be installed using the " "package:net/isc-dhcp44-server[] port or package." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2109 msgid "" "Once installed, edit the configuration file, [.filename]#/usr/local/etc/" "dhcpd.conf#. Configure the `next-server`, `filename`, and `root-path` " "settings as seen in this example:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2119 #, no-wrap msgid "" "subnet 192.168.0.0 netmask 255.255.255.0 {\n" " range 192.168.0.2 192.168.0.3 ;\n" " option subnet-mask 255.255.255.0 ;\n" " option routers 192.168.0.1 ;\n" " option broadcast-address 192.168.0.255 ;\n" " option domain-name-servers 192.168.35.35, 192.168.35.36 ;\n" " option domain-name \"example.com\";\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2122 #, no-wrap msgid "" " # IP address of TFTP server\n" " next-server 192.168.0.1 ;\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2125 #, no-wrap msgid "" " # path of boot loader obtained via tftp\n" " filename \"FreeBSD/install/boot/pxeboot\" ;\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2128 #, no-wrap msgid "" " # pxeboot boot loader will try to NFS mount this directory for root FS\n" " option root-path \"192.168.0.1:/b/tftpboot/FreeBSD/install/\" ;\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2130 #, no-wrap msgid "}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2133 msgid "" "The `next-server` directive is used to specify the IP address of the TFTP " "server." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2136 msgid "" "The `filename` directive defines the path to [.filename]#/boot/pxeboot#. A " "relative filename is used, meaning that [.filename]#/b/tftpboot# is not " "included in the path." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2138 msgid "The `root-path` option defines the path to the NFS root file system." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2140 msgid "" "Once the edits are saved, enable DHCP at boot time by adding the following " "line to [.filename]#/etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2144 #, no-wrap msgid "dhcpd_enable=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2147 msgid "Then start the DHCP service:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2151 #, no-wrap msgid "# service isc-dhcpd start\n" msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2153 #, no-wrap msgid "Debugging PXE Problems" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2157 msgid "" "Once all of the services are configured and started, PXE clients should be " "able to automatically load FreeBSD over the network. If a particular client " "is unable to connect, when that client machine boots up, enter the BIOS " "configuration menu and confirm that it is set to boot from the network." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2159 msgid "" "This section describes some troubleshooting tips for isolating the source of " "the configuration problem should no clients be able to PXE boot." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2163 msgid "" "Use the package:net/wireshark[] package or port to debug the network traffic " "involved during the PXE booting process, which is illustrated in the diagram " "below." msgstr "" #. type: Block title #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2164 #, no-wrap msgid "PXE Booting Process with NFS Root Mount" msgstr "" #. type: Target for macro image #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2165 #, no-wrap msgid "pxe-nfs.png" msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2168 msgid "Client broadcasts a DHCPDISCOVER message." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2170 msgid "" "The DHCP server responds with the IP address, next-server, filename, and " "root-path values." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2172 msgid "" "The client sends a TFTP request to next-server, asking to retrieve filename." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2174 msgid "The TFTP server responds and sends filename to client." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2176 msgid "" "The client executes filename, which is pxeboot(8), which then loads the " "kernel. When the kernel executes, the root file system specified by root-" "path is mounted over NFS." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2178 msgid "" "On the TFTP server, read [.filename]#/var/log/xferlog# to ensure that " "[.filename]#pxeboot# is being retrieved from the correct location. To test " "this example configuration:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2184 #, no-wrap msgid "" "# tftp 192.168.0.1\n" "tftp> get FreeBSD/install/boot/pxeboot\n" "Received 264951 bytes in 0.1 seconds\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2187 msgid "" "The `BUGS` sections in man:tftpd[8] and man:tftp[1] document some " "limitations with TFTP." msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2188 msgid "" "Make sure that the root file system can be mounted via NFS. To test this " "example configuration:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2192 #, no-wrap msgid "# mount -t nfs 192.168.0.1:/b/tftpboot/FreeBSD/install /mnt\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2195 msgid "" "For UEFI PXE based booting, replace the [.filename]#boot/pxeboot# file with " "the [.filename]#boot/loader.efi# file:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2200 #, no-wrap msgid "" "# chroot ${NFSROOTDIR}\n" "# mv boot/pxeboot boot/pxeboot.original\n" "# cp boot/loader.efi boot/pxeboot\n" msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2204 #, no-wrap msgid "Common Address Redundancy Protocol (CARP)" msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2208 msgid "" "The Common Address Redundancy Protocol (CARP) allows multiple hosts to share " "the same IP address and Virtual Host ID (VHID) in order to provide _high " "availability_ for one or more services. This means that one or more hosts " "can fail, and the other hosts will transparently take over so that users do " "not see a service failure." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2212 msgid "" "In addition to the shared IP address, each host has its own IP address for " "management and configuration. All of the machines that share an IP address " "have the same VHID. The VHID for each virtual IP address must be unique " "across the broadcast domain of the network interface." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2215 msgid "" "High availability using CARP is built into FreeBSD, though the steps to " "configure it vary slightly depending upon the FreeBSD version. This section " "provides the same example configuration for versions before and equal to or " "after FreeBSD 10." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2218 msgid "" "This example configures failover support with three hosts, all with unique " "IP addresses, but providing the same web content. It has two different " "masters named `hosta.example.org` and `hostb.example.org`, with a shared " "backup named `hostc.example.org`." msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2225 msgid "" "These machines are load balanced with a Round Robin DNS configuration. The " "master and backup machines are configured identically except for their " "hostnames and management IP addresses. These servers must have the same " "configuration and run the same services. When the failover occurs, requests " "to the service on the shared IP address can only be answered correctly if " "the backup server has access to the same content. The backup machine has " "two additional CARP interfaces, one for each of the master content server's " "IP addresses. When a failure occurs, the backup server will pick up the " "failed master machine's IP address." msgstr "" #. type: Title === #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2227 #, no-wrap msgid "Using CARP" msgstr "" #. type: delimited block * 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2230 msgid "" "Enable boot-time support for CARP by adding an entry for the " "[.filename]#carp.ko# kernel module in [.filename]#/boot/loader.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2234 #, no-wrap msgid "carp_load=\"YES\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2237 msgid "To load the module now without rebooting:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2241 #, no-wrap msgid "# kldload carp\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2244 msgid "" "For users who prefer to use a custom kernel, include the following line in " "the custom kernel configuration file and compile the kernel as described in " "crossref:kernelconfig[kernelconfig,Configuring the FreeBSD Kernel]:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2248 #, no-wrap msgid "device\tcarp\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2251 msgid "" "The hostname, management IP address and subnet mask, shared IP address, and " "VHID are all set by adding entries to [.filename]#/etc/rc.conf#. This " "example is for `hosta.example.org`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2257 #, no-wrap msgid "" "hostname=\"hosta.example.org\"\n" "ifconfig_em0=\"inet 192.168.1.3 netmask 255.255.255.0\"\n" "ifconfig_em0_alias0=\"inet vhid 1 pass testpass alias 192.168.1.50/32\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2262 msgid "" "The next set of entries are for `hostb.example.org`. Since it represents a " "second master, it uses a different shared IP address and VHID. However, the " "passwords specified with `pass` must be identical as CARP will only listen " "to and accept advertisements from machines with the correct password." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2268 #, no-wrap msgid "" "hostname=\"hostb.example.org\"\n" "ifconfig_em0=\"inet 192.168.1.4 netmask 255.255.255.0\"\n" "ifconfig_em0_alias0=\"inet vhid 2 pass testpass alias 192.168.1.51/32\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2273 msgid "" "The third machine, `hostc.example.org`, is configured to handle failover " "from either master. This machine is configured with two CARPVHIDs, one to " "handle the virtual IP address for each of the master hosts. The CARP " "advertising skew, `advskew`, is set to ensure that the backup host " "advertises later than the master, since `advskew` controls the order of " "precedence when there are multiple backup servers." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2280 #, no-wrap msgid "" "hostname=\"hostc.example.org\"\n" "ifconfig_em0=\"inet 192.168.1.5 netmask 255.255.255.0\"\n" "ifconfig_em0_alias0=\"inet vhid 1 advskew 100 pass testpass alias 192.168.1.50/32\"\n" "ifconfig_em0_alias1=\"inet vhid 2 advskew 100 pass testpass alias 192.168.1.51/32\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2284 msgid "" "Having two CARPVHIDs configured means that `hostc.example.org` will notice " "if either of the master servers becomes unavailable. If a master fails to " "advertise before the backup server, the backup server will pick up the " "shared IP address until the master becomes available again." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2291 msgid "" "If the original master server becomes available again, `hostc.example.org` " "will not release the virtual IP address back to it automatically. For this " "to happen, preemption has to be enabled. The feature is disabled by " "default, it is controlled via the man:sysctl[8] variable " "`net.inet.carp.preempt`. The administrator can force the backup server to " "return the IP address to the master:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2295 #, no-wrap msgid "# ifconfig em0 vhid 1 state backup\n" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2301 msgid "" "Once the configuration is complete, either restart networking or reboot each " "system. High availability is now enabled." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2304 msgid "" "CARP functionality can be controlled via several man:sysctl[8] variables " "documented in the man:carp[4] manual pages. Other actions can be triggered " "from CARP events by using man:devd[8]." msgstr "" #. type: Title == #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2306 #, no-wrap msgid "VLANs" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2310 msgid "" "VLANs are a way of virtually dividing up a network into many different " "subnetworks, also referred to as segmenting. Each segment will have its own " "broadcast domain and be isolated from other VLANs." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2313 msgid "" "On FreeBSD, VLANs must be supported by the network card driver. To see " "which drivers support vlans, refer to the man:vlan[4] manual page." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2316 msgid "" "When configuring a VLAN, a couple pieces of information must be known. " "First, which network interface? Second, what is the VLAN tag?" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2318 msgid "" "To configure VLANs at run time, with a NIC of `em0` and a VLAN tag of `5` " "the command would look like this:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2322 #, no-wrap msgid "# ifconfig em0.5 create vlan 5 vlandev em0 inet 192.168.20.20/24\n" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2327 msgid "" "See how the interface name includes the NIC driver name and the VLAN tag, " "separated by a period? This is a best practice to make maintaining the VLAN " "configuration easy when many VLANs are present on a machine." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2333 msgid "" "When defining VLANs, ensure that the parent network interface is also " "configured and enabled. The minimum configuration for the above example " "would be:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2337 #, no-wrap msgid "# ifconfig em0 up\n" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2342 msgid "" "To configure VLANs at boot time, [.filename]#/etc/rc.conf# must be updated. " "To duplicate the configuration above, the following will need to be added:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2347 #, no-wrap msgid "" "vlans_em0=\"5\"\n" "ifconfig_em0_5=\"inet 192.168.20.20/24\"\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2350 msgid "" "Additional VLANs may be added, by simply adding the tag to the `vlans_em0` " "field and adding an additional line configuring the network on that VLAN " "tag's interface." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2355 msgid "" "When defining VLANs in [.filename]#/etc/rc.conf#, make sure that the parent " "network interface is configured and enabled as well. The minimum " "configuration for the above example would be:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2359 #, no-wrap msgid "ifconfig_em0=\"up\"\n" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2365 msgid "" "It is useful to assign a symbolic name to an interface so that when the " "associated hardware is changed, only a few configuration variables need to " "be updated. For example, security cameras need to be run over VLAN 1 on " "`em0`. Later, if the `em0` card is replaced with a card that uses the " "man:ixgb[4] driver, all references to `em0.1` will not have to change to " "`ixgb0.1`." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2367 msgid "" "To configure VLAN `5`, on the NIC `em0`, assign the interface name " "`cameras`, and assign the interface an IP address of `_192.168.20.20_` with " "a `24`-bit prefix, use this command:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2371 #, no-wrap msgid "# ifconfig em0.5 create vlan 5 vlandev em0 name cameras inet 192.168.20.20/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2374 msgid "For an interface named `video`, use the following:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2378 #, no-wrap msgid "# ifconfig video.5 create vlan 5 vlandev video name cameras inet 192.168.20.20/24\n" msgstr "" #. type: Plain text #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2381 msgid "" "To apply the changes at boot time, add the following lines to [.filename]#/" "etc/rc.conf#:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/handbook/advanced-networking/_index.adoc:2387 #, no-wrap msgid "" "vlans_video=\"cameras\"\n" "create_args_cameras=\"vlan 5\"\n" "ifconfig_cameras=\"inet 192.168.20.20/24\"\n" msgstr ""