xref: /dragonfly/sbin/ifconfig/ifconfig.8 (revision 2038fb68)
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.\" 4. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
29.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.124 2006/10/10 09:44:08 ru Exp $
30.\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.25 2008/11/14 12:52:04 sephe Exp $
31
32.\"
33.Dd September 30, 2007
34.Dt IFCONFIG 8
35.Os
36.Sh NAME
37.Nm ifconfig
38.Nd configure network interface parameters
39.Sh SYNOPSIS
40.Nm
41.Op Fl L
42.Op Fl k
43.Op Fl m
44.Ar interface
45.Op Cm create
46.Op Ar address_family
47.Oo
48.Ar address
49.Op Ar dest_address
50.Oc
51.Op Ar parameters
52.Nm
53.Ar interface
54.Cm destroy
55.Nm
56.Fl a
57.Op Fl L
58.Op Fl d
59.Op Fl m
60.Op Fl u
61.Op Fl v
62.Op Ar address_family
63.Nm
64.Fl l
65.Op Fl d
66.Op Fl u
67.Op Ar address_family
68.Nm
69.Op Fl L
70.Op Fl d
71.Op Fl k
72.Op Fl m
73.Op Fl u
74.Op Fl v
75.Op Fl C
76.Sh DESCRIPTION
77The
78.Nm
79utility is used to assign an address
80to a network interface and/or configure
81network interface parameters.
82The
83.Nm
84utility must be used at boot time to define the network address
85of each interface present on a machine; it may also be used at
86a later time to redefine an interface's address
87or other operating parameters.
88.Pp
89The following options are available:
90.Bl -tag -width indent
91.It Ar address
92For the
93.Tn DARPA Ns -Internet
94family,
95the address is either a host name present in the host name data
96base,
97.Xr hosts 5 ,
98or a
99.Tn DARPA
100Internet address expressed in the Internet standard
101.Dq dot notation .
102.Pp
103It is also possible to use the CIDR notation (also known as the
104slash notation) to include the netmask.
105That is, one can specify an address like
106.Li 192.168.0.1/16 .
107.Pp
108For
109.Dq inet6
110family, it is also possible to specify the prefix length using the slash
111notation, like
112.Li ::1/128 .
113See the
114.Cm prefixlen
115parameter below for more information.
116.\" For the Xerox Network Systems(tm) family,
117.\" addresses are
118.\" .Ar net:a.b.c.d.e.f ,
119.\" where
120.\" .Ar net
121.\" is the assigned network number (in decimal),
122.\" and each of the six bytes of the host number,
123.\" .Ar a
124.\" through
125.\" .Ar f ,
126.\" are specified in hexadecimal.
127.\" The host number may be omitted on IEEE 802 protocol
128.\" (Ethernet, FDDI, and Token Ring) interfaces,
129.\" which use the hardware physical address,
130.\" and on interfaces other than the first.
131.\" For the
132.\" .Tn ISO
133.\" family, addresses are specified as a long hexadecimal string,
134.\" as in the Xerox family.
135.\" However, two consecutive dots imply a zero
136.\" byte, and the dots are optional, if the user wishes to (carefully)
137.\" count out long strings of digits in network byte order.
138.Pp
139The link-level
140.Pq Dq link
141address
142is specified as a series of colon-separated hex digits.
143This can be used to
144e.g.\& set a new MAC address on an ethernet interface, though the
145mechanism used is not ethernet-specific.
146If the interface is already
147up when this option is used, it will be briefly brought down and
148then brought back up again in order to ensure that the receive
149filter in the underlying ethernet hardware is properly reprogrammed.
150.It Ar address_family
151Specify the
152address family
153which affects interpretation of the remaining parameters.
154Since an interface can receive transmissions in differing protocols
155with different naming schemes, specifying the address family is recommended.
156The address or protocol families currently
157supported are
158.Dq inet ,
159.Dq inet6 ,
160.Dq atalk ,
161.Dq ipx ,
162.\" .Dq iso ,
163and
164.Dq link .
165.\" and
166.\" .Dq ns .
167The default is
168.Dq inet .
169.Dq ether
170and
171.Dq lladdr
172are synonyms for
173.Dq link .
174.It Ar dest_address
175Specify the address of the correspondent on the other end
176of a point to point link.
177.It Ar interface
178This
179parameter is a string of the form
180.Dq name unit ,
181for example,
182.Dq Li ed0 .
183.El
184.Pp
185The following parameters may be set with
186.Nm :
187.Bl -tag -width indent
188.It Cm add
189Another name for the
190.Cm alias
191parameter.
192Introduced for compatibility
193with
194.Bsx .
195.It Cm alias
196Establish an additional network address for this interface.
197This is sometimes useful when changing network numbers, and
198one wishes to accept packets addressed to the old interface.
199If the address is on the same subnet as the first network address
200for this interface, a non-conflicting netmask must be given.
201Usually
202.Li 0xffffffff
203is most appropriate.
204.It Fl alias
205Remove the network address specified.
206This would be used if you incorrectly specified an alias, or it
207was no longer needed.
208If you have incorrectly set an NS address having the side effect
209of specifying the host portion, removing all NS addresses will
210allow you to respecify the host portion.
211.It Cm anycast
212(Inet6 only.)
213Specify that the address configured is an anycast address.
214Based on the current specification,
215only routers may configure anycast addresses.
216Anycast address will not be used as source address of any of outgoing
217IPv6 packets.
218.It Cm arp
219Enable the use of the Address Resolution Protocol
220.Pq Xr arp 4
221in mapping
222between network level addresses and link level addresses (default).
223This is currently implemented for mapping between
224.Tn DARPA
225Internet
226addresses and
227.Tn IEEE
228802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
229.It Fl arp
230Disable the use of the Address Resolution Protocol
231.Pq Xr arp 4 .
232.It Cm staticarp
233If the Address Resolution Protocol is enabled,
234the host will only reply to requests for its addresses,
235and will never send any requests.
236.It Fl staticarp
237If the Address Resolution Protocol is enabled,
238the host will perform normally,
239sending out requests and listening for replies.
240.It Cm broadcast
241(Inet only.)
242Specify the address to use to represent broadcasts to the
243network.
244The default broadcast address is the address with a host part of all 1's.
245.It Cm debug
246Enable driver dependent debugging code; usually, this turns on
247extra console error logging.
248.It Fl debug
249Disable driver dependent debugging code.
250.It Cm promisc
251Put interface into permanently promiscuous mode.
252.It Fl promisc
253Disable permanently promiscuous mode.
254.It Cm delete
255Another name for the
256.Fl alias
257parameter.
258.It Cm down
259Mark an interface
260.Dq down .
261When an interface is marked
262.Dq down ,
263the system will not attempt to
264transmit messages through that interface.
265If possible, the interface will be reset to disable reception as well.
266This action does not automatically disable routes using the interface.
267.It Cm eui64
268(Inet6 only.)
269Fill interface index
270(lowermost 64bit of an IPv6 address)
271automatically.
272.It Cm ipdst
273This is used to specify an Internet host who is willing to receive
274IP packets encapsulating IPX packets bound for a remote network.
275An apparent point to point link is constructed, and
276the address specified will be taken as the IPX address and network
277of the destination.
278.It Cm media Ar type
279If the driver supports the media selection system, set the media type
280of the interface to
281.Ar type .
282Some interfaces support the mutually exclusive use of one of several
283different physical media connectors.
284For example, a 10Mbit/s Ethernet
285interface might support the use of either
286.Tn AUI
287or twisted pair connectors.
288Setting the media type to
289.Cm 10base5/AUI
290would change the currently active connector to the AUI port.
291Setting it to
292.Cm 10baseT/UTP
293would activate twisted pair.
294Refer to the interfaces' driver
295specific documentation or man page for a complete list of the
296available types.
297.It Cm mediaopt Ar opts
298If the driver supports the media selection system, set the specified
299media options on the interface.
300The
301.Ar opts
302argument
303is a comma delimited list of options to apply to the interface.
304Refer to the interfaces' driver specific man page for a complete
305list of available options.
306.It Fl mediaopt Ar opts
307If the driver supports the media selection system, disable the
308specified media options on the interface.
309.It Cm mode Ar mode
310If the driver supports the media selection system, set the specified
311operating mode on the interface to
312.Ar mode .
313For IEEE 802.11 wireless interfaces that support multiple operating modes
314this directive is used to select between 802.11a
315.Pq Cm 11a ,
316802.11b
317.Pq Cm 11b ,
318and 802.11g
319.Pq Cm 11g
320operating modes.
321.It Cm name Ar name
322Set the interface name to
323.Ar name .
324.It Cm rss
325If the driver supports receive side scaling,
326enable receive side scaling on the interface.
327.It Fl rss
328If the driver supports receive side scaling,
329disable receive side scaling on the interface.
330.It Cm rxcsum , txcsum
331If the driver supports user-configurable checksum offloading,
332enable receive (or transmit) checksum offloading on the interface.
333Some drivers may not be able to enable these flags independently
334of each other, so setting one may also set the other.
335The driver will offload as much checksum work as it can reliably
336support, the exact level of offloading varies between drivers.
337.It Fl rxcsum , txcsum
338If the driver supports user-configurable checksum offloading,
339disable receive (or transmit) checksum offloading on the interface.
340These settings may not always be independent of each other.
341.It Cm vlanmtu , vlanhwtag
342If the driver offers user-configurable VLAN support, enable
343reception of extended frames or tag processing in hardware,
344respectively.
345Note that this must be issued on a physical interface associated with
346.Xr vlan 4 ,
347not on a
348.Xr vlan 4
349interface itself.
350.It Fl vlanmtu , vlanhwtag
351If the driver offers user-configurable VLAN support, disable
352reception of extended frames or tag processing in hardware,
353respectively.
354.It Cm pollcpu Ar cpu
355Turn on
356.Xr polling 4
357feature and disable interrupts on the interface,
358if the driver supports this mode and
359.Ar cpu
360supports
361.Xr polling 4 .
362Driver will be polled by
363.Ar cpu .
364.It Cm polling
365Turn on
366.Xr polling 4
367feature and disable interrupts on the interface, if the driver supports
368this mode.
369.It Fl polling
370Turn off
371.Xr polling 4
372feature and enable interrupt mode on the interface.
373.It Cm create
374Create the specified network pseudo-device.
375If the interface is given without a unit number, try to create a new
376device with an arbitrary unit number.
377If creation of an arbitrary device is successful, the new device name is
378printed to standard output unless the interface is renamed or destroyed
379in the same
380.Nm
381invocation.
382.It Cm destroy
383Destroy the specified network pseudo-device.
384.It Cm plumb
385Another name for the
386.Cm create
387parameter.
388Included for
389.Tn Solaris
390compatibility.
391.It Cm unplumb
392Another name for the
393.Cm destroy
394parameter.
395Included for
396.Tn Solaris
397compatibility.
398.It Cm metric Ar n
399Set the routing metric of the interface to
400.Ar n ,
401default 0.
402The routing metric is used by the routing protocol
403.Pq Xr routed 8 .
404Higher metrics have the effect of making a route
405less favorable; metrics are counted as additional hops
406to the destination network or host.
407.It Cm mtu Ar n
408Set the maximum transmission unit of the interface to
409.Ar n ,
410default is interface specific.
411The MTU is used to limit the size of packets that are transmitted on an
412interface.
413Not all interfaces support setting the MTU, and some interfaces have
414range restrictions.
415.It Cm netmask Ar mask
416.\" (Inet and ISO.)
417(Inet only.)
418Specify how much of the address to reserve for subdividing
419networks into sub-networks.
420The mask includes the network part of the local address
421and the subnet part, which is taken from the host field of the address.
422The mask can be specified as a single hexadecimal number
423with a leading
424.Ql 0x ,
425with a dot-notation Internet address,
426or with a pseudo-network name listed in the network table
427.Xr networks 5 .
428The mask contains 1's for the bit positions in the 32-bit address
429which are to be used for the network and subnet parts,
430and 0's for the host part.
431The mask should contain at least the standard network portion,
432and the subnet field should be contiguous with the network
433portion.
434.Pp
435The netmask can also be specified in CIDR notation after the address.
436See the
437.Ar address
438option above for more information.
439.It Cm autoconf
440(Inet6 only.)
441Enable autoconfiguration.
442.It Fl autoconf
443Disable autoconfiguration.
444.It Cm pltime Ar n
445(Inet6 only.)
446Set preferred lifetime for the address.
447.It Cm vltime Ar n
448(Inet6 only.)
449Set valid lifetime for the address.
450.It Cm prefixlen Ar len
451(Inet6 only.)
452Specify that
453.Ar len
454bits are reserved for subdividing networks into sub-networks.
455The
456.Ar len
457must be integer, and for syntactical reason it must be between 0 to 128.
458It is almost always 64 under the current IPv6 assignment rule.
459If the parameter is omitted, 64 is used.
460.Pp
461The prefix can also be specified using the slash notation after the address.
462See the
463.Ar address
464option above for more information.
465.It Cm deprecated
466(Inet6 only.)
467Set the IPv6 deprecated address bit.
468.It Fl deprecated
469(Inet6 only.)
470Clear the IPv6 deprecated address bit.
471.It Cm tentative
472(Inet6 only.)
473Set the IPv6 tentative address bit.
474.It Fl tentative
475(Inet6 only.)
476Clear the IPv6 tentative address bit.
477.\" see
478.\" Xr eon 5 .
479.\" .It Cm nsellength Ar n
480.\" .Pf ( Tn ISO
481.\" only)
482.\" This specifies a trailing number of bytes for a received
483.\" .Tn NSAP
484.\" used for local identification, the remaining leading part of which is
485.\" taken to be the
486.\" .Tn NET
487.\" (Network Entity Title).
488.\" The default value is 1, which is conformant to US
489.\" .Tn GOSIP .
490.\" When an ISO address is set in an ifconfig command,
491.\" it is really the
492.\" .Tn NSAP
493.\" which is being specified.
494.\" For example, in
495.\" .Tn US GOSIP ,
496.\" 20 hex digits should be
497.\" specified in the
498.\" .Tn ISO NSAP
499.\" to be assigned to the interface.
500.\" There is some evidence that a number different from 1 may be useful
501.\" for
502.\" .Tn AFI
503.\" 37 type addresses.
504.It Cm range Ar netrange
505Under appletalk, set the interface to respond to a
506.Ar netrange
507of the form
508.Ar startnet Ns - Ns Ar endnet .
509Appletalk uses this scheme instead of
510netmasks though
511.Dx
512implements it internally as a set of netmasks.
513.It Cm remove
514Another name for the
515.Fl alias
516parameter.
517Introduced for compatibility
518with
519.Bsx .
520.It Cm phase
521The argument following this specifies the version (phase) of the
522Appletalk network attached to the interface.
523Values of 1 or 2 are permitted.
524.Sm off
525.It Cm link Op Cm 0 No - Cm 2
526.Sm on
527Enable special processing of the link level of the interface.
528These three options are interface specific in actual effect, however,
529they are in general used to select special modes of operation.
530An example
531of this is to enable SLIP compression, or to select the connector type
532for some Ethernet cards.
533Refer to the man page for the specific driver
534for more information.
535.Sm off
536.It Fl link Op Cm 0 No - Cm 2
537.Sm on
538Disable special processing at the link level with the specified interface.
539.It Cm compress
540Another name for the
541.Cm link0
542parameter.
543.It Cm normal
544Another name for the
545.Fl link0
546parameter.
547.It Cm noicmp
548Another name for the
549.Cm link1
550parameter.
551.It Cm monitor
552Put the interface in monitor mode.
553No packets are transmitted, and received packets are discarded after
554.Xr bpf 4
555processing.
556.It Fl monitor
557Take the interface out of monitor mode.
558.It Cm up
559Mark an interface
560.Dq up .
561This may be used to enable an interface after an
562.Dq Nm Cm down .
563It happens automatically when setting the first address on an interface.
564If the interface was reset when previously marked down,
565the hardware will be re-initialized.
566.El
567.Pp
568The following parameters are specific to IEEE 802.11 wireless interfaces:
569.Bl -tag -width indent
570.It Cm apbridge
571When operating as an access point, pass packets between
572wireless clients directly (default).
573To instead let them pass up through the
574system and be forwarded using some other mechanism, use
575.Fl apbridge .
576Disabling the internal bridging
577is useful when traffic is to be processed with
578packet filtering.
579.It Cm authmode Ar mode
580Set the desired authentication mode in infrastructure mode.
581Not all adaptors support all modes.
582The set of
583valid modes is
584.Cm none , open , shared
585(shared key),
586.Cm 8021x
587(IEEE 802.1x),
588and
589.Cm wpa
590(IEEE WPA/WPA2/802.11i).
591The
592.Cm 8021x
593and
594.Cm wpa
595modes are only useful when using an authentication service
596(a supplicant for client operation or an authenticator when
597operating as an access point).
598Modes are case insensitive.
599.It Cm bintval Ar interval
600Set the interval at which beacon frames are sent when operating in
601ad-hoc or ap mode.
602The
603.Ar interval
604parameter is specified in TU's (1024 usecs).
605By default beacon frames are transmitted every 100 TU's.
606.It Cm bmissthreshold Ar count
607Set the number of consecutive missed beacons at which the station
608will attempt to roam (i.e. search for a new access point).
609The
610.Ar count
611parameter is must be in the range 1 to 255;
612though the upper bound may be reduced according to device capabilities..
613The default threshold is 7 consecutive missed beacons;
614but this may be overridden by the device driver.
615Another name for the
616.Cm bmissthreshold
617parameter is
618.Cm bmiss .
619.It Cm bssid Ar address
620Specify the MAC address of the access point to use when operating
621as a station in a BSS network.
622This overrides any automatic selection done by the system.
623To disable a previously selected access point, supply
624.Cm any , none ,
625or
626.Cm -
627for the address.
628This option is useful when more than one access point uses the same SSID.
629Another name for the
630.Cm bssid
631parameter is
632.Cm ap .
633.It Cm burst
634Enable packet bursting.
635Packet bursting is a transmission technique whereby the wireless
636medium is acquired once to send multiple frames and the interframe
637spacing is reduced.
638This technique can significantly increase throughput by reducing
639transmission overhead.
640Packet bursting is supported by the 802.11e QoS specification
641and some devices that do not support QoS may still be capable.
642By default packet bursting is enabled if a device is capable
643of doing it.
644To disable packet bursting, use
645.Fl burst .
646.It Cm chanlist Ar channels
647Set the desired channels to use when scanning for access
648points, neighbors in an IBSS network, or looking for unoccupied
649channels when operating as an access point.
650The set of channels is specified as a comma-separated list with
651each element in the list representing either a single channel number or a range
652of the form
653.Dq Li a-b .
654Channel numbers must be in the range 1 to 255 and be permissible
655according to the operating characteristics of the device.
656.It Cm channel Ar number
657Set a single desired channel.
658Channels range from 1 to 255, but the exact selection available
659depends on the region your adaptor was manufactured for.
660Setting
661the channel to
662.Li 0 ,
663.Cm any ,
664or
665.Cm -
666will give you the default for your adaptor.
667Some
668adaptors ignore this setting unless you are in ad-hoc mode.
669Alternatively the frequency, in megahertz, may be specified
670instead of the channel number.
671.It Cm deftxkey Ar index
672Set the default key to use for transmission.
673Typically this is only set when using WEP encryption.
674The
675.Cm weptxkey
676is an alias for this request; it is provided for backwards compatibility.
677.It Cm dtimperiod Ar period
678Set the
679DTIM
680period for transmitting buffered multicast data frames when
681operating in ap mode.
682The
683.Ar period
684specifies the number of beacon intervals between DTIM
685and must be in the range 1 to 15.
686By default DTIM is 1 (i.e., DTIM occurs at each beacon).
687.It Cm fragthreshold Ar length
688Set the threshold for which transmitted frames are broken into fragments.
689The
690.Ar length
691argument is the frame size in bytes and must be in the range 256 to 2346.
692Setting
693.Ar length
694to
695.Li 2346 ,
696.Cm any ,
697or
698.Cm -
699disables transmit fragmentation.
700Not all adaptors honor the fragmentation threshold.
701.It Cm hidessid
702When operating as an access point, do not broadcast the SSID
703in beacon frames or respond to probe request frames unless
704they are directed to the ap (i.e., they include the ap's SSID).
705By default, the SSID is included in beacon frames and
706undirected probe request frames are answered.
707To re-enable the broadcast of the SSID etc., use
708.Fl hidessid .
709.It Cm list active
710Display the list of channels available for use taking into account
711any restrictions set with the
712.Cm chanlist
713directive.
714See the description of
715.Cm list chan
716for more information.
717.It Cm list caps
718Display the adaptor's capabilities, including the operating
719modes supported.
720.It Cm list chan
721Display the list of channels available for use.
722Channels are shown with their IEEE channel number, equivalent
723frequency, and usage modes.
724Channels identified as
725.Ql 11g
726are also usable in
727.Ql 11b
728mode.
729Channels identified as
730.Ql 11a Turbo
731may be used only for Atheros' Static Turbo mode
732specified with
733.Cm mediaopt turbo ) .
734Channels marked with a
735.Ql *
736have a regulatory constraint that they be passively scanned.
737This means a station is not permitted to transmit on the channel until
738it identifies the channel is being used for 802.11 communication;
739typically by hearing a beacon frame from an access point operating
740on the channel.
741.Cm list freq
742is another way of requesting this information.
743.It Cm list mac
744Display the current MAC Access Control List state.
745Each address is prefixed with a character that indicates the
746current policy applied to it:
747.Ql +
748indicates the address is allowed access,
749.Ql -
750indicates the address is denied access,
751.Ql *
752indicates the address is present but the current policy open
753(so the ACL is not consulted).
754.It Cm list scan
755Display the access points and/or ad-hoc neighbors
756located in the vicinity.
757The
758.Fl v
759flag may be used to display long SSIDs.
760This information may be updated automatically by the adaptor
761and/or with a
762.Cm scan
763request.
764.Cm list ap
765is another way of requesting this information.
766.It Cm list sta
767When operating as an access point display the stations that are
768currently associated.
769When operating in ad-hoc mode display stations identified as
770neighbors in the IBSS.
771.It Cm list wme
772Display the current parameters to use when operating in WME mode.
773When WME mode is enabled for an adaptor this information will be
774displayed with the regular status; this command is mostly useful
775for examining parameters when WME mode is disabled.
776See the description of the
777.Cm wme
778directive for information on the various parameters.
779.It Cm mcastrate Ar rate
780Set the rate for transmitting multicast/broadcast frames.
781Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mbit/s.
782This rate should be valid for the current operating conditions;
783if an invalid rate is specified drivers are free to chose an
784appropriate rate.
785.It Cm powersave
786Enable powersave operation.
787When operating as a client, the station will conserve power by
788periodically turning off the radio and listening for
789messages from the access point telling it there are packets waiting.
790The station must then retrieve the packets.
791When operating as an access point, the station must honor power
792save operation of associated clients.
793Not all devices support power save operation, either as a client
794or as an access point.
795Use
796.Fl powersave
797to disable powersave operation.
798.It Cm powersavemode Ar mode
799Set powersave mode.
800The set of valid modes is
801.Cm off
802(same as
803.Fl powersave ) ,
804.Cm on
805(same as
806.Cm powersave ) ,
807and
808.Cm cam
809(same as
810.Cm powersave ) .
811.It Cm powersavesleep Ar sleep
812Set the desired max powersave sleep time in TU's (1024 usecs).
813By default the max powersave sleep time is 100 TU's.
814.It Cm protmode Ar technique
815For interfaces operating in 802.11g, use the specified
816.Ar technique
817for protecting OFDM frames in a mixed 11b/11g network.
818The set of valid techniques is
819.Cm off , cts
820(CTS to self),
821and
822.Cm rtscts
823(RTS/CTS).
824Technique names are case insensitive.
825.It Cm pureg
826When operating as an access point in 802.11g mode allow only
82711g-capable stations to associate (11b-only stations are not
828permitted to associate).
829To allow both 11g and 11b-only stations to associate, use
830.Fl pureg .
831.It Cm roaming Ar mode
832When operating as a station, control how the system will
833behave when communication with the current access point
834is broken.
835The
836.Ar mode
837argument may be one of
838.Cm device
839(leave it to the hardware device to decide),
840.Cm auto
841(handle either in the device or the operating system\[em]as appropriate),
842.Cm manual
843(do nothing until explicitly instructed).
844By default, the device is left to handle this if it is
845capable; otherwise, the operating system will automatically
846attempt to reestablish communication.
847Manual mode is mostly useful when an application wants to
848control the selection of an access point.
849.It Cm ratectl Ar algorithm
850Set the TX rate control algorithm.
851The set of valid
852.Ar algorithm
853is
854.Cm onoe
855(Onoe TX rate control algorithm),
856.Cm sample
857(Sample TX rate control algorithm)
858and
859.Cm amrr
860(AMRR TX rate control algorithm).
861.Ar Algorithm
862names are case sensitive.
863.It Cm rtsthreshold Ar length
864Set the threshold for which
865transmitted frames are preceded by transmission of an
866RTS
867control frame.
868The
869.Ar length
870argument
871is the frame size in bytes and must be in the range 1 to 2346.
872Setting
873.Ar length
874to
875.Li 2346 ,
876.Cm any ,
877or
878.Cm -
879disables transmission of RTS frames.
880Not all adaptors support setting the RTS threshold.
881.It Cm ssid Ar ssid
882Set the desired Service Set Identifier (aka network name).
883The SSID is a string up to 32 characters
884in length and may be specified as either a normal string or in
885hexadecimal when preceded by
886.Ql 0x .
887Additionally, the SSID may be cleared by setting it to
888.Ql - .
889.It Cm scan
890Initiate a scan of neighboring stations, wait for it to complete, and
891display all stations found.
892Only the super-user can initiate a scan.
893Depending on the capabilities of the APs, the following
894flags can be included in the output:
895.Bl -tag -width 3n
896.It Li A
897Channel Agility.
898Indicates that the station support channel hopping as described by the
899IEEE 802.11b specification.
900.It Li B
901Packet Binary Convolution Code (PBCC).
902A modulation alternative to the standard OFDM method.
903.It Li C
904Pollreq
905.It Li c
906Pollable
907.It Li D
908Direct Sequence Spread Spectrum - Orthogonal Frequency Division
909Multiplexing (DSSS-OFDM).
910Indicates the the station supports DSSS-OFDM modulation.
911.It Li E
912Extended Service Set (ESS).
913Indicates that the station is part of an infrastructure network
914(in contrast to an IBSS/ad-hoc network).
915.It Li I
916IBSS/ad-hoc network.
917Indicates that the station is part of an ad-hoc network
918(in contrast to an ESS network).
919.It Li P
920Privacy.
921Data confidentiality is required for all data frames
922exchanged within the BSS.
923This means that this BSS requires the station to
924use cryptographic means such as WEP, TKIP or AES-CCMP to
925encrypt/decrypt data frames being exchanged with others.
926.It Li R
927Robust Security Network (RSN).
928Indicates that the station supports the IEEE 802.11i authentication
929and key management protocol.
930.It Li S
931Short Preamble.
932Indicates that the network is using short preambles (defined
933in 802.11b High Rate/DSSS PHY, short preamble utilizes a
93456 bit sync field in contrast to a 128 bit field used in long
935preamble mode).
936.It Li s
937Short slot time.
938Indicates that the network is using a short slot time.
939.El
940.Pp
941The
942.Cm list scan
943request can be used to show recent scan results without
944initiating a new scan.
945.Pp
946The
947.Fl v
948flag may be used to prevent the shortening of long SSIDs.
949.It Cm stationname Ar name
950Set the name of this station.
951It appears that the station name is not really part of the IEEE 802.11
952protocol though all interfaces seem to support it.
953As such it only
954seems to be meaningful to identical or virtually identical equipment.
955Setting the station name is identical in syntax to setting the SSID.
956.It Cm txpower Ar power
957Set the power used to transmit frames.
958The
959.Ar power
960argument
961is a unitless value in the range 0 to 100 that is interpreted
962by drivers to derive a device-specific value.
963Out of range values are truncated.
964Typically only a few discreet power settings are available and
965the driver will use the setting closest to the specified value.
966Not all adaptors support changing the transmit power.
967.It Cm wepmode Ar mode
968Set the desired WEP mode.
969Not all adaptors support all modes.
970The set of valid modes is
971.Cm off , on ,
972and
973.Cm mixed .
974The
975.Cm mixed
976mode explicitly tells the adaptor to allow association with access
977points which allow both encrypted and unencrypted traffic.
978On these adaptors,
979.Cm on
980means that the access point must only allow encrypted connections.
981On other adaptors,
982.Cm on
983is generally another name for
984.Cm mixed .
985Modes are case insensitive.
986.It Cm weptxkey Ar index
987Set the WEP key to be used for transmission.
988This is the same as setting the default transmission key with
989.Cm deftxkey .
990.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
991Set the selected WEP key.
992If an
993.Ar index
994is not given, key 1 is set.
995A WEP key will be either 5 or 13
996characters (40 or 104 bits) depending of the local network and the
997capabilities of the adaptor.
998It may be specified either as a plain
999string or as a string of hexadecimal digits preceded by
1000.Ql 0x .
1001For maximum portability, hex keys are recommended;
1002the mapping of text keys to WEP encryption is usually driver-specific.
1003In particular, the
1004.Tn Windows
1005drivers do this mapping differently to
1006.Dx .
1007A key may be cleared by setting it to
1008.Ql - .
1009If WEP is supported then there are at least four keys.
1010Some adaptors support more than four keys.
1011If that is the case, then the first four keys
1012(1-4) will be the standard temporary keys and any others will be adaptor
1013specific keys such as permanent keys stored in NVRAM.
1014.It Cm wme
1015Enable Wireless Multimedia Extensions (WME) support, if available,
1016for the specified interface.
1017WME is a subset of the IEEE 802.11e standard to support the
1018efficient communication of realtime and multimedia data.
1019To disable WME support, use
1020.Fl wme .
1021.Pp
1022The following parameters are meaningful only when WME support is in use.
1023Parameters are specified per-AC (Access Category) and
1024split into those that are used by a station when acting
1025as an access point and those for client stations in the BSS.
1026The latter are received from the access point and may not be changed
1027(at the station).
1028The following Access Categories are recognized:
1029.Pp
1030.Bl -tag -width ".Cm AC_BK" -compact
1031.It Cm AC_BE
1032(or
1033.Cm BE )
1034best effort delivery,
1035.It Cm AC_BK
1036(or
1037.Cm BK )
1038background traffic,
1039.It Cm AC_VI
1040(or
1041.Cm VI )
1042video traffic,
1043.It Cm AC_VO
1044(or
1045.Cm VO )
1046voice traffic.
1047.El
1048.Pp
1049AC parameters are case-insensitive.
1050Traffic classification is done in the operating system using the
1051vlan priority associated with data frames or the
1052ToS (Type of Service) indication in IP-encapsulated frames.
1053If neither information is present, traffic is assigned to the
1054Best Effort (BE) category.
1055.Bl -tag -width indent
1056.It Cm ack Ar ac
1057Set the ACK policy for QoS transmissions by the local station;
1058this controls whether or not data frames transmitted by a station
1059require an ACK response from the receiving station.
1060To disable waiting for an ACK use
1061.Fl ack .
1062This parameter is applied only to the local station.
1063.It Cm acm Ar ac
1064Enable the Admission Control Mandatory (ACM) mechanism
1065for transmissions by the local station.
1066To disable the ACM use
1067.Fl acm .
1068On stations in a BSS this parameter is read-only and indicates
1069the setting received from the access point.
1070NB: ACM is not supported right now.
1071.It Cm aifs Ar ac Ar count
1072Set the Arbitration Inter Frame Spacing (AIFS)
1073channel access parameter to use for transmissions
1074by the local station.
1075On stations in a BSS this parameter is read-only and indicates
1076the setting received from the access point.
1077.It Cm cwmin Ar ac Ar count
1078Set the CWmin channel access parameter to use for transmissions
1079by the local station.
1080On stations in a BSS this parameter is read-only and indicates
1081the setting received from the access point.
1082.It Cm cwmax Ar ac Ar count
1083Set the CWmax channel access parameter to use for transmissions
1084by the local station.
1085On stations in a BSS this parameter is read-only and indicates
1086the setting received from the access point.
1087.It Cm txoplimit Ar ac Ar limit
1088Set the Transmission Opportunity Limit channel access parameter
1089to use for transmissions by the local station.
1090This parameter defines an interval of time when a WME station
1091has the right to initiate transmissions onto the wireless medium.
1092On stations in a BSS this parameter is read-only and indicates
1093the setting received from the access point.
1094.It Cm bss:aifs Ar ac Ar count
1095Set the AIFS channel access parameter to send to stations in a BSS.
1096This parameter is meaningful only when operating in ap mode.
1097.It Cm bss:cwmin Ar ac Ar count
1098Set the CWmin channel access parameter to send to stations in a BSS.
1099This parameter is meaningful only when operating in ap mode.
1100.It Cm bss:cwmax Ar ac Ar count
1101Set the CWmax channel access parameter to send to stations in a BSS.
1102This parameter is meaningful only when operating in ap mode.
1103.It Cm bss:txoplimit Ar ac Ar limit
1104Set the TxOpLimit channel access parameter to send to stations in a BSS.
1105This parameter is meaningful only when operating in ap mode.
1106.El
1107.El
1108.Pp
1109The following parameters support an optional access control list
1110feature available with some adaptors when operating in ap mode; see
1111.Xr wlan_acl 4 .
1112This facility allows an access point to accept/deny association
1113requests based on the MAC address of the station.
1114Note that this feature does not significantly enhance security
1115as MAC address spoofing is easy to do.
1116.Bl -tag -width indent
1117.It Cm mac:add Ar address
1118Add the specified MAC address to the database.
1119Depending on the policy setting association requests from the
1120specified station will be allowed or denied.
1121.It Cm mac:allow
1122Set the ACL policy to permit association only by
1123stations registered in the database.
1124.It Cm mac:del Ar address
1125Delete the specified MAC address from the database.
1126.It Cm mac:deny
1127Set the ACL policy to deny association only by
1128stations registered in the database.
1129.It Cm mac:kick Ar address
1130Force the specified station to be deauthenticated.
1131This typically is done to block a station after updating the
1132address database.
1133.It Cm mac:open
1134Set the ACL policy to allow all stations to associate.
1135.It Cm mac:flush
1136Delete all entries in the database.
1137.El
1138.Pp
1139The following parameters are for compatibility with other systems:
1140.Bl -tag -width indent
1141.It Cm nwid Ar ssid
1142Another name for the
1143.Cm ssid
1144parameter.
1145Included for
1146.Nx
1147compatibility.
1148.It Cm station Ar name
1149Another name for the
1150.Cm stationname
1151parameter.
1152Included for
1153.Bsx
1154compatibility.
1155.It Cm wep
1156Another way of saying
1157.Cm wepmode on .
1158Included for
1159.Bsx
1160compatibility.
1161.It Fl wep
1162Another way of saying
1163.Cm wepmode off .
1164Included for
1165.Bsx
1166compatibility.
1167.It Cm nwkey key
1168Another way of saying:
1169.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
1170Included for
1171.Nx
1172compatibility.
1173.It Cm nwkey Xo
1174.Sm off
1175.Ar n : k1 , k2 , k3 , k4
1176.Sm on
1177.Xc
1178Another way of saying
1179.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
1180Included for
1181.Nx
1182compatibility.
1183.It Fl nwkey
1184Another way of saying
1185.Cm wepmode off .
1186Included for
1187.Nx
1188compatibility.
1189.El
1190.Pp
1191The following parameters are specific to bridge interfaces:
1192.Bl -tag -width indent
1193.It Cm addm Ar interface
1194Add the interface named by
1195.Ar interface
1196as a member of the bridge.
1197The interface is put into promiscuous mode
1198so that it can receive every packet sent on the network.
1199.It Cm deletem Ar interface
1200Remove the interface named by
1201.Ar interface
1202from the bridge.
1203Promiscuous mode is disabled on the interface when
1204it is removed from the bridge.
1205.It Cm maxaddr Ar size
1206Set the size of the bridge address cache to
1207.Ar size .
1208The default is 100 entries.
1209.It Cm timeout Ar seconds
1210Set the timeout of address cache entries to
1211.Ar seconds
1212seconds.
1213If
1214.Ar seconds
1215is zero, then address cache entries will not be expired.
1216The default is 1200 seconds.
1217.It Cm addr
1218Display the addresses that have been learned by the bridge.
1219.It Cm static Ar interface-name Ar address
1220Add a static entry into the address cache pointing to
1221.Ar interface-name .
1222Static entries are never aged out of the cache or re-placed, even if the
1223address is seen on a different interface.
1224.It Cm deladdr Ar address
1225Delete
1226.Ar address
1227from the address cache.
1228.It Cm flush
1229Delete all dynamically-learned addresses from the address cache.
1230.It Cm flushall
1231Delete all addresses, including static addresses, from the address cache.
1232.It Cm discover Ar interface
1233Mark an interface as a
1234.Dq discovering
1235interface.
1236When the bridge has no address cache entry
1237(either dynamic or static)
1238for the destination address of a packet,
1239the bridge will forward the packet to all
1240member interfaces marked as
1241.Dq discovering .
1242This is the default for all interfaces added to a bridge.
1243.It Fl discover Ar interface
1244Clear the
1245.Dq discovering
1246attribute on a member interface.
1247For packets without the
1248.Dq discovering
1249attribute, the only packets forwarded on the interface are broadcast
1250or multicast packets and packets for which the destination address
1251is known to be on the interface's segment.
1252.It Cm learn Ar interface
1253Mark an interface as a
1254.Dq learning
1255interface.
1256When a packet arrives on such an interface, the source
1257address of the packet is entered into the address cache as being a
1258destination address on the interface's segment.
1259This is the default for all interfaces added to a bridge.
1260.It Fl learn Ar interface
1261Clear the
1262.Dq learning
1263attribute on a member interface.
1264.It Cm span Ar interface
1265Add the interface named by
1266.Ar interface
1267as a span port on the bridge.
1268Span ports transmit a copy of every frame received by the bridge.
1269This is most useful for snooping a bridged network passively on
1270another host connected to one of the span ports of the bridge.
1271.It Fl span Ar interface
1272Delete the interface named by
1273.Ar interface
1274from the list of span ports of the bridge.
1275.It Cm stp Ar interface
1276Enable Spanning Tree protocol on
1277.Ar interface .
1278The
1279.Xr bridge 4
1280driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
1281Spanning Tree is used to detect and remove loops in a network topology.
1282.It Fl stp Ar interface
1283Disable Spanning Tree protocol on
1284.Ar interface .
1285This is the default for all interfaces added to a bridge.
1286.It Cm maxage Ar seconds
1287Set the time that a Spanning Tree protocol configuration is valid.
1288The default is 20 seconds.
1289The minimum is 1 second and the maximum is 255 seconds.
1290.It Cm fwddelay Ar seconds
1291Set the time that must pass before an interface begins forwarding
1292packets when Spanning Tree is enabled.
1293The default is 15 seconds.
1294The minimum is 1 second and the maximum is 255 seconds.
1295.It Cm hellotime Ar seconds
1296Set the time between broadcasting of Spanning Tree protocol
1297configuration messages.
1298The default is 2 seconds.
1299The minimum is 1 second and the maximum is 255 seconds.
1300.It Cm priority Ar value
1301Set the bridge priority for Spanning Tree.
1302The default is 32768.
1303The minimum is 0 and the maximum is 65536.
1304.It Cm ifpriority Ar interface Ar value
1305Set the Spanning Tree priority of
1306.Ar interface
1307to
1308.Ar value .
1309The default is 128.
1310The minimum is 0 and the maximum is 255.
1311.It Cm ifpathcost Ar interface Ar value
1312Set the Spanning Tree path cost of
1313.Ar interface
1314to
1315.Ar value .
1316The default is 55.
1317The minimum is 0 and the maximum is 65535.
1318.El
1319.Pp
1320The following parameters are specific to IP tunnel interfaces,
1321.Xr gif 4 :
1322.Bl -tag -width indent
1323.It Cm tunnel Ar src_addr dest_addr
1324Configure the physical source and destination address for IP tunnel
1325interfaces.
1326The arguments
1327.Ar src_addr
1328and
1329.Ar dest_addr
1330are interpreted as the outer source/destination for the encapsulating
1331IPv4/IPv6 header.
1332.It Fl tunnel
1333Unconfigure the physical source and destination address for IP tunnel
1334interfaces previously configured with
1335.Cm tunnel .
1336.It Cm deletetunnel
1337Another name for the
1338.Fl tunnel
1339parameter.
1340.El
1341.Pp
1342The following parameters are specific to
1343.Xr vlan 4
1344interfaces:
1345.Bl -tag -width indent
1346.It Cm vlan Ar vlan_tag
1347Set the VLAN tag value to
1348.Ar vlan_tag .
1349This value is a 16-bit number which is used to create an 802.1Q
1350VLAN header for packets sent from the
1351.Xr vlan 4
1352interface.
1353Note that
1354.Cm vlan
1355and
1356.Cm vlandev
1357must both be set at the same time.
1358.It Cm vlandev Ar iface
1359Associate the physical interface
1360.Ar iface
1361with a
1362.Xr vlan 4
1363interface.
1364Packets transmitted through the
1365.Xr vlan 4
1366interface will be
1367diverted to the specified physical interface
1368.Ar iface
1369with 802.1Q VLAN encapsulation.
1370Packets with 802.1Q encapsulation received
1371by the parent interface with the correct VLAN tag will be diverted to
1372the associated
1373.Xr vlan 4
1374pseudo-interface.
1375The
1376.Xr vlan 4
1377interface is assigned a
1378copy of the parent interface's flags and the parent's ethernet address.
1379The
1380.Cm vlandev
1381and
1382.Cm vlan
1383must both be set at the same time.
1384If the
1385.Xr vlan 4
1386interface already has
1387a physical interface associated with it, this command will fail.
1388To
1389change the association to another physical interface, the existing
1390association must be cleared first.
1391.Pp
1392Note: if the hardware tagging capability
1393is set on the parent interface, the
1394.Xr vlan 4
1395pseudo
1396interface's behavior changes:
1397the
1398.Xr vlan 4
1399interface recognizes that the
1400parent interface supports insertion and extraction of VLAN tags on its
1401own (usually in firmware) and that it should pass packets to and from
1402the parent unaltered.
1403.It Fl vlandev Op Ar iface
1404If the driver is a
1405.Xr vlan 4
1406pseudo device, disassociate the parent interface from it.
1407This breaks the link between the
1408.Xr vlan 4
1409interface and its parent,
1410clears its VLAN tag, flags and its link address and shuts the interface down.
1411The
1412.Ar iface
1413argument is useless and hence deprecated.
1414.El
1415.Pp
1416The following parameters are specific to
1417.Xr carp 4
1418interfaces:
1419.Bl -tag -width indent
1420.It Cm advbase Ar seconds
1421Specifies the base of the advertisement interval in seconds.
1422The acceptable values are 1 to 255.
1423The default value is 1.
1424.\" The default value is
1425.\" .Dv CARP_DFLTINTV .
1426.It Cm advskew Ar interval
1427Specifies the skew to add to the base advertisement interval to
1428make one host advertise slower than another host.
1429It is specified in 1/256 of seconds.
1430The acceptable values are 1 to 254.
1431The default value is 0.
1432.It Cm pass Ar phrase
1433Set the authentication key to
1434.Ar phrase .
1435.It Cm vhid Ar n
1436Set the virtual host ID.
1437This is a required setting.
1438Acceptable values are 1 to 255.
1439.El
1440.Pp
1441The
1442.Nm
1443utility displays the current configuration for a network interface
1444when no optional parameters are supplied.
1445If a protocol family is specified,
1446.Nm
1447will report only the details specific to that protocol family.
1448.Pp
1449If the
1450.Fl m
1451flag is passed before an interface name,
1452.Nm
1453will display the capability list and all
1454of the supported media for the specified interface.
1455If
1456.Fl L
1457flag is supplied, address lifetime is displayed for IPv6 addresses,
1458as time offset string.
1459.Pp
1460Optionally, the
1461.Fl a
1462flag may be used instead of an interface name.
1463This flag instructs
1464.Nm
1465to display information about all interfaces in the system.
1466The
1467.Fl d
1468flag limits this to interfaces that are down, and
1469.Fl u
1470limits this to interfaces that are up.
1471When no arguments are given,
1472.Fl a
1473is implied.
1474.Pp
1475The
1476.Fl l
1477flag may be used to list all available interfaces on the system, with
1478no other additional information.
1479Use of this flag is mutually exclusive
1480with all other flags and commands, except for
1481.Fl d
1482(only list interfaces that are down)
1483and
1484.Fl u
1485(only list interfaces that are up).
1486.Pp
1487The
1488.Fl v
1489flag may be used to get more verbose status for an interface.
1490.Pp
1491The
1492.Fl C
1493flag may be used to list all of the interface cloners available on
1494the system, with no additional information.
1495Use of this flag is mutually exclusive with all other flags and commands.
1496.Pp
1497The
1498.Fl k
1499flag causes keying information for the interface, if available, to be
1500printed.
1501For example, the values of 802.11 WEP keys will be printed, if accessible to
1502the current user.
1503This information is not printed by default, as it may be considered
1504sensitive.
1505.Pp
1506Only the super-user may modify the configuration of a network interface.
1507.Sh DIAGNOSTICS
1508Messages indicating the specified interface does not exist, the
1509requested address is unknown, or the user is not privileged and
1510tried to alter an interface's configuration.
1511.Sh SEE ALSO
1512.Xr netstat 1 ,
1513.Xr carp 4 ,
1514.Xr ifmedia 4 ,
1515.Xr netintro 4 ,
1516.Xr polling 4 ,
1517.Xr vlan 4 ,
1518.\" .Xr eon 5 ,
1519.Xr rc 8 ,
1520.Xr routed 8 ,
1521.Xr sysctl 8
1522.Sh HISTORY
1523The
1524.Nm
1525utility appeared in
1526.Bx 4.2 .
1527.Sh BUGS
1528Basic IPv6 node operation requires a link-local address on each
1529interface configured for IPv6.
1530Normally, such an address is automatically configured by the
1531kernel on each interface added to the system; this behaviour may
1532be disabled by setting the sysctl MIB variable
1533.Va net.inet6.ip6.auto_linklocal
1534to 0.
1535.Pp
1536If you delete such an address using
1537.Nm ,
1538the kernel may act very odd.
1539Do this at your own risk.
1540