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