xref: /freebsd/sbin/ifconfig/ifconfig.8 (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
29.\" $FreeBSD$
30.\"
31.Dd May 22, 2023
32.Dt IFCONFIG 8
33.Os
34.Sh NAME
35.Nm ifconfig
36.Nd configure network interface parameters
37.Sh SYNOPSIS
38.Nm
39.Op Fl j Ar jail
40.Op Fl kLmn
41.Op Fl f Ar type Ns Cm \&: Ns Ar format
42.Ar interface
43.Op Cm create
44.Oo
45.Ar address_family
46.Oo
47.Ar address
48.Op Ar dest_address
49.Oc
50.Oc
51.Op Ar parameters
52.Nm
53.Op Fl j Ar jail
54.Ar interface
55.Cm destroy
56.Nm
57.Op Fl j Ar jail
58.Fl a
59.Op Fl dkLmuv
60.Op Fl f Ar type Ns Cm \&: Ns Ar format
61.Op Fl G Ar groupname
62.Op Fl g Ar groupname
63.Op Ar address_family
64.Nm
65.Fl C
66.Nm
67.Op Fl j Ar jail
68.Fl g Ar groupname
69.Nm
70.Op Fl j Ar jail
71.Fl l
72.Op Fl du
73.Op Fl g Ar groupname
74.Op Ar address_family
75.Nm
76.Op Fl j Ar jail
77.Op Fl dkLmuv
78.Op Fl f Ar type Ns Cm \&: Ns Ar format
79.Sh DESCRIPTION
80The
81.Nm
82utility is used to assign an address
83to a network interface and/or configure
84network interface parameters.
85The
86.Nm
87utility must be used at boot time to define the network address
88of each interface present on a machine; it may also be used at
89a later time to redefine an interface's address
90or other operating parameters.
91.Pp
92The following options are available:
93.Bl -tag -width indent
94.It Fl a
95Display information about all interfaces in the system.
96.Pp
97The
98.Fl a
99flag may be used instead of the
100.Ar interface
101argument.
102.It Fl C
103List all the interface cloners available on the system,
104with no additional information.
105Use of this flag is mutually exclusive with all other flags and commands.
106.It Fl d
107Display only the interfaces that are down.
108.It Fl f Xo
109.Ar type Ns Cm \&: Ns Ar format Ns
110.Op Cm \&, Ns Ar type Ns Cm \&: Ns Ar format Ar ...
111.Xc
112Control the output format of
113.Nm .
114The format is specified as a comma-separated list of
115.Ar type Ns Cm \&: Ns Ar format
116pairs
117.Po see the
118.Sx EXAMPLES
119section for more information
120.Pc .
121.Pp
122The output format can also be specified via the
123.Ev IFCONFIG_FORMAT
124environment variable.
125The
126.Fl f
127flag can be supplied multiple times.
128.Pp
129The
130.Ar type Ns s
131and their associated
132.Ar format
133strings are:
134.Pp
135.Bl -tag -width ether
136.It Cm addr
137Adjust the display of inet and inet6 addresses:
138.Pp
139.Bl -tag -width default -compact
140.It Cm default
141Default format,
142.Cm numeric
143.It Cm fqdn
144Fully qualified domain names
145.Pq FQDN
146.It Cm host
147Unqualified hostnames
148.It Cm numeric
149Numeric format
150.El
151.It Cm ether
152Adjust the display of link-level ethernet (MAC) addresses:
153.Pp
154.Bl -tag -width default -compact
155.It Cm colon
156Separate address segments with a colon
157.It Cm dash
158Separate address segments with a dash
159.It Cm default
160Default format,
161.Cm colon
162.El
163.It Cm inet
164Adjust the display of inet address subnet masks:
165.Pp
166.Bl -tag -width default -compact
167.It Cm cidr
168CIDR notation, for example:
169.Ql 203.0.113.224/26
170.It Cm default
171Default format,
172.Cm hex
173.It Cm dotted
174Dotted quad notation, for example:
175.Ql 255.255.255.192
176.It Cm hex
177Hexadecimal format, for example:
178.Ql 0xffffffc0
179.El
180.It Cm inet6
181Adjust the display of inet6 address prefixes (subnet masks):
182.Pp
183.Bl -tag -width default -compact
184.It Cm cidr
185CIDR notation, for example:
186.Ql ::1/128
187or
188.Ql fe80::1%lo0/64
189.It Cm default
190Default format,
191.Cm numeric
192.It Cm numeric
193Integer format, for example:
194.Ql prefixlen 64
195.El
196.El
197.It Fl G Ar groupname
198Exclude members of the specified
199.Ar groupname
200from the output.
201.Ar groupname .
202.Pp
203Only one option
204.Fl G
205should be specified as later override previous ones
206.Ar groupname
207may contain shell patterns in which case it should be quoted.
208.Pp
209Setting
210.Ar groupname
211to
212.Cm all
213selects all interfaces.
214.It Fl g Ar groupname
215Limit the output to the members of the specified
216.Ar groupname .
217.Pp
218If
219.Fl g
220is specified before other significant flags like, e.g.,
221.Fl a ,
222.Fl l ,
223or
224.Fl C ,
225then
226.Nm
227lists names of interfaces belonging to
228.Ar groupname .
229Any other flags and arguments are ignored in this case.
230.Pp
231Only one option
232.Fl g
233should be specified as later override previous ones
234.Ar groupname
235may contain shell patterns in which case it should be quoted.
236.Pp
237Setting
238.Ar groupname
239to
240.Cm all
241selects all interfaces.
242.It Fl j Ar jail
243Perform the actions inside the
244.Ar jail .
245.Pp
246The
247.Cm ifconfig
248will first attach to the
249.Ar jail
250(by jail id or jail name) before performing the effects.
251.Pp
252This allow network interfaces of
253.Ar jail
254to be configured even if the
255.Cm ifconfig
256binary is not available in
257.Ar jail .
258.It Fl k
259Print keying information for the
260.Ar interface ,
261if available.
262.Pp
263For example, the values of 802.11 WEP keys and
264.Xr carp 4
265passphrases will be printed, if accessible to the current user.
266.Pp
267This information is not printed by default, as it may be considered
268sensitive.
269.It Fl L
270Display address lifetime for IPv6 addresses as time offset string.
271.It Fl l
272List all available interfaces on the system,
273with no other additional information.
274.Pp
275If an
276.Ar address_family
277is specified, only interfaces of that type will be listed.
278.Pp
279If the
280.Ar address_family
281is set to
282.Cm ether ,
283then
284.Fl l
285will exclude loopback interfaces from the list of Ethernet interfaces.
286This is a special case, because all the other synonyms of the
287.Cm link
288address family will include loopback interfaces in the list.
289.Pp
290Use of this flag is mutually exclusive
291with all other flags and commands, except for
292.Fl d ,
293.Fl g ,
294and
295.Fl u .
296.It Fl m
297Display the capability list and all
298of the supported media for the specified interface.
299.It Fl n
300Disable automatic loading of network interface drivers.
301.Pp
302By default if the network interface driver is not present in the kernel
303then
304.Nm
305will attempt to load it.
306.It Fl u
307Display only the interfaces that are up.
308.It Fl v
309Get more verbose status for an interface.
310.It Ar address
311For the inet family,
312the address is either a host name present in the host name data
313base,
314.Xr hosts 5 ,
315or an IPv4 address expressed in the Internet standard
316.Dq dot notation .
317.Pp
318It is also possible to use the CIDR notation (also known as the
319slash notation) to include the netmask.
320That is, one can specify an address like
321.Li 192.168.0.1/16 .
322.Pp
323For the
324.Cm inet6
325family, it is also possible to specify the prefix length using the slash
326notation, like
327.Li ::1/128 .
328See the
329.Cm prefixlen
330parameter below for more information.
331.Pp
332The link-level
333.Pq Cm link
334address
335is specified as a series of colon-separated hex digits.
336This can be used to, for example,
337set a new MAC address on an Ethernet interface, though the
338mechanism used is not Ethernet specific.
339.Pp
340Use the
341.Cm random
342keyword to set a randomly generated MAC address.
343A randomly-generated MAC address might be the same as one already in use
344in the network.
345Such duplications are extremely unlikely.
346.Pp
347If the interface is already
348up when the link-level address is modified,
349it will be briefly brought down and
350then brought back up again in order to ensure that the receive
351filter in the underlying Ethernet hardware is properly reprogrammed.
352.It Ar address_family
353Specify the
354address family
355which affects interpretation of the remaining parameters.
356Since an interface can receive transmissions in differing protocols
357with different naming schemes, specifying the address family is recommended.
358The address or protocol families currently
359supported are:
360.Bl -tag
361.It Cm ether
362Synonymous with
363.Cm link
364.Po with some exceptions, see
365.Fl l
366.Pc .
367.It Cm inet
368Default, if available.
369.It Cm inet6
370.It Cm link
371Default, if
372.Cm inet
373is not available.
374.It Cm lladdr
375Synonymous with
376.Cm link .
377.El
378.It Ar dest_address
379Specify the address of the correspondent on the other end
380of a point to point link.
381.It Ar interface
382This
383parameter is a string of the form
384.Dq name unit ,
385for example,
386.Dq Li em0 .
387.El
388.Pp
389The
390.Nm
391utility displays the current configuration for a network interface
392when no optional parameters are supplied.
393If a protocol family is specified,
394.Nm
395will report only the details specific to that protocol family.
396.Pp
397When no arguments are given,
398.Fl a
399is implied.
400.Pp
401Only the super-user may modify the configuration of a network interface.
402.Sh PARAMETERS
403The following
404.Ar parameter Ns s
405may be set with
406.Nm :
407.Bl -tag -width indent
408.It Cm add
409Another name for the
410.Cm alias
411parameter.
412Introduced for compatibility
413with
414.Bsx .
415.It Cm alias
416Establish an additional network address for this interface.
417This is sometimes useful when changing network numbers, and
418one wishes to accept packets addressed to the old interface.
419If the address is on the same subnet as the first network address
420for this interface, a non-conflicting netmask must be given.
421Usually
422.Li 0xffffffff
423is most appropriate.
424.It Fl alias
425Remove the network address specified.
426This would be used if you incorrectly specified an alias, or it
427was no longer needed.
428If you have incorrectly set an NS address having the side effect
429of specifying the host portion, removing all NS addresses will
430allow you to respecify the host portion.
431.It Cm anycast
432(Inet6 only.)
433Specify that the address configured is an anycast address.
434Based on the current specification,
435only routers may configure anycast addresses.
436Anycast address will not be used as source address of any of outgoing
437IPv6 packets.
438.It Cm arp
439Enable the use of the Address Resolution Protocol
440.Pq Xr arp 4
441in mapping
442between network level addresses and link level addresses (default).
443This is currently implemented for mapping between Internet Protocol addresses
444and IEEE 802 48-bit MAC addresses (Ethernet addresses).
445.It Fl arp
446Disable the use of the Address Resolution Protocol
447.Pq Xr arp 4 .
448.It Cm staticarp
449If the Address Resolution Protocol is enabled,
450the host will only reply to requests for its addresses,
451and will never send any requests.
452.It Fl staticarp
453If the Address Resolution Protocol is enabled,
454the host will perform normally,
455sending out requests and listening for replies.
456.It Cm stickyarp
457Enable the so-called sticky ARP mode for the interface.
458If this option is enabled on the given interface, any resolved address is
459marked as a static one and never expires. This may be used to increase
460security of the network by preventing ARP spoofing or to reduce latency for
461high-performance Ethernet networks where the time needed for ARP resolution is
462too high. Please note that a similar feature is also provided for bridges. See
463the sticky option in the
464.Sx Bridge Interface Parameters
465section. Enabling this
466option may impact techniques which rely on ARP expiration/overwriting feature
467such as load-balancers or high-availabity solutions such as
468.Xr carp 4 .
469.It Fl stickyarp
470Disable the so-called sticky ARP mode for the interface (default).
471Resolved addresses will expire normally respecting the kernel ARP
472configuration.
473.It Cm broadcast
474(Inet only.)
475Specify the address to use to represent broadcasts to the
476network.
477The default broadcast address is the address with a host part of all 1's.
478.It Cm debug
479Enable driver dependent debugging code; usually, this turns on
480extra console error logging.
481.It Fl debug
482Disable driver dependent debugging code.
483.It Cm promisc
484Put interface into permanently promiscuous mode.
485.It Fl promisc
486Disable permanently promiscuous mode.
487.It Cm delete
488Another name for the
489.Fl alias
490parameter.
491.It Cm description Ar value , Cm descr Ar value
492Specify a description of the interface.
493This can be used to label interfaces in situations where they may
494otherwise be difficult to distinguish.
495.It Cm -description , Cm -descr
496Clear the interface description.
497.It Cm down
498Mark an interface
499.Dq down .
500When an interface is marked
501.Dq down ,
502the system will not attempt to
503transmit messages through that interface.
504If possible, the interface will be reset to disable reception as well.
505This action does not automatically disable routes using the interface.
506.It Cm group Ar groupname
507Assign the interface to a
508.Dq group .
509Any interface can be in multiple groups.
510.Pp
511Cloned interfaces are members of their interface family group by default.
512For example, a VLAN interface such as
513.Em vlan10
514is a member of the VLAN interface family group,
515.Em vlan .
516.It Cm -group Ar groupname
517Remove the interface from the given
518.Dq group .
519.It Cm eui64
520(Inet6 only.)
521Fill interface index
522(lowermost 64bit of an IPv6 address)
523automatically.
524.It Cm fib Ar fib_number
525Specify interface FIB.
526A FIB
527.Ar fib_number
528is assigned to all frames or packets received on that interface.
529The FIB is not inherited, e.g., vlans or other sub-interfaces will use
530the default FIB (0) irrespective of the parent interface's FIB.
531The kernel needs to be tuned to support more than the default FIB
532using the
533.Va ROUTETABLES
534kernel configuration option, or the
535.Va net.fibs
536tunable.
537.It Cm tunnelfib Ar fib_number
538Specify tunnel FIB.
539A FIB
540.Ar fib_number
541is assigned to all packets encapsulated by tunnel interface, e.g.,
542.Xr gif 4 ,
543.Xr gre 4
544and
545.Xr vxlan 4 .
546.It Cm maclabel Ar label
547If Mandatory Access Control support is enabled in the kernel,
548set the MAC label to
549.Ar label .
550.\" (see
551.\" .Xr maclabel 7 ) .
552.It Cm media Ar type
553If the driver supports the media selection system, set the media type
554of the interface to
555.Ar type .
556Some interfaces support the mutually exclusive use of one of several
557different physical media connectors.
558For example, a 10Mbit/s Ethernet
559interface might support the use of either AUI
560or twisted pair connectors.
561Setting the media type to
562.Cm 10base5/AUI
563would change the currently active connector to the AUI port.
564Setting it to
565.Cm 10baseT/UTP
566would activate twisted pair.
567Refer to the interfaces' driver
568specific documentation or man page for a complete list of the
569available types.
570.It Cm mediaopt Ar opts
571If the driver supports the media selection system, set the specified
572media options on the interface.
573The
574.Ar opts
575argument
576is a comma delimited list of options to apply to the interface.
577Refer to the interfaces' driver specific man page for a complete
578list of available options.
579.It Fl mediaopt Ar opts
580If the driver supports the media selection system, disable the
581specified media options on the interface.
582.It Cm mode Ar mode
583If the driver supports the media selection system, set the specified
584operating mode on the interface to
585.Ar mode .
586For IEEE 802.11 wireless interfaces that support multiple operating modes
587this directive is used to select between 802.11a
588.Pq Cm 11a ,
589802.11b
590.Pq Cm 11b ,
591and 802.11g
592.Pq Cm 11g
593operating modes.
594.It Cm txrtlmt
595Set if the driver supports TX rate limiting.
596.It Cm inst Ar minst , Cm instance Ar minst
597Set the media instance to
598.Ar minst .
599This is useful for devices which have multiple physical layer interfaces
600.Pq PHYs .
601.It Cm name Ar name
602Set the interface name to
603.Ar name .
604.It Cm rxcsum , txcsum , rxcsum6 , txcsum6
605If the driver supports user-configurable checksum offloading,
606enable receive (or transmit) checksum offloading on the interface.
607The feature can be turned on selectively per protocol family.
608Use
609.Cm rxcsum6 , txcsum6
610for
611.Xr ip6 4
612or
613.Cm rxcsum , txcsum
614otherwise.
615Some drivers may not be able to enable these flags independently
616of each other, so setting one may also set the other.
617The driver will offload as much checksum work as it can reliably
618support, the exact level of offloading varies between drivers.
619.It Fl rxcsum , txcsum , rxcsum6 , txcsum6
620If the driver supports user-configurable checksum offloading,
621disable receive (or transmit) checksum offloading on the interface.
622The feature can be turned off selectively per protocol family.
623Use
624.Fl rxcsum6 , txcsum6
625for
626.Xr ip6 4
627or
628.Fl rxcsum , txcsum
629otherwise.
630These settings may not always be independent of each other.
631.It Cm tso
632If the driver supports
633.Xr tcp 4
634segmentation offloading, enable TSO on the interface.
635Some drivers may not be able to support TSO for
636.Xr ip 4
637and
638.Xr ip6 4
639packets, so they may enable only one of them.
640.It Fl tso
641If the driver supports
642.Xr tcp 4
643segmentation offloading, disable TSO on the interface.
644It will always disable TSO for
645.Xr ip 4
646and
647.Xr ip6 4 .
648.It Cm tso6 , tso4
649If the driver supports
650.Xr tcp 4
651segmentation offloading for
652.Xr ip6 4
653or
654.Xr ip 4
655use one of these to selectively enabled it only for one protocol family.
656.It Fl tso6 , tso4
657If the driver supports
658.Xr tcp 4
659segmentation offloading for
660.Xr ip6 4
661or
662.Xr ip 4
663use one of these to selectively disable it only for one protocol family.
664.It Cm lro
665If the driver supports
666.Xr tcp 4
667large receive offloading, enable LRO on the interface.
668.It Fl lro
669If the driver supports
670.Xr tcp 4
671large receive offloading, disable LRO on the interface.
672.It Cm txtls
673Transmit TLS offload encrypts Transport Layer Security (TLS) records and
674segments the encrypted record into one or more
675.Xr tcp 4
676segments over either
677.Xr ip 4
678or
679.Xr ip6 4 .
680If the driver supports transmit TLS offload,
681enable transmit TLS offload on the interface.
682Some drivers may not be able to support transmit TLS offload for
683.Xr ip 4
684and
685.Xr ip6 4
686packets, so they may enable only one of them.
687.It Fl txtls
688If the driver supports transmit TLS offload,
689disable transmit TLS offload on the interface.
690It will always disable TLS for
691.Xr ip 4
692and
693.Xr ip6 4 .
694.It Cm txtlsrtlmt
695Enable use of rate limiting (packet pacing) for TLS offload.
696.It Fl txtlsrtlmt
697Disable use of rate limiting for TLS offload.
698.It Cm mextpg
699If the driver supports extended multi-page
700.Xr mbuf 9
701buffers, enable them on the interface.
702.It Fl mextpg
703If the driver supports extended multi-page
704.Xr mbuf 9
705biffers, disable them on the interface.
706.It Cm wol , wol_ucast , wol_mcast , wol_magic
707Enable Wake On Lan (WOL) support, if available.
708WOL is a facility whereby a machine in a low power state may be woken
709in response to a received packet.
710There are three types of packets that may wake a system:
711ucast (directed solely to the machine's mac address),
712mcast (directed to a broadcast or multicast address),
713or
714magic
715.Po unicast or multicast frames with a
716.Dq magic contents
717.Pc .
718Not all devices support WOL, those that do indicate the mechanisms
719they support in their capabilities.
720.Cm wol
721is a synonym for enabling all available WOL mechanisms.
722To disable WOL use
723.Fl wol .
724.It Cm vlanmtu , vlanhwtag , vlanhwfilter , vlanhwcsum , vlanhwtso
725If the driver offers user-configurable VLAN support, enable
726reception of extended frames, tag processing in hardware,
727frame filtering in hardware, checksum offloading, or TSO on VLAN,
728respectively.
729Note that this must be configured on a physical interface associated with
730.Xr vlan 4 ,
731not on a
732.Xr vlan 4
733interface itself.
734.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwcsum , vlanhwtso
735If the driver offers user-configurable VLAN support, disable
736reception of extended frames, tag processing in hardware,
737frame filtering in hardware, checksum offloading, or TSO on VLAN,
738respectively.
739.It Cm vxlanhwcsum , vxlanhwtso
740If the driver offers user-configurable VXLAN support, enable inner checksum
741offloading (receive and transmit) or TSO on VXLAN, respectively.
742Note that this must be configured on a physical interface associated with
743.Xr vxlan 4 ,
744not on a
745.Xr vxlan 4
746interface itself.
747The physical interface is either the interface specified as the vxlandev
748or the interface hosting the vxlanlocal address.
749The driver will offload as much checksum work and TSO as it can reliably
750support, the exact level of offloading may vary between drivers.
751.It Fl vxlanhwcsum , vxlanhwtso
752If the driver offers user-configurable VXLAN support, disable checksum
753offloading (receive and transmit) or TSO on VXLAN, respectively.
754.It Cm vnet Ar jail
755Move the interface to the
756.Xr jail 8 ,
757specified by name or JID.
758If the jail has a virtual network stack, the interface will disappear
759from the current environment and become visible to the jail.
760.It Fl vnet Ar jail
761Reclaim the interface from the
762.Xr jail 8 ,
763specified by name or JID.
764If the jail has a virtual network stack, the interface will disappear
765from the jail, and become visible to the current network environment.
766.It Cm polling
767Turn on
768.Xr polling 4
769feature and disable interrupts on the interface, if driver supports
770this mode.
771.It Fl polling
772Turn off
773.Xr polling 4
774feature and enable interrupt mode on the interface.
775.It Cm create
776Create the specified network pseudo-device.
777If the interface is given without a unit number, try to create a new
778device with an arbitrary unit number.
779If creation of an arbitrary device is successful, the new device name is
780printed to standard output unless the interface is renamed or destroyed
781in the same
782.Nm
783invocation.
784.It Cm destroy
785Destroy the specified network pseudo-device.
786.It Cm plumb
787Another name for the
788.Cm create
789parameter.
790Included for Solaris compatibility.
791.It Cm unplumb
792Another name for the
793.Cm destroy
794parameter.
795Included for Solaris compatibility.
796.It Cm metric Ar n
797Set the routing metric of the interface to
798.Ar n ,
799default 0.
800The routing metric is used by the routing protocol
801.Pq Xr routed 8 .
802Higher metrics have the effect of making a route
803less favorable; metrics are counted as additional hops
804to the destination network or host.
805.It Cm mtu Ar n
806Set the maximum transmission unit of the interface to
807.Ar n ,
808default is interface specific.
809The MTU is used to limit the size of packets that are transmitted on an
810interface.
811Not all interfaces support setting the MTU, and some interfaces have
812range restrictions.
813.It Cm netmask Ar mask
814.\" (Inet and ISO.)
815(Inet only.)
816Specify how much of the address to reserve for subdividing
817networks into sub-networks.
818The mask includes the network part of the local address
819and the subnet part, which is taken from the host field of the address.
820The mask can be specified as a single hexadecimal number
821with a leading
822.Ql 0x ,
823with a dot-notation Internet address,
824or with a pseudo-network name listed in the network table
825.Xr networks 5 .
826The mask contains 1's for the bit positions in the 32-bit address
827which are to be used for the network and subnet parts,
828and 0's for the host part.
829The mask should contain at least the standard network portion,
830and the subnet field should be contiguous with the network
831portion.
832.Pp
833The netmask can also be specified in CIDR notation after the address.
834See the
835.Ar address
836option above for more information.
837.It Cm prefixlen Ar len
838(Inet6 only.)
839Specify that
840.Ar len
841bits are reserved for subdividing networks into sub-networks.
842The
843.Ar len
844must be integer, and for syntactical reason it must be between 0 to 128.
845It is almost always 64 under the current IPv6 assignment rule.
846If the parameter is omitted, 64 is used.
847.Pp
848The prefix can also be specified using the slash notation after the address.
849See the
850.Ar address
851option above for more information.
852.It Cm remove
853Another name for the
854.Fl alias
855parameter.
856Introduced for compatibility
857with
858.Bsx .
859.Sm off
860.It Cm link Op Cm 0 No - Cm 2
861.Sm on
862Enable special processing of the link level of the interface.
863These three options are interface specific in actual effect, however,
864they are in general used to select special modes of operation.
865An example
866of this is to enable SLIP compression, or to select the connector type
867for some Ethernet cards.
868Refer to the man page for the specific driver
869for more information.
870.Sm off
871.It Fl link Op Cm 0 No - Cm 2
872.Sm on
873Disable special processing at the link level with the specified interface.
874.It Cm monitor
875Put the interface in monitor mode.
876No packets are transmitted, and received packets are discarded after
877.Xr bpf 4
878processing.
879.It Fl monitor
880Take the interface out of monitor mode.
881.It Cm pcp Ar priority_code_point
882Priority code point
883.Pq Dv PCP
884is an 3-bit field which refers to the IEEE 802.1p
885class of service and maps to the frame priority level.
886.It Fl pcp
887Stop tagging packets on the interface w/ the priority code point.
888.It Cm up
889Mark an interface
890.Dq up .
891This may be used to enable an interface after an
892.Dq Nm Cm down .
893It happens automatically when setting the first address on an interface.
894If the interface was reset when previously marked down,
895the hardware will be re-initialized.
896.El
897.Ss ICMPv6 Neighbor Discovery Protocol Parameters
898The following parameters are for ICMPv6 Neighbor Discovery Protocol.
899Note that the address family keyword
900.Dq Li inet6
901is needed for them:
902.Bl -tag -width indent
903.It Cm accept_rtadv
904Set a flag to enable accepting ICMPv6 Router Advertisement messages.
905The
906.Xr sysctl 8
907variable
908.Va net.inet6.ip6.accept_rtadv
909controls whether this flag is set by default or not.
910.It Cm -accept_rtadv
911Clear a flag
912.Cm accept_rtadv .
913.It Cm no_radr
914Set a flag to control whether routers from which the system accepts
915Router Advertisement messages will be added to the Default Router List
916or not.
917When the
918.Cm accept_rtadv
919flag is disabled, this flag has no effect.
920The
921.Xr sysctl 8
922variable
923.Va net.inet6.ip6.no_radr
924controls whether this flag is set by default or not.
925.It Cm -no_radr
926Clear a flag
927.Cm no_radr .
928.It Cm auto_linklocal
929Set a flag to perform automatic link-local address configuration when
930the interface becomes available.
931The
932.Xr sysctl 8
933variable
934.Va net.inet6.ip6.auto_linklocal
935controls whether this flag is set by default or not.
936.It Cm -auto_linklocal
937Clear a flag
938.Cm auto_linklocal .
939.It Cm defaultif
940Set the specified interface as the default route when there is no
941default router.
942.It Cm -defaultif
943Clear a flag
944.Cm defaultif .
945.It Cm ifdisabled
946Set a flag to disable all of IPv6 network communications on the
947specified interface.
948Note that if there are already configured IPv6
949addresses on that interface, all of them are marked as
950.Dq tentative
951and DAD will be performed when this flag is cleared.
952.It Cm -ifdisabled
953Clear a flag
954.Cm ifdisabled .
955When this flag is cleared and
956.Cm auto_linklocal
957flag is enabled, automatic configuration of a link-local address is
958performed.
959.It Cm nud
960Set a flag to enable Neighbor Unreachability Detection.
961.It Cm -nud
962Clear a flag
963.Cm nud .
964.It Cm no_prefer_iface
965Set a flag to not honor rule 5 of source address selection in RFC 3484.
966In practice this means the address on the outgoing interface will not be
967preferred, effectively yielding the decision to the address selection
968policy table, configurable with
969.Xr ip6addrctl 8 .
970.It Cm -no_prefer_iface
971Clear a flag
972.Cm no_prefer_iface .
973.It Cm no_dad
974Set a flag to disable Duplicate Address Detection.
975.It Cm -no_dad
976Clear a flag
977.Cm no_dad .
978.El
979.Ss IPv6 Parameters
980The following parameters are specific for IPv6 addresses.
981Note that the address family keyword
982.Dq Li inet6
983is needed for them:
984.Bl -tag -width indent
985.It Cm autoconf
986Set the IPv6 autoconfigured address bit.
987.It Fl autoconf
988Clear the IPv6 autoconfigured address bit.
989.It Cm deprecated
990Set the IPv6 deprecated address bit.
991.It Fl deprecated
992Clear the IPv6 deprecated address bit.
993.It Cm pltime Ar n
994Set preferred lifetime for the address.
995.It Cm prefer_source
996Set a flag to prefer address as a candidate of the source address for
997outgoing packets.
998.It Cm -prefer_source
999Clear a flag
1000.Cm prefer_source .
1001.It Cm vltime Ar n
1002Set valid lifetime for the address.
1003.El
1004.Ss IEEE 802.11 Wireless Interfaces Cloning Parameters
1005The following parameters are specific to cloning
1006IEEE 802.11 wireless interfaces with the
1007.Cm create
1008request:
1009.Bl -tag -width indent
1010.It Cm wlandev Ar device
1011Use
1012.Ar device
1013as the parent for the cloned device.
1014.It Cm wlanmode Ar mode
1015Specify the operating mode for this cloned device.
1016.Ar mode
1017is one of
1018.Cm sta ,
1019.Cm ahdemo
1020(or
1021.Cm adhoc-demo ) ,
1022.Cm ibss
1023(or
1024.Cm adhoc ) ,
1025.Cm ap
1026(or
1027.Cm hostap ) ,
1028.Cm wds ,
1029.Cm tdma ,
1030.Cm mesh ,
1031and
1032.Cm monitor .
1033The operating mode of a cloned interface cannot be changed.
1034The
1035.Cm tdma
1036mode is actually implemented as an
1037.Cm adhoc-demo
1038interface with special properties.
1039.It Cm wlanbssid Ar bssid
1040The 802.11 mac address to use for the bssid.
1041This must be specified at create time for a legacy
1042.Cm wds
1043device.
1044.It Cm wlanaddr Ar address
1045The local mac address.
1046If this is not specified then a mac address will automatically be assigned
1047to the cloned device.
1048Typically this address is the same as the address of the parent device
1049but if the
1050.Cm bssid
1051parameter is specified then the driver will craft a unique address for
1052the device (if supported).
1053.It Cm wdslegacy
1054Mark a
1055.Cm wds
1056device as operating in
1057.Dq legacy mode .
1058Legacy
1059.Cm wds
1060devices have a fixed peer relationship and do not, for example, roam
1061if their peer stops communicating.
1062For completeness a Dynamic WDS (DWDS) interface may marked as
1063.Fl wdslegacy .
1064.It Cm bssid
1065Request a unique local mac address for the cloned device.
1066This is only possible if the device supports multiple mac addresses.
1067To force use of the parent's mac address use
1068.Fl bssid .
1069.It Cm beacons
1070Mark the cloned interface as depending on hardware support to
1071track received beacons.
1072To have beacons tracked in software use
1073.Fl beacons .
1074For
1075.Cm hostap
1076mode
1077.Fl beacons
1078can also be used to indicate no beacons should
1079be transmitted; this can be useful when creating a WDS configuration but
1080.Cm wds
1081interfaces can only be created as companions to an access point.
1082.El
1083.Ss Cloned IEEE 802.11 Wireless Interface Parameters
1084The following parameters are specific to IEEE 802.11 wireless interfaces
1085cloned with a
1086.Cm create
1087operation:
1088.Bl -tag -width indent
1089.It Cm ampdu
1090Enable sending and receiving AMPDU frames when using 802.11n (default).
1091The 802.11n specification states a compliant station must be capable
1092of receiving AMPDU frames but transmission is optional.
1093Use
1094.Fl ampdu
1095to disable all use of AMPDU with 802.11n.
1096For testing and/or to work around interoperability problems one can use
1097.Cm ampdutx
1098and
1099.Cm ampdurx
1100to control use of AMPDU in one direction.
1101.It Cm ampdudensity Ar density
1102Set the AMPDU density parameter used when operating with 802.11n.
1103This parameter controls the inter-packet gap for AMPDU frames.
1104The sending device normally controls this setting but a receiving station
1105may request wider gaps.
1106Legal values for
1107.Ar density
1108are 0, .25, .5, 1, 2, 4, 8, and 16 (microseconds).
1109A value of
1110.Cm -
1111is treated the same as 0.
1112.It Cm ampdulimit Ar limit
1113Set the limit on packet size for receiving AMPDU frames when operating
1114with 802.11n.
1115Legal values for
1116.Ar limit
1117are 8192, 16384, 32768, and 65536 but one can also specify
1118just the unique prefix: 8, 16, 32, 64.
1119Note the sender may limit the size of AMPDU frames to be less
1120than the maximum specified by the receiving station.
1121.It Cm amsdu
1122Enable sending and receiving AMSDU frames when using 802.11n.
1123By default AMSDU is received but not transmitted.
1124Use
1125.Fl amsdu
1126to disable all use of AMSDU with 802.11n.
1127For testing and/or to work around interoperability problems one can use
1128.Cm amsdutx
1129and
1130.Cm amsdurx
1131to control use of AMSDU in one direction.
1132.It Cm amsdulimit Ar limit
1133Set the limit on packet size for sending and receiving AMSDU frames
1134when operating with 802.11n.
1135Legal values for
1136.Ar limit
1137are 7935 and 3839 (bytes).
1138Note the sender may limit the size of AMSDU frames to be less
1139than the maximum specified by the receiving station.
1140Note also that devices are not required to support the 7935 limit,
1141only 3839 is required by the specification and the larger value
1142may require more memory to be dedicated to support functionality
1143that is rarely used.
1144.It Cm apbridge
1145When operating as an access point, pass packets between
1146wireless clients directly (default).
1147To instead let them pass up through the
1148system and be forwarded using some other mechanism, use
1149.Fl apbridge .
1150Disabling the internal bridging
1151is useful when traffic is to be processed with
1152packet filtering.
1153.It Cm authmode Ar mode
1154Set the desired authentication mode in infrastructure mode.
1155Not all adapters support all modes.
1156The set of
1157valid modes is
1158.Cm none , open , shared
1159(shared key),
1160.Cm 8021x
1161(IEEE 802.1x),
1162and
1163.Cm wpa
1164(IEEE WPA/WPA2/802.11i).
1165The
1166.Cm 8021x
1167and
1168.Cm wpa
1169modes are only useful when using an authentication service
1170(a supplicant for client operation or an authenticator when
1171operating as an access point).
1172Modes are case insensitive.
1173.It Cm bgscan
1174Enable background scanning when operating as a station.
1175Background scanning is a technique whereby a station associated to
1176an access point will temporarily leave the channel to scan for
1177neighboring stations.
1178This allows a station to maintain a cache of nearby access points
1179so that roaming between access points can be done without
1180a lengthy scan operation.
1181Background scanning is done only when a station is not busy and
1182any outbound traffic will cancel a scan operation.
1183Background scanning should never cause packets to be lost though
1184there may be some small latency if outbound traffic interrupts a
1185scan operation.
1186By default background scanning is enabled if the device is capable.
1187To disable background scanning, use
1188.Fl bgscan .
1189Background scanning is controlled by the
1190.Cm bgscanidle
1191and
1192.Cm bgscanintvl
1193parameters.
1194Background scanning must be enabled for roaming; this is an artifact
1195of the current implementation and may not be required in the future.
1196.It Cm bgscanidle Ar idletime
1197Set the minimum time a station must be idle (not transmitting or
1198receiving frames) before a background scan is initiated.
1199The
1200.Ar idletime
1201parameter is specified in milliseconds.
1202By default a station must be idle at least 250 milliseconds before
1203a background scan is initiated.
1204The idle time may not be set to less than 100 milliseconds.
1205.It Cm bgscanintvl Ar interval
1206Set the interval at which background scanning is attempted.
1207The
1208.Ar interval
1209parameter is specified in seconds.
1210By default a background scan is considered every 300 seconds (5 minutes).
1211The
1212.Ar interval
1213may not be set to less than 15 seconds.
1214.It Cm bintval Ar interval
1215Set the interval at which beacon frames are sent when operating in
1216ad-hoc or ap mode.
1217The
1218.Ar interval
1219parameter is specified in TU's (1024 usecs).
1220By default beacon frames are transmitted every 100 TU's.
1221.It Cm bmissthreshold Ar count
1222Set the number of consecutive missed beacons at which the station
1223will attempt to roam (i.e., search for a new access point).
1224The
1225.Ar count
1226parameter must be in the range 1 to 255; though the
1227upper bound may be reduced according to device capabilities.
1228The default threshold is 7 consecutive missed beacons; but
1229this may be overridden by the device driver.
1230Another name for the
1231.Cm bmissthreshold
1232parameter is
1233.Cm bmiss .
1234.It Cm bssid Ar address
1235Specify the MAC address of the access point to use when operating
1236as a station in a BSS network.
1237This overrides any automatic selection done by the system.
1238To disable a previously selected access point, supply
1239.Cm any , none ,
1240or
1241.Cm -
1242for the address.
1243This option is useful when more than one access point uses the same SSID.
1244Another name for the
1245.Cm bssid
1246parameter is
1247.Cm ap .
1248.It Cm burst
1249Enable packet bursting.
1250Packet bursting is a transmission technique whereby the wireless
1251medium is acquired once to send multiple frames and the interframe
1252spacing is reduced.
1253This technique can significantly increase throughput by reducing
1254transmission overhead.
1255Packet bursting is supported by the 802.11e QoS specification
1256and some devices that do not support QoS may still be capable.
1257By default packet bursting is enabled if a device is capable
1258of doing it.
1259To disable packet bursting, use
1260.Fl burst .
1261.It Cm chanlist Ar channels
1262Set the desired channels to use when scanning for access
1263points, neighbors in an IBSS network, or looking for unoccupied
1264channels when operating as an access point.
1265The set of channels is specified as a comma-separated list with
1266each element in the list representing either a single channel number or a range
1267of the form
1268.Dq Li a-b .
1269Channel numbers must be in the range 1 to 255 and be permissible
1270according to the operating characteristics of the device.
1271.It Cm channel Ar number
1272Set a single desired channel.
1273Channels range from 1 to 255, but the exact selection available
1274depends on the region your adaptor was manufactured for.
1275Setting
1276the channel to
1277.Cm any ,
1278or
1279.Dq Cm -
1280will clear any desired channel and, if the device is marked up,
1281force a scan for a channel to operate on.
1282Alternatively the frequency, in megahertz, may be specified
1283instead of the channel number.
1284.Pp
1285When there are several ways to use a channel the channel
1286number/frequency may be appended with attributes to clarify.
1287For example, if a device is capable of operating on channel 6
1288with 802.11n and 802.11g then one can specify that g-only use
1289should be used by specifying
1290.Cm 6:g .
1291Similarly the channel width can be specified by appending it
1292with
1293.Dq Cm \&/ ;
1294e.g.,
1295.Cm 6/40
1296specifies a 40MHz wide channel.
1297These attributes can be combined as in:
1298.Cm 6:ht/40 .
1299.Pp
1300The full set of flags specified following a
1301.Dq Cm \&:
1302are:
1303.Pp
1304.Bl -tag -compact
1305.It Cm a
1306802.11a
1307.It Cm b
1308802.11b
1309.It Cm d
1310Atheros Dynamic Turbo mode
1311.It Cm g
1312802.11g
1313.It Cm h
1314Same as
1315.Cm n
1316.It Cm n
1317802.11n aka HT
1318.It Cm s
1319Atheros Static Turbo mode
1320.It Cm t
1321Atheros Dynamic Turbo mode, or appended to
1322.Cm st
1323and
1324.Cm dt
1325.El
1326.Pp
1327The full set of channel widths following a
1328.Cm \&/
1329are:
1330.Pp
1331.Bl -tag -compact
1332.It Cm 5
13335MHz aka quarter-rate channel
1334.It Cm 10
133510MHz aka half-rate channel
1336.It Cm 20
133720MHz mostly for use in specifying
1338.Cm ht20
1339.It Cm 40
134040MHz mostly for use in specifying
1341.Cm ht40
1342.El
1343.Pp
1344In addition,
1345a 40MHz HT channel specification may include the location
1346of the extension channel by appending
1347.Dq Cm \&+
1348or
1349.Dq Cm \&-
1350for above and below,
1351respectively; e.g.,
1352.Cm 2437:ht/40+
1353specifies 40MHz wide HT operation
1354with the center channel at frequency 2437 and the extension channel above.
1355.It Cm country Ar name
1356Set the country code to use in calculating the regulatory constraints
1357for operation.
1358In particular the set of available channels, how the wireless device
1359will operation on the channels, and the maximum transmit power that
1360can be used on a channel are defined by this setting.
1361Country/Region codes are specified as a 2-character abbreviation
1362defined by ISO 3166 or using a longer, but possibly ambiguous, spelling;
1363e.g., "ES" and "Spain".
1364The set of country codes are taken from
1365.Pa /etc/regdomain.xml
1366and can also
1367be viewed with the
1368.Cm list countries
1369request.
1370Note that not all devices support changing the country code from a default
1371setting; typically stored in EEPROM.
1372See also
1373.Cm regdomain ,
1374.Cm indoor ,
1375.Cm outdoor ,
1376and
1377.Cm anywhere .
1378.It Cm dfs
1379Enable Dynamic Frequency Selection (DFS) as specified in 802.11h.
1380DFS embodies several facilities including detection of overlapping
1381radar signals, dynamic transmit power control, and channel selection
1382according to a least-congested criteria.
1383DFS support is mandatory for some 5GHz frequencies in certain
1384locales (e.g., ETSI).
1385By default DFS is enabled according to the regulatory definitions
1386specified in
1387.Pa /etc/regdomain.xml
1388and the current country code, regdomain,
1389and channel.
1390Note the underlying device (and driver) must support radar detection
1391for full DFS support to work.
1392To be fully compliant with the local regulatory agency frequencies that
1393require DFS should not be used unless it is fully supported.
1394Use
1395.Fl dfs
1396to disable this functionality for testing.
1397.It Cm dotd
1398Enable support for the 802.11d specification (default).
1399When this support is enabled in station mode, beacon frames that advertise
1400a country code different than the currently configured country code will
1401cause an event to be dispatched to user applications.
1402This event can be used by the station to adopt that country code and
1403operate according to the associated regulatory constraints.
1404When operating as an access point with 802.11d enabled the beacon and
1405probe response frames transmitted will advertise the current regulatory
1406domain settings.
1407To disable 802.11d use
1408.Fl dotd .
1409.It Cm doth
1410Enable 802.11h support including spectrum management.
1411When 802.11h is enabled beacon and probe response frames will have
1412the SpectrumMgt bit set in the capabilities field and
1413country and power constraint information elements will be present.
1414802.11h support also includes handling Channel Switch Announcements (CSA)
1415which are a mechanism to coordinate channel changes by an access point.
1416By default 802.11h is enabled if the device is capable.
1417To disable 802.11h use
1418.Fl doth .
1419.It Cm deftxkey Ar index
1420Set the default key to use for transmission.
1421Typically this is only set when using WEP encryption.
1422Note that you must set a default transmit key
1423for the system to know which key to use in encrypting outbound traffic.
1424The
1425.Cm weptxkey
1426is an alias for this request; it is provided for backwards compatibility.
1427.It Cm dtimperiod Ar period
1428Set the
1429DTIM
1430period for transmitting buffered multicast data frames when
1431operating in ap mode.
1432The
1433.Ar period
1434specifies the number of beacon intervals between DTIM
1435and must be in the range 1 to 15.
1436By default DTIM is 1 (i.e., DTIM occurs at each beacon).
1437.It Cm quiet
1438Enable the use of quiet IE.
1439Hostap will use this to silence other
1440stations to reduce interference for radar detection when
1441operating on 5GHz frequency and doth support is enabled.
1442Use
1443.Fl quiet
1444to disable this functionality.
1445.It Cm quiet_period Ar period
1446Set the QUIET
1447.Ar period
1448to the number of beacon intervals between the start of regularly
1449scheduled quiet intervals defined by Quiet element.
1450.It Cm quiet_count Ar count
1451Set the QUIET
1452.Ar count
1453to the number of TBTTs until the beacon interval during which the
1454next quiet interval shall start.
1455A value of 1 indicates the quiet
1456interval will start during the beacon interval starting at the next
1457TBTT.
1458A value 0 is reserved.
1459.It Cm quiet_offset Ar offset
1460Set the QUIET
1461.Ar offset
1462to the offset of the start of the quiet interval from the TBTT
1463specified by the Quiet count, expressed in TUs.
1464The value of the
1465.Ar offset
1466shall be less than one beacon interval.
1467.It Cm quiet_duration Ar dur
1468Set the QUIET
1469.Ar dur
1470to the duration of the Quiet interval, expressed in TUs.
1471The value should be less than beacon interval.
1472.It Cm dturbo
1473Enable the use of Atheros Dynamic Turbo mode when communicating with
1474another Dynamic Turbo-capable station.
1475Dynamic Turbo mode is an Atheros-specific mechanism by which
1476stations switch between normal 802.11 operation and a
1477.Dq boosted
1478mode in which a 40MHz wide channel is used for communication.
1479Stations using Dynamic Turbo mode operate boosted only when the
1480channel is free of non-dturbo stations; when a non-dturbo station
1481is identified on the channel all stations will automatically drop
1482back to normal operation.
1483By default, Dynamic Turbo mode is not enabled, even if the device is capable.
1484Note that turbo mode (dynamic or static) is only allowed on some
1485channels depending on the regulatory constraints; use the
1486.Cm list chan
1487command to identify the channels where turbo mode may be used.
1488To disable Dynamic Turbo mode use
1489.Fl dturbo .
1490.It Cm dwds
1491Enable Dynamic WDS (DWDS) support.
1492DWDS is a facility by which 4-address traffic can be carried between
1493stations operating in infrastructure mode.
1494A station first associates to an access point and authenticates using
1495normal procedures (e.g., WPA).
1496Then 4-address frames are passed to carry traffic for stations
1497operating on either side of the wireless link.
1498DWDS extends the normal WDS mechanism by leveraging existing security
1499protocols and eliminating static binding.
1500.Pp
1501When DWDS is enabled on an access point 4-address frames received from
1502an authorized station will generate a
1503.Dq DWDS discovery
1504event to user
1505applications.
1506This event should be used to create a WDS interface that is bound
1507to the remote station (and usually plumbed into a bridge).
1508Once the WDS interface is up and running 4-address traffic then logically
1509flows through that interface.
1510.Pp
1511When DWDS is enabled on a station, traffic with a destination address
1512different from the peer station are encapsulated in a 4-address frame
1513and transmitted to the peer.
1514All 4-address traffic uses the security information of the stations
1515(e.g., cryptographic keys).
1516A station is associated using 802.11n facilities may transport
15174-address traffic using these same mechanisms; this depends on available
1518resources and capabilities of the device.
1519The DWDS implementation guards against layer 2 routing loops of
1520multicast traffic.
1521.It Cm ff
1522Enable the use of Atheros Fast Frames when communicating with
1523another Fast Frames-capable station.
1524Fast Frames are an encapsulation technique by which two 802.3
1525frames are transmitted in a single 802.11 frame.
1526This can noticeably improve throughput but requires that the
1527receiving station understand how to decapsulate the frame.
1528Fast frame use is negotiated using the Atheros 802.11 vendor-specific
1529protocol extension so enabling use is safe when communicating with
1530non-Atheros devices.
1531By default, use of fast frames is enabled if the device is capable.
1532To explicitly disable fast frames, use
1533.Fl ff .
1534.It Cm fragthreshold Ar length
1535Set the threshold for which transmitted frames are broken into fragments.
1536The
1537.Ar length
1538argument is the frame size in bytes and must be in the range 256 to 2346.
1539Setting
1540.Ar length
1541to
1542.Li 2346 ,
1543.Cm any ,
1544or
1545.Cm -
1546disables transmit fragmentation.
1547Not all adapters honor the fragmentation threshold.
1548.It Cm hidessid
1549When operating as an access point, do not broadcast the SSID
1550in beacon frames or respond to probe request frames unless
1551they are directed to the ap (i.e., they include the ap's SSID).
1552By default, the SSID is included in beacon frames and
1553undirected probe request frames are answered.
1554To re-enable the broadcast of the SSID etc., use
1555.Fl hidessid .
1556.It Cm ht
1557Enable use of High Throughput (HT) when using 802.11n (default).
1558The 802.11n specification includes mechanisms for operation
1559on 20MHz and 40MHz wide channels using different signalling mechanisms
1560than specified in 802.11b, 802.11g, and 802.11a.
1561Stations negotiate use of these facilities, termed HT20 and HT40,
1562when they associate.
1563To disable all use of 802.11n use
1564.Fl ht .
1565To disable use of HT20 (e.g., to force only HT40 use) use
1566.Fl ht20 .
1567To disable use of HT40 use
1568.Fl ht40 .
1569.Pp
1570HT configuration is used to
1571.Dq auto promote
1572operation
1573when several choices are available.
1574For example, if a station associates to an 11n-capable access point
1575it controls whether the station uses legacy operation, HT20, or HT40.
1576When an 11n-capable device is setup as an access point and
1577Auto Channel Selection is used to locate a channel to operate on,
1578HT configuration controls whether legacy, HT20, or HT40 operation is setup
1579on the selected channel.
1580If a fixed channel is specified for a station then HT configuration can
1581be given as part of the channel specification; e.g., 6:ht/20 to setup
1582HT20 operation on channel 6.
1583.It Cm htcompat
1584Enable use of compatibility support for pre-802.11n devices (default).
1585The 802.11n protocol specification went through several incompatible iterations.
1586Some vendors implemented 11n support to older specifications that
1587will not interoperate with a purely 11n-compliant station.
1588In particular the information elements included in management frames
1589for old devices are different.
1590When compatibility support is enabled both standard and compatible data
1591will be provided.
1592Stations that associate using the compatibility mechanisms are flagged
1593in
1594.Cm list sta .
1595To disable compatibility support use
1596.Fl htcompat .
1597.It Cm htprotmode Ar technique
1598For interfaces operating in 802.11n, use the specified
1599.Ar technique
1600for protecting HT frames in a mixed legacy/HT network.
1601The set of valid techniques is
1602.Cm off ,
1603and
1604.Cm rts
1605(RTS/CTS, default).
1606Technique names are case insensitive.
1607.It Cm inact
1608Enable inactivity processing for stations associated to an
1609access point (default).
1610When operating as an access point the 802.11 layer monitors
1611the activity of each associated station.
1612When a station is inactive for 5 minutes it will send several
1613.Dq probe frames
1614to see if the station is still present.
1615If no response is received then the station is deauthenticated.
1616Applications that prefer to handle this work can disable this
1617facility by using
1618.Fl inact .
1619.It Cm indoor
1620Set the location to use in calculating regulatory constraints.
1621The location is also advertised in beacon and probe response frames
1622when 802.11d is enabled with
1623.Cm dotd .
1624See also
1625.Cm outdoor ,
1626.Cm anywhere ,
1627.Cm country ,
1628and
1629.Cm regdomain .
1630.It Cm list active
1631Display the list of channels available for use taking into account
1632any restrictions set with the
1633.Cm chanlist
1634directive.
1635See the description of
1636.Cm list chan
1637for more information.
1638.It Cm list caps
1639Display the adaptor's capabilities, including the operating
1640modes supported.
1641.It Cm list chan
1642Display the list of channels available for use.
1643Channels are shown with their IEEE channel number, equivalent
1644frequency, and usage modes.
1645Channels identified as
1646.Ql 11g
1647are also usable in
1648.Ql 11b
1649mode.
1650Channels identified as
1651.Ql 11a Turbo
1652may be used only for Atheros' Static Turbo mode
1653(specified with
1654. Cm mediaopt turbo ) .
1655Channels marked with a
1656.Ql *
1657have a regulatory constraint that they be passively scanned.
1658This means a station is not permitted to transmit on the channel until
1659it identifies the channel is being used for 802.11 communication;
1660typically by hearing a beacon frame from an access point operating
1661on the channel.
1662.Cm list freq
1663is another way of requesting this information.
1664By default a compacted list of channels is displayed; if the
1665.Fl v
1666option is specified then all channels are shown.
1667.It Cm list countries
1668Display the set of country codes and regulatory domains that can be
1669used in regulatory configuration.
1670.It Cm list mac
1671Display the current MAC Access Control List state.
1672Each address is prefixed with a character that indicates the
1673current policy applied to it:
1674.Ql +
1675indicates the address is allowed access,
1676.Ql -
1677indicates the address is denied access,
1678.Ql *
1679indicates the address is present but the current policy open
1680(so the ACL is not consulted).
1681.It Cm list mesh
1682Displays the mesh routing table, used for forwarding packets on a mesh
1683network.
1684.It Cm list regdomain
1685Display the current regulatory settings including the available channels
1686and transmit power caps.
1687.It Cm list roam
1688Display the parameters that govern roaming operation.
1689.It Cm list txparam
1690Display the parameters that govern transmit operation.
1691.It Cm list txpower
1692Display the transmit power caps for each channel.
1693.It Cm list scan
1694Display the access points and/or ad-hoc neighbors
1695located in the vicinity.
1696This information may be updated automatically by the adapter
1697with a
1698.Cm scan
1699request or through background scanning.
1700Depending on the capabilities of the stations the following
1701flags (capability codes) can be included in the output:
1702.Bl -tag -width 3n
1703.It Li A
1704Channel agility.
1705.It Li B
1706PBCC modulation.
1707.It Li C
1708Poll request capability.
1709.It Li D
1710DSSS/OFDM capability.
1711.It Li E
1712Extended Service Set (ESS).
1713Indicates that the station is part of an infrastructure network
1714rather than an IBSS/ad-hoc network.
1715.It Li I
1716Independent Basic Service Set (IBSS).
1717Indicates that the station is part of an ad-hoc network
1718rather than an ESS network.
1719.It Li P
1720Privacy capability.
1721The station requires authentication and encryption
1722for all data frames exchanged within the BSS using cryptographic means
1723such as WEP, TKIP, or AES-CCMP.
1724.It Li R
1725Robust Secure Network (RSN).
1726.It Li S
1727Short Preamble.
1728Indicates that the network is using short preambles,
1729defined in 802.11b High Rate/DSSS PHY,
1730and utilizes a 56 bit sync field
1731rather than the 128 bit field used in long preamble mode.
1732Short preambles are used to optionally
1733improve throughput performance with 802.11g and 802.11b.
1734.It Li c
1735Pollable capability.
1736.It Li s
1737Short slot time capability.
1738Indicates that the 802.11g network is using a short slot time
1739because there are no legacy (802.11b) stations present.
1740.El
1741.Pp
1742By default interesting information elements captured from the neighboring
1743stations are displayed at the end of each row.
1744Possible elements include:
1745.Cm WME
1746(station supports WME),
1747.Cm WPA
1748(station supports WPA),
1749.Cm WPS
1750(station supports WPS),
1751.Cm RSN
1752(station supports 802.11i/RSN),
1753.Cm HTCAP
1754(station supports 802.11n/HT communication),
1755.Cm ATH
1756(station supports Atheros protocol extensions),
1757.Cm VEN
1758(station supports unknown vendor-specific extensions).
1759If the
1760.Fl v
1761flag is used all the information elements and their
1762contents will be shown.
1763Specifying the
1764.Fl v
1765flag also enables display of long SSIDs.
1766The
1767.Cm list ap
1768command is another way of requesting this information.
1769.It Cm list sta
1770When operating as an access point display the stations that are
1771currently associated.
1772When operating in ad-hoc mode display stations identified as
1773neighbors in the IBSS.
1774When operating in mesh mode display stations identified as
1775neighbors in the MBSS.
1776When operating in station mode display the access point.
1777Capabilities advertised by the stations are described under
1778the
1779.Cm scan
1780request.
1781The following flags can be included in the output:
1782.Bl -tag -width 3n
1783.It Li A
1784Authorized.
1785Indicates that the station is permitted to send/receive data frames.
1786.It Li E
1787Extended Rate Phy (ERP).
1788Indicates that the station is operating in an 802.11g network
1789using extended transmit rates.
1790.It Li H
1791High Throughput (HT).
1792Indicates that the station is using HT transmit rates.
1793If a
1794.Sq Li +
1795follows immediately after then the station associated
1796using deprecated mechanisms supported only when
1797.Cm htcompat
1798is enabled.
1799.It Li P
1800Power Save.
1801Indicates that the station is operating in power save mode.
1802.It Li Q
1803Quality of Service (QoS).
1804Indicates that the station is using QoS encapsulation for
1805data frame.
1806QoS encapsulation is enabled only when WME mode is enabled.
1807.It Li S
1808Short GI in HT 40MHz mode enabled.
1809If a
1810.Sq Li +
1811follows immediately after then short GI in HT 20MHz mode is enabled as well.
1812.It Li T
1813Transitional Security Network (TSN).
1814Indicates that the station associated using TSN; see also
1815.Cm tsn
1816below.
1817.It Li W
1818Wi-Fi Protected Setup (WPS).
1819Indicates that the station associated using WPS.
1820.It Li s
1821Short GI in HT 20MHz mode enabled.
1822.El
1823.Pp
1824By default information elements received from associated stations
1825are displayed in a short form; the
1826.Fl v
1827flag causes this information to be displayed symbolically.
1828.It Cm list wme
1829Display the current channel parameters to use when operating in WME mode.
1830If the
1831.Fl v
1832option is specified then both channel and BSS parameters are displayed
1833for each AC (first channel, then BSS).
1834When WME mode is enabled for an adaptor this information will be
1835displayed with the regular status; this command is mostly useful
1836for examining parameters when WME mode is disabled.
1837See the description of the
1838.Cm wme
1839directive for information on the various parameters.
1840.It Cm maxretry Ar count
1841Set the maximum number of tries to use in sending unicast frames.
1842The default setting is 6 but drivers may override this with a value
1843they choose.
1844.It Cm mcastrate Ar rate
1845Set the rate for transmitting multicast/broadcast frames.
1846Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s.
1847This rate should be valid for the current operating conditions;
1848if an invalid rate is specified drivers are free to chose an
1849appropriate rate.
1850.It Cm mgtrate Ar rate
1851Set the rate for transmitting management and/or control frames.
1852Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s.
1853.It Cm outdoor
1854Set the location to use in calculating regulatory constraints.
1855The location is also advertised in beacon and probe response frames
1856when 802.11d is enabled with
1857.Cm dotd .
1858See also
1859.Cm anywhere ,
1860.Cm country ,
1861.Cm indoor ,
1862and
1863.Cm regdomain .
1864.It Cm powersave
1865Enable powersave operation.
1866When operating as a client, the station will conserve power by
1867periodically turning off the radio and listening for
1868messages from the access point telling it there are packets waiting.
1869The station must then retrieve the packets.
1870Not all devices support power save operation as a client.
1871The 802.11 specification requires that all access points support
1872power save but some drivers do not.
1873Use
1874.Fl powersave
1875to disable powersave operation when operating as a client.
1876.It Cm powersavesleep Ar sleep
1877Set the desired max powersave sleep time in TU's (1024 usecs).
1878By default the max powersave sleep time is 100 TU's.
1879.It Cm protmode Ar technique
1880For interfaces operating in 802.11g, use the specified
1881.Ar technique
1882for protecting OFDM frames in a mixed 11b/11g network.
1883The set of valid techniques is
1884.Cm off , cts
1885(CTS to self),
1886and
1887.Cm rtscts
1888(RTS/CTS).
1889Technique names are case insensitive.
1890Not all devices support
1891.Cm cts
1892as a protection technique.
1893.It Cm pureg
1894When operating as an access point in 802.11g mode allow only
189511g-capable stations to associate (11b-only stations are not
1896permitted to associate).
1897To allow both 11g and 11b-only stations to associate, use
1898.Fl pureg .
1899.It Cm puren
1900When operating as an access point in 802.11n mode allow only
1901HT-capable stations to associate (legacy stations are not
1902permitted to associate).
1903To allow both HT and legacy stations to associate, use
1904.Fl puren .
1905.It Cm regdomain Ar sku
1906Set the regulatory domain to use in calculating the regulatory constraints
1907for operation.
1908In particular the set of available channels, how the wireless device
1909will operation on the channels, and the maximum transmit power that
1910can be used on a channel are defined by this setting.
1911Regdomain codes (SKU's) are taken from
1912.Pa /etc/regdomain.xml
1913and can also
1914be viewed with the
1915.Cm list countries
1916request.
1917Note that not all devices support changing the regdomain from a default
1918setting; typically stored in EEPROM.
1919See also
1920.Cm country ,
1921.Cm indoor ,
1922.Cm outdoor ,
1923and
1924.Cm anywhere .
1925.It Cm rifs
1926Enable use of Reduced InterFrame Spacing (RIFS) when operating in 802.11n
1927on an HT channel.
1928Note that RIFS must be supported by both the station and access point
1929for it to be used.
1930To disable RIFS use
1931.Fl rifs .
1932.It Cm roam:rate Ar rate
1933Set the threshold for controlling roaming when operating in a BSS.
1934The
1935.Ar rate
1936parameter specifies the transmit rate in megabits
1937at which roaming should be considered.
1938If the current transmit rate drops below this setting and background scanning
1939is enabled, then the system will check if a more desirable access point is
1940available and switch over to it.
1941The current scan cache contents are used if they are considered
1942valid according to the
1943.Cm scanvalid
1944parameter; otherwise a background scan operation is triggered before
1945any selection occurs.
1946Each channel type has a separate rate threshold; the default values are:
194712 Mb/s (11a), 2 Mb/s (11b), 2 Mb/s (11g), MCS 1 (11na, 11ng).
1948.It Cm roam:rssi Ar rssi
1949Set the threshold for controlling roaming when operating in a BSS.
1950The
1951.Ar rssi
1952parameter specifies the receive signal strength in dBm units
1953at which roaming should be considered.
1954If the current rssi drops below this setting and background scanning
1955is enabled, then the system will check if a more desirable access point is
1956available and switch over to it.
1957The current scan cache contents are used if they are considered
1958valid according to the
1959.Cm scanvalid
1960parameter; otherwise a background scan operation is triggered before
1961any selection occurs.
1962Each channel type has a separate rssi threshold; the default values are
1963all 7 dBm.
1964.It Cm roaming Ar mode
1965When operating as a station, control how the system will
1966behave when communication with the current access point
1967is broken.
1968The
1969.Ar mode
1970argument may be one of
1971.Cm device
1972(leave it to the hardware device to decide),
1973.Cm auto
1974(handle either in the device or the operating system\[em]as appropriate),
1975.Cm manual
1976(do nothing until explicitly instructed).
1977By default, the device is left to handle this if it is
1978capable; otherwise, the operating system will automatically
1979attempt to reestablish communication.
1980Manual mode is used by applications such as
1981.Xr wpa_supplicant 8
1982that want to control the selection of an access point.
1983.It Cm rtsthreshold Ar length
1984Set the threshold for which
1985transmitted frames are preceded by transmission of an
1986RTS
1987control frame.
1988The
1989.Ar length
1990argument
1991is the frame size in bytes and must be in the range 1 to 2346.
1992Setting
1993.Ar length
1994to
1995.Li 2346 ,
1996.Cm any ,
1997or
1998.Cm -
1999disables transmission of RTS frames.
2000Not all adapters support setting the RTS threshold.
2001.It Cm scan
2002Initiate a scan of neighboring stations, wait for it to complete, and
2003display all stations found.
2004Only the super-user can initiate a scan.
2005See
2006.Cm list scan
2007for information on the display.
2008By default a background scan is done; otherwise a foreground
2009scan is done and the station may roam to a different access point.
2010The
2011.Cm list scan
2012request can be used to show recent scan results without
2013initiating a new scan.
2014.It Cm scanvalid Ar threshold
2015Set the maximum time the scan cache contents are considered valid;
2016i.e., will be used without first triggering a scan operation to
2017refresh the data.
2018The
2019.Ar threshold
2020parameter is specified in seconds and defaults to 60 seconds.
2021The minimum setting for
2022.Ar threshold
2023is 10 seconds.
2024One should take care setting this threshold; if it is set too low
2025then attempts to roam to another access point may trigger unnecessary
2026background scan operations.
2027.It Cm shortgi
2028Enable use of Short Guard Interval when operating in 802.11n
2029on an HT channel.
2030NB: this currently enables Short GI on both HT40 and HT20 channels.
2031To disable Short GI use
2032.Fl shortgi .
2033.It Cm smps
2034Enable use of Static Spatial Multiplexing Power Save (SMPS)
2035when operating in 802.11n.
2036A station operating with Static SMPS maintains only a single
2037receive chain active (this can significantly reduce power consumption).
2038To disable SMPS use
2039.Fl smps .
2040.It Cm smpsdyn
2041Enable use of Dynamic Spatial Multiplexing Power Save (SMPS)
2042when operating in 802.11n.
2043A station operating with Dynamic SMPS maintains only a single
2044receive chain active but switches to multiple receive chains when it
2045receives an RTS frame (this can significantly reduce power consumption).
2046Note that stations cannot distinguish between RTS/CTS intended to
2047enable multiple receive chains and those used for other purposes.
2048To disable SMPS use
2049.Fl smps .
2050.It Cm ssid Ar ssid
2051Set the desired Service Set Identifier (aka network name).
2052The SSID is a string up to 32 characters
2053in length and may be specified as either a normal string or in
2054hexadecimal when preceded by
2055.Ql 0x .
2056Additionally, the SSID may be cleared by setting it to
2057.Ql - .
2058.It Cm tdmaslot Ar slot
2059When operating with TDMA, use the specified
2060.Ar slot
2061configuration.
2062The
2063.Ar slot
2064is a number between 0 and the maximum number of slots in the BSS.
2065Note that a station configured as slot 0 is a master and
2066will broadcast beacon frames advertising the BSS;
2067stations configured to use other slots will always
2068scan to locate a master before they ever transmit.
2069By default
2070.Cm tdmaslot
2071is set to 1.
2072.It Cm tdmaslotcnt Ar cnt
2073When operating with TDMA, setup a BSS with
2074.Ar cnt
2075slots.
2076The slot count may be at most 8.
2077The current implementation is only tested with two stations
2078(i.e., point to point applications).
2079This setting is only meaningful when a station is configured as slot 0;
2080other stations adopt this setting from the BSS they join.
2081By default
2082.Cm tdmaslotcnt
2083is set to 2.
2084.It Cm tdmaslotlen Ar len
2085When operating with TDMA, setup a BSS such that each station has a slot
2086.Ar len
2087microseconds long.
2088The slot length must be at least 150 microseconds (1/8 TU)
2089and no more than 65 milliseconds.
2090Note that setting too small a slot length may result in poor channel
2091bandwidth utilization due to factors such as timer granularity and
2092guard time.
2093This setting is only meaningful when a station is configured as slot 0;
2094other stations adopt this setting from the BSS they join.
2095By default
2096.Cm tdmaslotlen
2097is set to 10 milliseconds.
2098.It Cm tdmabintval Ar intval
2099When operating with TDMA, setup a BSS such that beacons are transmitted every
2100.Ar intval
2101superframes to synchronize the TDMA slot timing.
2102A superframe is defined as the number of slots times the slot length; e.g.,
2103a BSS with two slots of 10 milliseconds has a 20 millisecond superframe.
2104The beacon interval may not be zero.
2105A lower setting of
2106.Cm tdmabintval
2107causes the timers to be resynchronized more often; this can be help if
2108significant timer drift is observed.
2109By default
2110.Cm tdmabintval
2111is set to 5.
2112.It Cm tsn
2113When operating as an access point with WPA/802.11i allow legacy
2114stations to associate using static key WEP and open authentication.
2115To disallow legacy station use of WEP, use
2116.Fl tsn .
2117.It Cm txpower Ar power
2118Set the power used to transmit frames.
2119The
2120.Ar power
2121argument is specified in .5 dBm units.
2122Out of range values are truncated.
2123Typically only a few discrete power settings are available and
2124the driver will use the setting closest to the specified value.
2125Not all adapters support changing the transmit power.
2126.It Cm ucastrate Ar rate
2127Set a fixed rate for transmitting unicast frames.
2128Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s.
2129This rate should be valid for the current operating conditions;
2130if an invalid rate is specified drivers are free to chose an
2131appropriate rate.
2132.It Cm wepmode Ar mode
2133Set the desired WEP mode.
2134Not all adapters support all modes.
2135The set of valid modes is
2136.Cm off , on ,
2137and
2138.Cm mixed .
2139The
2140.Cm mixed
2141mode explicitly tells the adaptor to allow association with access
2142points which allow both encrypted and unencrypted traffic.
2143On these adapters,
2144.Cm on
2145means that the access point must only allow encrypted connections.
2146On other adapters,
2147.Cm on
2148is generally another name for
2149.Cm mixed .
2150Modes are case insensitive.
2151.It Cm weptxkey Ar index
2152Set the WEP key to be used for transmission.
2153This is the same as setting the default transmission key with
2154.Cm deftxkey .
2155.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
2156Set the selected WEP key.
2157If an
2158.Ar index
2159is not given, key 1 is set.
2160A WEP key will be either 5 or 13
2161characters (40 or 104 bits) depending on the local network and the
2162capabilities of the adaptor.
2163It may be specified either as a plain
2164string or as a string of hexadecimal digits preceded by
2165.Ql 0x .
2166For maximum portability, hex keys are recommended;
2167the mapping of text keys to WEP encryption is usually driver-specific.
2168In particular, the Windows drivers do this mapping differently to
2169.Fx .
2170A key may be cleared by setting it to
2171.Ql - .
2172If WEP is supported then there are at least four keys.
2173Some adapters support more than four keys.
2174If that is the case, then the first four keys
2175(1-4) will be the standard temporary keys and any others will be adaptor
2176specific keys such as permanent keys stored in NVRAM.
2177.Pp
2178Note that you must set a default transmit key with
2179.Cm deftxkey
2180for the system to know which key to use in encrypting outbound traffic.
2181.It Cm wme
2182Enable Wireless Multimedia Extensions (WME) support, if available,
2183for the specified interface.
2184WME is a subset of the IEEE 802.11e standard to support the
2185efficient communication of realtime and multimedia data.
2186To disable WME support, use
2187.Fl wme .
2188Another name for this parameter is
2189.Cm wmm .
2190.Pp
2191The following parameters are meaningful only when WME support is in use.
2192Parameters are specified per-AC (Access Category) and
2193split into those that are used by a station when acting
2194as an access point and those for client stations in the BSS.
2195The latter are received from the access point and may not be changed
2196(at the station).
2197The following Access Categories are recognized:
2198.Pp
2199.Bl -tag -width ".Cm AC_BK" -compact
2200.It Cm AC_BE
2201(or
2202.Cm BE )
2203best effort delivery,
2204.It Cm AC_BK
2205(or
2206.Cm BK )
2207background traffic,
2208.It Cm AC_VI
2209(or
2210.Cm VI )
2211video traffic,
2212.It Cm AC_VO
2213(or
2214.Cm VO )
2215voice traffic.
2216.El
2217.Pp
2218AC parameters are case-insensitive.
2219Traffic classification is done in the operating system using the
2220vlan priority associated with data frames or the
2221ToS (Type of Service) indication in IP-encapsulated frames.
2222If neither information is present, traffic is assigned to the
2223Best Effort (BE) category.
2224.Bl -tag -width indent
2225.It Cm ack Ar ac
2226Set the ACK policy for QoS transmissions by the local station;
2227this controls whether or not data frames transmitted by a station
2228require an ACK response from the receiving station.
2229To disable waiting for an ACK use
2230.Fl ack .
2231This parameter is applied only to the local station.
2232.It Cm acm Ar ac
2233Enable the Admission Control Mandatory (ACM) mechanism
2234for transmissions by the local station.
2235To disable the ACM use
2236.Fl acm .
2237On stations in a BSS this parameter is read-only and indicates
2238the setting received from the access point.
2239NB: ACM is not supported right now.
2240.It Cm aifs Ar ac Ar count
2241Set the Arbitration Inter Frame Spacing (AIFS)
2242channel access parameter to use for transmissions
2243by the local station.
2244On stations in a BSS this parameter is read-only and indicates
2245the setting received from the access point.
2246.It Cm cwmin Ar ac Ar count
2247Set the CWmin channel access parameter to use for transmissions
2248by the local station.
2249On stations in a BSS this parameter is read-only and indicates
2250the setting received from the access point.
2251.It Cm cwmax Ar ac Ar count
2252Set the CWmax channel access parameter to use for transmissions
2253by the local station.
2254On stations in a BSS this parameter is read-only and indicates
2255the setting received from the access point.
2256.It Cm txoplimit Ar ac Ar limit
2257Set the Transmission Opportunity Limit channel access parameter
2258to use for transmissions by the local station.
2259This parameter defines an interval of time when a WME station
2260has the right to initiate transmissions onto the wireless medium.
2261On stations in a BSS this parameter is read-only and indicates
2262the setting received from the access point.
2263.It Cm bss:aifs Ar ac Ar count
2264Set the AIFS channel access parameter to send to stations in a BSS.
2265This parameter is meaningful only when operating in ap mode.
2266.It Cm bss:cwmin Ar ac Ar count
2267Set the CWmin channel access parameter to send to stations in a BSS.
2268This parameter is meaningful only when operating in ap mode.
2269.It Cm bss:cwmax Ar ac Ar count
2270Set the CWmax channel access parameter to send to stations in a BSS.
2271This parameter is meaningful only when operating in ap mode.
2272.It Cm bss:txoplimit Ar ac Ar limit
2273Set the TxOpLimit channel access parameter to send to stations in a BSS.
2274This parameter is meaningful only when operating in ap mode.
2275.El
2276.It Cm wps
2277Enable Wireless Privacy Subscriber support.
2278Note that WPS support requires a WPS-capable supplicant.
2279To disable this function use
2280.Fl wps .
2281.El
2282.Ss MAC-Based Access Control List Parameters
2283The following parameters support an optional access control list
2284feature available with some adapters when operating in ap mode; see
2285.Xr wlan_acl 4 .
2286This facility allows an access point to accept/deny association
2287requests based on the MAC address of the station.
2288Note that this feature does not significantly enhance security
2289as MAC address spoofing is easy to do.
2290.Bl -tag -width indent
2291.It Cm mac:add Ar address
2292Add the specified MAC address to the database.
2293Depending on the policy setting association requests from the
2294specified station will be allowed or denied.
2295.It Cm mac:allow
2296Set the ACL policy to permit association only by
2297stations registered in the database.
2298.It Cm mac:del Ar address
2299Delete the specified MAC address from the database.
2300.It Cm mac:deny
2301Set the ACL policy to deny association only by
2302stations registered in the database.
2303.It Cm mac:kick Ar address
2304Force the specified station to be deauthenticated.
2305This typically is done to block a station after updating the
2306address database.
2307.It Cm mac:open
2308Set the ACL policy to allow all stations to associate.
2309.It Cm mac:flush
2310Delete all entries in the database.
2311.It Cm mac:radius
2312Set the ACL policy to permit association only by
2313stations approved by a RADIUS server.
2314Note that this feature requires the
2315.Xr hostapd 8
2316program be configured to do the right thing
2317as it handles the RADIUS processing
2318(and marks stations as authorized).
2319.El
2320.Ss Mesh Mode Wireless Interface Parameters
2321The following parameters are related to a wireless interface operating in mesh
2322mode:
2323.Bl -tag -width indent
2324.It Cm meshid Ar meshid
2325Set the desired Mesh Identifier.
2326The Mesh ID is a string up to 32 characters in length.
2327A mesh interface must have a Mesh Identifier specified
2328to reach an operational state.
2329.It Cm meshttl Ar ttl
2330Set the desired
2331.Dq time to live
2332for mesh forwarded packets;
2333this is the number of hops a packet may be forwarded before
2334it is discarded.
2335The default setting for
2336.Cm meshttl
2337is 31.
2338.It Cm meshpeering
2339Enable or disable peering with neighbor mesh stations.
2340Stations must peer before any data packets can be exchanged.
2341By default
2342.Cm meshpeering
2343is enabled.
2344.It Cm meshforward
2345Enable or disable forwarding packets by a mesh interface.
2346By default
2347.Cm meshforward
2348is enabled.
2349.It Cm meshgate
2350This attribute specifies whether or not the mesh STA activates mesh gate
2351announcements.
2352By default
2353.Cm meshgate
2354is disabled.
2355.It Cm meshmetric Ar protocol
2356Set the specified
2357.Ar protocol
2358as the link metric protocol used on a mesh network.
2359The default protocol is called
2360.Ar AIRTIME .
2361The mesh interface will restart after changing this setting.
2362.It Cm meshpath Ar protocol
2363Set the specified
2364.Ar protocol
2365as the path selection protocol used on a mesh network.
2366The only available protocol at the moment is called
2367.Ar HWMP
2368(Hybrid Wireless Mesh Protocol).
2369The mesh interface will restart after changing this setting.
2370.It Cm hwmprootmode Ar mode
2371Stations on a mesh network can operate as
2372.Dq root nodes .
2373Root nodes try to find paths to all mesh nodes and advertise themselves
2374regularly.
2375When there is a root mesh node on a network, other mesh nodes can setup
2376paths between themselves faster because they can use the root node
2377to find the destination.
2378This path may not be the best, but on-demand
2379routing will eventually find the best path.
2380The following modes are recognized:
2381.Pp
2382.Bl -tag -width ".Cm PROACTIVE" -compact
2383.It Cm DISABLED
2384Disable root mode.
2385.It Cm NORMAL
2386Send broadcast path requests every two seconds.
2387Nodes on the mesh without a path to this root mesh station with try to
2388discover a path to us.
2389.It Cm PROACTIVE
2390Send broadcast path requests every two seconds and every node must reply
2391with a path reply even if it already has a path to this root mesh station.
2392.It Cm RANN
2393Send broadcast root announcement (RANN) frames.
2394Nodes on the mesh without a path to this root mesh station with try to
2395discover a path to us.
2396.El
2397By default
2398.Cm hwmprootmode
2399is set to
2400.Ar DISABLED .
2401.It Cm hwmpmaxhops Ar cnt
2402Set the maximum number of hops allowed in an HMWP path to
2403.Ar cnt .
2404The default setting for
2405.Cm hwmpmaxhops
2406is 31.
2407.El
2408.Ss Compatibility Parameters
2409The following parameters are for compatibility with other systems:
2410.Bl -tag -width indent
2411.It Cm nwid Ar ssid
2412Another name for the
2413.Cm ssid
2414parameter.
2415Included for
2416.Nx
2417compatibility.
2418.It Cm stationname Ar name
2419Set the name of this station.
2420The station name is not part of the IEEE 802.11
2421protocol though some interfaces support it.
2422As such it only
2423seems to be meaningful to identical or virtually identical equipment.
2424Setting the station name is identical in syntax to setting the SSID.
2425One can also use
2426.Cm station
2427for
2428.Bsx
2429compatibility.
2430.It Cm wep
2431Another way of saying
2432.Cm wepmode on .
2433Included for
2434.Bsx
2435compatibility.
2436.It Fl wep
2437Another way of saying
2438.Cm wepmode off .
2439Included for
2440.Bsx
2441compatibility.
2442.It Cm nwkey key
2443Another way of saying:
2444.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
2445Included for
2446.Nx
2447compatibility.
2448.It Cm nwkey Xo
2449.Sm off
2450.Ar n : k1 , k2 , k3 , k4
2451.Sm on
2452.Xc
2453Another way of saying
2454.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
2455Included for
2456.Nx
2457compatibility.
2458.It Fl nwkey
2459Another way of saying
2460.Cm wepmode off .
2461Included for
2462.Nx
2463compatibility.
2464.El
2465.Ss Bridge Interface Parameters
2466The following parameters are specific to bridge interfaces:
2467.Bl -tag -width indent
2468.It Cm addm Ar interface
2469Add the interface named by
2470.Ar interface
2471as a member of the bridge.
2472The interface is put into promiscuous mode
2473so that it can receive every packet sent on the network.
2474.It Cm deletem Ar interface
2475Remove the interface named by
2476.Ar interface
2477from the bridge.
2478Promiscuous mode is disabled on the interface when
2479it is removed from the bridge.
2480.It Cm maxaddr Ar size
2481Set the size of the bridge address cache to
2482.Ar size .
2483The default is 2000 entries.
2484.It Cm timeout Ar seconds
2485Set the timeout of address cache entries to
2486.Ar seconds
2487seconds.
2488If
2489.Ar seconds
2490is zero, then address cache entries will not be expired.
2491The default is 1200 seconds.
2492.It Cm addr
2493Display the addresses that have been learned by the bridge.
2494.It Cm static Ar interface-name Ar address
2495Add a static entry into the address cache pointing to
2496.Ar interface-name .
2497Static entries are never aged out of the cache or re-placed, even if the
2498address is seen on a different interface.
2499.It Cm deladdr Ar address
2500Delete
2501.Ar address
2502from the address cache.
2503.It Cm flush
2504Delete all dynamically-learned addresses from the address cache.
2505.It Cm flushall
2506Delete all addresses, including static addresses, from the address cache.
2507.It Cm discover Ar interface
2508Mark an interface as a
2509.Dq discovering
2510interface.
2511When the bridge has no address cache entry
2512(either dynamic or static)
2513for the destination address of a packet,
2514the bridge will forward the packet to all
2515member interfaces marked as
2516.Dq discovering .
2517This is the default for all interfaces added to a bridge.
2518.It Cm -discover Ar interface
2519Clear the
2520.Dq discovering
2521attribute on a member interface.
2522For packets without the
2523.Dq discovering
2524attribute, the only packets forwarded on the interface are broadcast
2525or multicast packets and packets for which the destination address
2526is known to be on the interface's segment.
2527.It Cm learn Ar interface
2528Mark an interface as a
2529.Dq learning
2530interface.
2531When a packet arrives on such an interface, the source
2532address of the packet is entered into the address cache as being a
2533destination address on the interface's segment.
2534This is the default for all interfaces added to a bridge.
2535.It Cm -learn Ar interface
2536Clear the
2537.Dq learning
2538attribute on a member interface.
2539.It Cm sticky Ar interface
2540Mark an interface as a
2541.Dq sticky
2542interface.
2543Dynamically learned address entries are treated at static once entered into
2544the cache.
2545Sticky entries are never aged out of the cache or replaced, even if the
2546address is seen on a different interface.
2547.It Cm -sticky Ar interface
2548Clear the
2549.Dq sticky
2550attribute on a member interface.
2551.It Cm private Ar interface
2552Mark an interface as a
2553.Dq private
2554interface.
2555A private interface does not forward any traffic to any other port that is also
2556a private interface.
2557.It Cm -private Ar interface
2558Clear the
2559.Dq private
2560attribute on a member interface.
2561.It Cm span Ar interface
2562Add the interface named by
2563.Ar interface
2564as a span port on the bridge.
2565Span ports transmit a copy of every frame received by the bridge.
2566This is most useful for snooping a bridged network passively on
2567another host connected to one of the span ports of the bridge.
2568.It Cm -span Ar interface
2569Delete the interface named by
2570.Ar interface
2571from the list of span ports of the bridge.
2572.It Cm stp Ar interface
2573Enable Spanning Tree protocol on
2574.Ar interface .
2575The
2576.Xr if_bridge 4
2577driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
2578Spanning Tree is used to detect and remove loops in a network topology.
2579.It Cm -stp Ar interface
2580Disable Spanning Tree protocol on
2581.Ar interface .
2582This is the default for all interfaces added to a bridge.
2583.It Cm edge Ar interface
2584Set
2585.Ar interface
2586as an edge port.
2587An edge port connects directly to end stations cannot create bridging
2588loops in the network, this allows it to transition straight to forwarding.
2589.It Cm -edge Ar interface
2590Disable edge status on
2591.Ar interface .
2592.It Cm autoedge Ar interface
2593Allow
2594.Ar interface
2595to automatically detect edge status.
2596This is the default for all interfaces added to a bridge.
2597.It Cm -autoedge Ar interface
2598Disable automatic edge status on
2599.Ar interface .
2600.It Cm ptp Ar interface
2601Set the
2602.Ar interface
2603as a point to point link.
2604This is required for straight transitions to forwarding and
2605should be enabled on a direct link to another RSTP capable switch.
2606.It Cm -ptp Ar interface
2607Disable point to point link status on
2608.Ar interface .
2609This should be disabled for a half duplex link and for an interface
2610connected to a shared network segment,
2611like a hub or a wireless network.
2612.It Cm autoptp Ar interface
2613Automatically detect the point to point status on
2614.Ar interface
2615by checking the full duplex link status.
2616This is the default for interfaces added to the bridge.
2617.It Cm -autoptp Ar interface
2618Disable automatic point to point link detection on
2619.Ar interface .
2620.It Cm maxage Ar seconds
2621Set the time that a Spanning Tree protocol configuration is valid.
2622The default is 20 seconds.
2623The minimum is 6 seconds and the maximum is 40 seconds.
2624.It Cm fwddelay Ar seconds
2625Set the time that must pass before an interface begins forwarding
2626packets when Spanning Tree is enabled.
2627The default is 15 seconds.
2628The minimum is 4 seconds and the maximum is 30 seconds.
2629.It Cm hellotime Ar seconds
2630Set the time between broadcasting of Spanning Tree protocol
2631configuration messages.
2632The hello time may only be changed when operating in legacy stp mode.
2633The default is 2 seconds.
2634The minimum is 1 second and the maximum is 2 seconds.
2635.It Cm priority Ar value
2636Set the bridge priority for Spanning Tree.
2637The default is 32768.
2638The minimum is 0 and the maximum is 61440.
2639.It Cm proto Ar value
2640Set the Spanning Tree protocol.
2641The default is rstp.
2642The available options are stp and rstp.
2643.It Cm holdcnt Ar value
2644Set the transmit hold count for Spanning Tree.
2645This is the number of packets transmitted before being rate limited.
2646The default is 6.
2647The minimum is 1 and the maximum is 10.
2648.It Cm ifpriority Ar interface Ar value
2649Set the Spanning Tree priority of
2650.Ar interface
2651to
2652.Ar value .
2653The default is 128.
2654The minimum is 0 and the maximum is 240.
2655.It Cm ifpathcost Ar interface Ar value
2656Set the Spanning Tree path cost of
2657.Ar interface
2658to
2659.Ar value .
2660The default is calculated from the link speed.
2661To change a previously selected path cost back to automatic, set the
2662cost to 0.
2663The minimum is 1 and the maximum is 200000000.
2664.It Cm ifmaxaddr Ar interface Ar size
2665Set the maximum number of hosts allowed from an interface, packets with unknown
2666source addresses are dropped until an existing host cache entry expires or is
2667removed.
2668Set to 0 to disable.
2669.El
2670.Ss Link Aggregation and Link Failover Parameters
2671The following parameters are specific to lagg interfaces:
2672.Bl -tag -width indent
2673.It Cm laggtype Ar type
2674When creating a lagg interface the type can be specified as either
2675.Cm ethernet
2676or
2677.Cm infiniband .
2678If not specified ethernet is the default lagg type.
2679.It Cm laggport Ar interface
2680Add the interface named by
2681.Ar interface
2682as a port of the aggregation interface.
2683.It Cm -laggport Ar interface
2684Remove the interface named by
2685.Ar interface
2686from the aggregation interface.
2687.It Cm laggproto Ar proto
2688Set the aggregation protocol.
2689The default is
2690.Li failover .
2691The available options are
2692.Li failover ,
2693.Li lacp ,
2694.Li loadbalance ,
2695.Li roundrobin ,
2696.Li broadcast
2697and
2698.Li none .
2699.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
2700Set the packet layers to hash for aggregation protocols which load balance.
2701The default is
2702.Dq l2,l3,l4 .
2703The options can be combined using commas.
2704.Pp
2705.Bl -tag -width ".Cm l2" -compact
2706.It Cm l2
2707src/dst mac address and optional vlan number.
2708.It Cm l3
2709src/dst address for IPv4 or IPv6.
2710.It Cm l4
2711src/dst port for TCP/UDP/SCTP.
2712.El
2713.It Cm -use_flowid
2714Enable local hash computation for RSS hash on the interface.
2715The
2716.Li loadbalance
2717and
2718.Li lacp
2719modes will use the RSS hash from the network card if available
2720to avoid computing one, this may give poor traffic distribution
2721if the hash is invalid or uses less of the protocol header information.
2722.Cm -use_flowid
2723disables use of RSS hash from the network card.
2724The default value can be set via the
2725.Va net.link.lagg.default_use_flowid
2726.Xr sysctl 8
2727variable.
2728.Li 0
2729means
2730.Dq disabled
2731and
2732.Li 1
2733means
2734.Dq enabled .
2735.It Cm use_flowid
2736Use the RSS hash from the network card if available.
2737.It Cm flowid_shift Ar number
2738Set a shift parameter for RSS local hash computation.
2739Hash is calculated by using flowid bits in a packet header mbuf
2740which are shifted by the number of this parameter.
2741.It Cm use_numa
2742Enable selection of egress ports based on the native
2743.Xr numa 4
2744domain for the packets being transmitted.
2745This is currently only implemented for lacp mode.
2746This works only on
2747.Xr numa 4
2748hardware, running a kernel compiled with the
2749.Xr numa 4
2750option, and when interfaces from multiple
2751.Xr numa 4
2752domains are ports of the aggregation interface.
2753.It Cm -use_numa
2754Disable selection of egress ports based on the native
2755.Xr numa 4
2756domain for the packets being transmitted.
2757.It Cm lacp_fast_timeout
2758Enable lacp fast-timeout on the interface.
2759.It Cm -lacp_fast_timeout
2760Disable lacp fast-timeout on the interface.
2761.It Cm lacp_strict
2762Enable lacp strict compliance on the interface.
2763The default value can be set via the
2764.Va net.link.lagg.lacp.default_strict_mode
2765.Xr sysctl 8
2766variable.
2767.Li 0
2768means
2769.Dq disabled
2770and
2771.Li 1
2772means
2773.Dq enabled .
2774.It Cm -lacp_strict
2775Disable lacp strict compliance on the interface.
2776.It Cm rr_limit Ar number
2777Configure a stride for an interface in round-robin mode.
2778The default stride is 1.
2779.El
2780.Ss Generic IP Tunnel Parameters
2781The following parameters apply to IP tunnel interfaces,
2782.Xr gif 4 :
2783.Bl -tag -width indent
2784.It Cm tunnel Ar src_addr dest_addr
2785Configure the physical source and destination address for IP tunnel
2786interfaces.
2787The arguments
2788.Ar src_addr
2789and
2790.Ar dest_addr
2791are interpreted as the outer source/destination for the encapsulating
2792IPv4/IPv6 header.
2793.It Fl tunnel
2794Unconfigure the physical source and destination address for IP tunnel
2795interfaces previously configured with
2796.Cm tunnel .
2797.It Cm deletetunnel
2798Another name for the
2799.Fl tunnel
2800parameter.
2801.It Cm accept_rev_ethip_ver
2802Set a flag to accept both correct EtherIP packets and ones
2803with reversed version field.
2804Enabled by default.
2805This is for backward compatibility with
2806.Fx 6.1 ,
28076.2, 6.3, 7.0, and 7.1.
2808.It Cm -accept_rev_ethip_ver
2809Clear a flag
2810.Cm accept_rev_ethip_ver .
2811.It Cm ignore_source
2812Set a flag to accept encapsulated packets destined to this host
2813independently from source address.
2814This may be useful for hosts, that receive encapsulated packets
2815from the load balancers.
2816.It Cm -ignore_source
2817Clear a flag
2818.Cm ignore_source .
2819.It Cm send_rev_ethip_ver
2820Set a flag to send EtherIP packets with reversed version
2821field intentionally.
2822Disabled by default.
2823This is for backward compatibility with
2824.Fx 6.1 ,
28256.2, 6.3, 7.0, and 7.1.
2826.It Cm -send_rev_ethip_ver
2827Clear a flag
2828.Cm send_rev_ethip_ver .
2829.El
2830.Ss GRE Tunnel Parameters
2831The following parameters apply to GRE tunnel interfaces,
2832.Xr gre 4 :
2833.Bl -tag -width indent
2834.It Cm tunnel Ar src_addr dest_addr
2835Configure the physical source and destination address for GRE tunnel
2836interfaces.
2837The arguments
2838.Ar src_addr
2839and
2840.Ar dest_addr
2841are interpreted as the outer source/destination for the encapsulating
2842IPv4/IPv6 header.
2843.It Fl tunnel
2844Unconfigure the physical source and destination address for GRE tunnel
2845interfaces previously configured with
2846.Cm tunnel .
2847.It Cm deletetunnel
2848Another name for the
2849.Fl tunnel
2850parameter.
2851.It Cm grekey Ar key
2852Configure the GRE key to be used for outgoing packets.
2853Note that
2854.Xr gre 4 will always accept GRE packets with invalid or absent keys.
2855This command will result in a four byte MTU reduction on the interface.
2856.El
2857.Ss Packet Filter State Table Sychronisation Parameters
2858The following parameters are specific to
2859.Xr pfsync 4
2860interfaces:
2861.Bl -tag -width indent
2862.It Cm syncdev Ar iface
2863Use the specified interface
2864to send and receive pfsync state synchronisation messages.
2865.It Fl syncdev
2866Stop sending pfsync state synchronisation messages over the network.
2867.It Cm syncpeer Ar peer_address
2868Make the pfsync link point-to-point rather than using
2869multicast to broadcast the state synchronisation messages.
2870The peer_address is the IP address of the other host taking part in
2871the pfsync cluster.
2872.It Fl syncpeer
2873Broadcast the packets using multicast.
2874.It Cm maxupd Ar n
2875Set the maximum number of updates for a single state which
2876can be collapsed into one.
2877This is an 8-bit number; the default value is 128.
2878.It Cm defer
2879Defer transmission of the first packet in a state until a peer has
2880acknowledged that the associated state has been inserted.
2881.It Fl defer
2882Do not defer the first packet in a state.
2883This is the default.
2884.El
2885.Ss VLAN Parameters
2886The following parameters are specific to
2887.Xr vlan 4
2888interfaces:
2889.Bl -tag -width indent
2890.It Cm vlan Ar vlan_tag
2891Set the VLAN tag value to
2892.Ar vlan_tag .
2893This value is a 12-bit VLAN Identifier (VID) which is used to create an 802.1Q
2894or 802.1ad VLAN header for packets sent from the
2895.Xr vlan 4
2896interface.
2897Note that
2898.Cm vlan
2899and
2900.Cm vlandev
2901must both be set at the same time.
2902.It Cm vlanproto Ar vlan_proto
2903Set the VLAN encapsulation protocol to
2904.Ar vlan_proto .
2905Supported encapsulation protocols are currently:
2906.Bl -tag
2907.It Cm 802.1Q
2908Default.
2909.It Cm 802.1ad
2910.It Cm QinQ
2911Same as
2912.Cm 802.1ad .
2913.El
2914.It Cm vlanpcp Ar priority_code_point
2915Priority code point
2916.Pq Dv PCP
2917is an 3-bit field which refers to the IEEE 802.1p
2918class of service and maps to the frame priority level.
2919.Pp
2920Values in order of priority are:
2921.Cm 1
2922.Pq Dv Background (lowest) ,
2923.Cm 0
2924.Pq Dv Best effort (default) ,
2925.Cm 2
2926.Pq Dv Excellent effort ,
2927.Cm 3
2928.Pq Dv Critical applications ,
2929.Cm 4
2930.Pq Dv Video, < 100ms latency and jitter ,
2931.Cm 5
2932.Pq Dv Voice, < 10ms latency and jitter ,
2933.Cm 6
2934.Pq Dv Internetwork control ,
2935.Cm 7
2936.Pq Dv Network control (highest) .
2937.It Cm vlandev Ar iface
2938Associate the physical interface
2939.Ar iface
2940with a
2941.Xr vlan 4
2942interface.
2943Packets transmitted through the
2944.Xr vlan 4
2945interface will be
2946diverted to the specified physical interface
2947.Ar iface
2948with 802.1Q VLAN encapsulation.
2949Packets with 802.1Q encapsulation received
2950by the parent interface with the correct VLAN Identifier will be diverted to
2951the associated
2952.Xr vlan 4
2953pseudo-interface.
2954The
2955.Xr vlan 4
2956interface is assigned a
2957copy of the parent interface's flags and the parent's Ethernet address.
2958The
2959.Cm vlandev
2960and
2961.Cm vlan
2962must both be set at the same time.
2963If the
2964.Xr vlan 4
2965interface already has
2966a physical interface associated with it, this command will fail.
2967To
2968change the association to another physical interface, the existing
2969association must be cleared first.
2970.Pp
2971Note: if the hardware tagging capability
2972is set on the parent interface, the
2973.Xr vlan 4
2974pseudo
2975interface's behavior changes:
2976the
2977.Xr vlan 4
2978interface recognizes that the
2979parent interface supports insertion and extraction of VLAN tags on its
2980own (usually in firmware) and that it should pass packets to and from
2981the parent unaltered.
2982.It Fl vlandev Op Ar iface
2983If the driver is a
2984.Xr vlan 4
2985pseudo device, disassociate the parent interface from it.
2986This breaks the link between the
2987.Xr vlan 4
2988interface and its parent,
2989clears its VLAN Identifier, flags and its link address and shuts the interface
2990down.
2991The
2992.Ar iface
2993argument is useless and hence deprecated.
2994.El
2995.Ss Virtual eXtensible LAN Parameters
2996The following parameters are used to configure
2997.Xr vxlan 4
2998interfaces.
2999.Bl -tag -width indent
3000.It Cm vxlanid Ar identifier
3001This value is a 24-bit VXLAN Network Identifier (VNI) that identifies the
3002virtual network segment membership of the interface.
3003.It Cm vxlanlocal Ar address
3004The source address used in the encapsulating IPv4/IPv6 header.
3005The address should already be assigned to an existing interface.
3006When the interface is configured in unicast mode, the listening socket
3007is bound to this address.
3008.It Cm vxlanremote Ar address
3009The interface can be configured in a unicast, or point-to-point, mode
3010to create a tunnel between two hosts.
3011This is the IP address of the remote end of the tunnel.
3012.It Cm vxlangroup Ar address
3013The interface can be configured in a multicast mode
3014to create a virtual network of hosts.
3015This is the IP multicast group address the interface will join.
3016.It Cm vxlanlocalport Ar port
3017The port number the interface will listen on.
3018The default port number is 4789.
3019.It Cm vxlanremoteport Ar port
3020The destination port number used in the encapsulating IPv4/IPv6 header.
3021The remote host should be listening on this port.
3022The default port number is 4789.
3023Note some other implementations, such as Linux,
3024do not default to the IANA assigned port,
3025but instead listen on port 8472.
3026.It Cm vxlanportrange Ar low high
3027The range of source ports used in the encapsulating IPv4/IPv6 header.
3028The port selected within the range is based on a hash of the inner frame.
3029A range is useful to provide entropy within the outer IP header
3030for more effective load balancing.
3031The default range is between the
3032.Xr sysctl 8
3033variables
3034.Va net.inet.ip.portrange.first
3035and
3036.Va net.inet.ip.portrange.last
3037.It Cm vxlantimeout Ar timeout
3038The maximum time, in seconds, before an entry in the forwarding table
3039is pruned.
3040The default is 1200 seconds (20 minutes).
3041.It Cm vxlanmaxaddr Ar max
3042The maximum number of entries in the forwarding table.
3043The default is 2000.
3044.It Cm vxlandev Ar dev
3045When the interface is configured in multicast mode, the
3046.Cm dev
3047interface is used to transmit IP multicast packets.
3048.It Cm vxlanttl Ar ttl
3049The TTL used in the encapsulating IPv4/IPv6 header.
3050The default is 64.
3051.It Cm vxlanlearn
3052The source IP address and inner source Ethernet MAC address of
3053received packets are used to dynamically populate the forwarding table.
3054When in multicast mode, an entry in the forwarding table allows the
3055interface to send the frame directly to the remote host instead of
3056broadcasting the frame to the multicast group.
3057This is the default.
3058.It Fl vxlanlearn
3059The forwarding table is not populated by received packets.
3060.It Cm vxlanflush
3061Delete all dynamically-learned addresses from the forwarding table.
3062.It Cm vxlanflushall
3063Delete all addresses, including static addresses, from the forwarding table.
3064.El
3065.Ss CARP Parameters
3066The following parameters are used to configure
3067.Xr carp 4
3068protocol on an interface:
3069.Bl -tag -width indent
3070.It Cm vhid Ar n
3071Set the virtual host ID.
3072This is a required setting to initiate
3073.Xr carp 4 .
3074If the virtual host ID does not exist yet, it is created and attached to the
3075interface, otherwise configuration of an existing vhid is adjusted.
3076If the
3077.Cm vhid
3078keyword is supplied along with an
3079.Dq inet6
3080or
3081.Dq inet
3082address, then this address is configured to be run under control of the
3083specified vhid.
3084Whenever a last address that refers to a particular vhid is removed from an
3085interface, the vhid is automatically removed from interface and destroyed.
3086Any other configuration parameters for the
3087.Xr carp 4
3088protocol should be supplied along with the
3089.Cm vhid
3090keyword.
3091Acceptable values for vhid are 1 to 255.
3092.It Cm advbase Ar seconds
3093Specifies the base of the advertisement interval in seconds.
3094The acceptable values are 1 to 255.
3095The default value is 1.
3096.It Cm advskew Ar interval
3097Specifies the skew to add to the base advertisement interval to
3098make one host advertise slower than another host.
3099It is specified in 1/256 of seconds.
3100The acceptable values are 1 to 254.
3101The default value is 0.
3102.It Cm pass Ar phrase
3103Set the authentication key to
3104.Ar phrase .
3105.It Cm state Ar state
3106Forcibly change state of a given vhid.
3107The following states are recognized:
3108.Cm MASTER
3109and
3110.Cm BACKUP .
3111.It Cm peer Ar address
3112Set the address to send (IPv4)
3113.Xr carp 4
3114announcements to.
3115.It Cm mcast
3116Restore the default destination address for (IPv4)
3117.Xr carp 4
3118announcements, which is 224.0.0.18.
3119.It Cm peer6 Ar address
3120Set the address to send (IPv6)
3121.Xr carp 4
3122announcements to.
3123.It Cm mcast6
3124Restore the default destination address for (IPv4)
3125.Xr carp 4
3126announcements, which is ff02::12.
3127.El
3128.Sh ENVIRONMENT
3129The following environment variables affect the execution of
3130.Nm :
3131.Bl -tag -width IFCONFIG_FORMAT
3132.It Ev IFCONFIG_FORMAT
3133This variable can contain a specification of the output format.
3134See the description of the
3135.Fl f
3136flag for more details.
3137.El
3138.Sh EXAMPLES
3139Assign the IPv4 address
3140.Li 192.0.2.10 ,
3141with a network mask of
3142.Li 255.255.255.0 ,
3143to the interface
3144.Li em0 :
3145.Dl # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0
3146.Pp
3147Add the IPv4 address
3148.Li 192.0.2.45 ,
3149with the CIDR network prefix
3150.Li /28 ,
3151to the interface
3152.Li em0 :
3153.Dl # ifconfig em0 inet 192.0.2.45/28 alias
3154.Pp
3155Remove the IPv4 address
3156.Li 192.0.2.45
3157from the interface
3158.Li em0 :
3159.Dl # ifconfig em0 inet 192.0.2.45 -alias
3160.Pp
3161Enable IPv6 functionality of the interface:
3162.Dl # ifconfig em0 inet6 -ifdisabled
3163.Pp
3164Add the IPv6 address
3165.Li 2001:DB8:DBDB::123/48
3166to the interface
3167.Li em0 :
3168.Dl # ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
3169Note that lower case hexadecimal IPv6 addresses are acceptable.
3170.Pp
3171Remove the IPv6 address added in the above example,
3172using the
3173.Li /
3174character as shorthand for the network prefix:
3175.Dl # ifconfig em0 inet6 2001:db8:bdbd::123/48 -alias
3176.Pp
3177Configure a single CARP redundant address on igb0, and then switch it
3178to be master:
3179.Bd -literal -offset indent -compact
3180# ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar up
3181# ifconfig igb0 vhid 1 state master
3182.Ed
3183.Pp
3184Configure the interface
3185.Li xl0 ,
3186to use 100baseTX, full duplex Ethernet media options:
3187.Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
3188.Pp
3189Label the em0 interface as an uplink:
3190.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
3191.Pp
3192Create the software network interface
3193.Li gif1 :
3194.Dl # ifconfig gif1 create
3195.Pp
3196Destroy the software network interface
3197.Li gif1 :
3198.Dl # ifconfig gif1 destroy
3199.Pp
3200Display available wireless networks using
3201.Li wlan0 :
3202.Dl # ifconfig wlan0 list scan
3203.Pp
3204Display inet and inet6 address subnet masks in CIDR notation
3205.Dl # ifconfig -f inet:cidr,inet6:cidr
3206.Pp
3207Display interfaces that are up with the exception of loopback
3208.Dl # ifconfig -a -u -G lo
3209.Pp
3210Display a list of interface names beloning to the wlan group:
3211.Bd -literal -offset indent -compact
3212# ifconfig -g wlan
3213wlan0
3214wlan1
3215.Ed
3216.Pp
3217Display details about the interfaces belonging to the wlan group:
3218.Bd -literal -offset indent -compact
3219# ifconfig -a -g wlan
3220wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
3221        ether 75:4c:61:6b:7a:73
3222        inet6 fe80::4c75:636a:616e:ffd8%wlan0 prefixlen 64 scopeid 0x3
3223        inet6 2001:5761:6e64:6152:6f6d:616e:fea4:ffe2 prefixlen 64 autoconf
3224        inet 192.168.10.5 netmask 0xffffff00 broadcast 192.168.10.255
3225        groups: wlan
3226        ssid "Hotspot" channel 11 (2462 MHz 11g) bssid 12:34:ff:ff:43:21
3227        regdomain ETSI country DE authmode WPA2/802.11i privacy ON
3228        deftxkey UNDEF AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 30 bmiss 10
3229        scanvalid 60 protmode CTS wme roaming MANUAL
3230        parent interface: iwm0
3231        media: IEEE 802.11 Wireless Ethernet DS/2Mbps mode 11g
3232        status: associated
3233        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
3234wlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
3235        ether 00:50:69:6f:74:72
3236        groups: wlan
3237        ssid "" channel 2 (2417 MHz 11g)
3238        regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
3239        scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
3240        roam:rate 5 protmode CTS wme bintval 0
3241        parent interface: rum0
3242        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
3243        status: no carrier
3244        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
3245.Ed
3246.Pp
3247Set a randomly-generated MAC address on tap0:
3248.Dl # ifconfig tap0 ether random
3249.Sh DIAGNOSTICS
3250Messages indicating the specified interface does not exist, the
3251requested address is unknown, or the user is not privileged and
3252tried to alter an interface's configuration.
3253.Sh SEE ALSO
3254.Xr netstat 1 ,
3255.Xr carp 4 ,
3256.Xr gif 4 ,
3257.Xr netintro 4 ,
3258.Xr pfsync 4 ,
3259.Xr polling 4 ,
3260.Xr vlan 4 ,
3261.Xr vxlan 4 ,
3262.Xr devd.conf 5 ,
3263.Xr devd 8 ,
3264.Xr jail 8 ,
3265.Xr rc 8 ,
3266.Xr routed 8 ,
3267.Xr sysctl 8
3268.Sh HISTORY
3269The
3270.Nm
3271utility appeared in
3272.Bx 4.2 .
3273.Sh BUGS
3274Basic IPv6 node operation requires a link-local address on each
3275interface configured for IPv6.
3276Normally, such an address is automatically configured by the
3277kernel on each interface added to the system or enabled; this behavior may
3278be disabled by setting per-interface flag
3279.Cm -auto_linklocal .
3280The default value of this flag is 1 and can be disabled by using the sysctl
3281MIB variable
3282.Va net.inet6.ip6.auto_linklocal .
3283.Pp
3284Do not configure IPv6 addresses with no link-local address by using
3285.Nm .
3286It can result in unexpected behaviors of the kernel.
3287