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