Nuke redundant declaration of 'nfs_diskless_valid'
[dragonfly.git] / sbin / ifconfig / ifconfig.8
CommitLineData
984263bc
MD
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.
984263bc
MD
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
b50e4759 29.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.85 2004/07/27 09:51:49 yar Exp $
b9334f94 30.\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.11 2006/09/01 15:12:11 sephe Exp $
984263bc 31.\"
b9334f94 32.Dd September 1, 2006
984263bc
MD
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
55fc9f88 41.Op Fl k
984263bc
MD
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
55fc9f88 60.Op Fl v
984263bc
MD
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
55fc9f88 70.Op Fl k
984263bc
MD
71.Op Fl m
72.Op Fl u
55fc9f88 73.Op Fl v
984263bc
MD
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
b50e4759 143e.g.\& set a new MAC address on an ethernet interface, though the
984263bc
MD
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
b50e4759 204Remove the network address specified.
984263bc
MD
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 broadcast
232(Inet only.)
233Specify the address to use to represent broadcasts to the
234network.
235The default broadcast address is the address with a host part of all 1's.
236.It Cm debug
237Enable driver dependent debugging code; usually, this turns on
238extra console error logging.
239.It Fl debug
240Disable driver dependent debugging code.
e5ebb632
SW
241.It Cm polling
242Enable
243.Xr polling 4
244for the interface.
245.It Fl polling
246Disable
247.Xr polling 4
248for the interface.
984263bc
MD
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
272.\" This is used to specify an Internet host who is willing to receive
273.\" ip packets encapsulating NS packets bound for a remote network.
274.\" An apparent point to point link is constructed, and
275.\" the address specified will be taken as the NS address and network
276.\" of the destination.
277.\" IP encapsulation of
278.\" .Tn CLNP
279.\" packets is done differently.
280.It Cm media Ar type
281If the driver supports the media selection system, set the media type
282of the interface to
283.Ar type .
284Some interfaces support the mutually exclusive use of one of several
285different physical media connectors.
286For example, a 10Mb/s Ethernet
287interface might support the use of either
288.Tn AUI
289or twisted pair connectors.
290Setting the media type to
b50e4759 291.Dq Li 10base5/AUI
984263bc
MD
292would change the currently active connector to the AUI port.
293Setting it to
b50e4759 294.Dq Li 10baseT/UTP
984263bc
MD
295would activate twisted pair.
296Refer to the interfaces' driver
297specific documentation or man page for a complete list of the
298available types.
299.It Cm mediaopt Ar opts
300If the driver supports the media selection system, set the specified
301media options on the interface.
302The
303.Ar opts
304argument
305is a comma delimited list of options to apply to the interface.
306Refer to the interfaces' driver specific man page for a complete
307list of available options.
308.It Fl mediaopt Ar opts
309If the driver supports the media selection system, disable the
310specified media options on the interface.
b50e4759
MD
311.It Cm mode Ar mode
312If the driver supports the media selection system, set the specified
313operating mode on the interface to
314.Ar mode .
315For IEEE 802.11 wireless interfaces that support multiple operating modes
316this directive is used to select between 802.11a
317.Pq Dq Li 11a ,
318802.11b
319.Pq Dq Li 11b ,
320and 802.11g
321.Pq Dq Li 11g
322operating modes.
323.It Cm name Ar name
324Set the interface name to
325.Ar name .
326.It Cm rxcsum , txcsum
327If the driver supports user-configurable checksum offloading,
328enable receive (or transmit) checksum offloading on the interface.
329Some drivers may not be able to enable these flags independently
330of each other, so setting one may also set the other.
331The driver will offload as much checksum work as it can reliably
332support, the exact level of offloading varies between drivers.
333.\".It Fl rxcsum , Fl txcsum
334.\"If the driver supports user-configurable checksum offloading,
335.\"disable receive (or transmit) checksum offloading on the interface.
336.\"These settings may not always be independent of each other.
337.\".It Cm polling
338.\"If the driver has user-configurable
339.\".Xr polling 4
340.\"support, select the polling mode on the interface.
341.\".It Fl polling
342.\"If the driver has user-configurable
343.\".Xr polling 4
344.\"support, select the interrupt mode on the interface.
984263bc
MD
345.It Cm tunnel Ar src_addr dest_addr
346(IP tunnel devices only.)
347Configure the physical source and destination address for IP tunnel
348interfaces
349.Pq Xr gif 4 .
350The arguments
351.Ar src_addr
352and
353.Ar dest_addr
354are interpreted as the outer source/destination for the encapsulating
355IPv4/IPv6 header.
356.It Cm deletetunnel
357Unconfigure the physical source and destination address for IP tunnel
358interfaces previously configured with
359.Cm tunnel .
360.It Cm create
361Create the specified network pseudo-device.
362If the interface is given without a unit number, try to create a new
363device with an arbitrary unit number.
364If creation of an arbitrary device is successful, the new device name is
365printed to standard output.
366.It Cm destroy
367Destroy the specified network pseudo-device.
368.It Cm plumb
369Another name for the
370.Cm create
371parameter.
372Included for
373.Tn Solaris
374compatibility.
375.It Cm unplumb
376Another name for the
377.Cm destroy
378parameter.
379Included for
380.Tn Solaris
381compatibility.
382.It Cm vlan Ar vlan_tag
b50e4759
MD
383If the interface is a
384.Xr vlan 4
385pseudo interface, set the VLAN tag value
984263bc
MD
386to
387.Ar vlan_tag .
388This value is a 16-bit number which is used to create an 802.1Q
b50e4759
MD
389VLAN header for packets sent from the
390.Xr vlan 4
391interface.
984263bc
MD
392Note that
393.Cm vlan
394and
395.Cm vlandev
396must both be set at the same time.
397.It Cm vlandev Ar iface
b50e4759
MD
398If the interface is a
399.Xr vlan 4
400pseudo device, associate physical interface
984263bc
MD
401.Ar iface
402with it.
b50e4759
MD
403Packets transmitted through the
404.Xr vlan 4
405interface will be
984263bc
MD
406diverted to the specified physical interface
407.Ar iface
b50e4759 408with 802.1Q VLAN encapsulation.
984263bc 409Packets with 802.1Q encapsulation received
b50e4759
MD
410by the parent interface with the correct VLAN tag will be diverted to
411the associated
412.Xr vlan 4
413pseudo-interface.
414The
415.Xr vlan 4
416interface is assigned a
984263bc
MD
417copy of the parent interface's flags and the parent's ethernet address.
418The
419.Cm vlandev
420and
421.Cm vlan
422must both be set at the same time.
b50e4759
MD
423If the
424.Xr vlan 4
425interface already has
984263bc
MD
426a physical interface associated with it, this command will fail.
427To
428change the association to another physical interface, the existing
429association must be cleared first.
430.Pp
b50e4759
MD
431Note: if the hardware tagging capability
432is set on the parent interface, the
433.Xr vlan 4
434pseudo
435interface's behavior changes:
436the
437.Xr vlan 4
438interface recognizes that the
439parent interface supports insertion and extraction of VLAN tags on its
984263bc
MD
440own (usually in firmware) and that it should pass packets to and from
441the parent unaltered.
442.It Fl vlandev Ar iface
b50e4759
MD
443If the driver is a
444.Xr vlan 4
445pseudo device, disassociate the physical interface
984263bc
MD
446.Ar iface
447from it.
b50e4759
MD
448This breaks the link between the
449.Xr vlan 4
450interface and its parent,
451clears its VLAN tag, flags and its link address and shuts the interface down.
452.It Cm vlanmtu , vlanhwtag
453If the driver offers user-configurable VLAN support, enable
454reception of extended frames or tag processing in hardware,
455respectively.
456Note that this must be issued on a physical interface associated with
457.Xr vlan 4 ,
458not on a
459.Xr vlan 4
460interface itself.
461.It Fl vlanmtu , Fl vlanhwtag
462If the driver offers user-configurable VLAN support, disable
463reception of extended frames or tag processing in hardware,
464respectively.
984263bc
MD
465.It Cm metric Ar n
466Set the routing metric of the interface to
467.Ar n ,
468default 0.
469The routing metric is used by the routing protocol
470.Pq Xr routed 8 .
471Higher metrics have the effect of making a route
472less favorable; metrics are counted as addition hops
473to the destination network or host.
474.It Cm mtu Ar n
475Set the maximum transmission unit of the interface to
476.Ar n ,
477default is interface specific.
478The MTU is used to limit the size of packets that are transmitted on an
479interface.
480Not all interfaces support setting the MTU, and some interfaces have
481range restrictions.
482.It Cm netmask Ar mask
483.\" (Inet and ISO.)
484(Inet only.)
485Specify how much of the address to reserve for subdividing
486networks into sub-networks.
487The mask includes the network part of the local address
488and the subnet part, which is taken from the host field of the address.
489The mask can be specified as a single hexadecimal number
490with a leading
491.Ql 0x ,
492with a dot-notation Internet address,
493or with a pseudo-network name listed in the network table
494.Xr networks 5 .
495The mask contains 1's for the bit positions in the 32-bit address
496which are to be used for the network and subnet parts,
497and 0's for the host part.
498The mask should contain at least the standard network portion,
499and the subnet field should be contiguous with the network
500portion.
501.Pp
502The netmask can also be specified in CIDR notation after the address.
503See the
504.Ar address
505option above for more information.
506.It Cm prefixlen Ar len
507(Inet6 only.)
508Specify that
509.Ar len
510bits are reserved for subdividing networks into sub-networks.
511The
512.Ar len
513must be integer, and for syntactical reason it must be between 0 to 128.
514It is almost always 64 under the current IPv6 assignment rule.
515If the parameter is omitted, 64 is used.
516.Pp
517The prefix can also be specified using the slash notation after the address.
518See the
519.Ar address
520option above for more information.
521.\" see
522.\" Xr eon 5 .
523.\" .It Cm nsellength Ar n
524.\" .Pf ( Tn ISO
525.\" only)
526.\" This specifies a trailing number of bytes for a received
527.\" .Tn NSAP
528.\" used for local identification, the remaining leading part of which is
529.\" taken to be the
530.\" .Tn NET
531.\" (Network Entity Title).
532.\" The default value is 1, which is conformant to US
533.\" .Tn GOSIP .
534.\" When an ISO address is set in an ifconfig command,
535.\" it is really the
536.\" .Tn NSAP
537.\" which is being specified.
538.\" For example, in
539.\" .Tn US GOSIP ,
540.\" 20 hex digits should be
541.\" specified in the
542.\" .Tn ISO NSAP
543.\" to be assigned to the interface.
544.\" There is some evidence that a number different from 1 may be useful
545.\" for
546.\" .Tn AFI
547.\" 37 type addresses.
548.It Cm range Ar netrange
549Under appletalk, set the interface to respond to a
550.Ar netrange
551of the form
552.Ar startnet Ns - Ns Ar endnet .
553Appletalk uses this scheme instead of
554netmasks though
b50e4759 555.Fx
984263bc
MD
556implements it internally as a set of netmasks.
557.It Cm remove
558Another name for the
559.Fl alias
560parameter.
561Introduced for compatibility
562with
563.Bsx .
564.It Cm phase
565The argument following this specifies the version (phase) of the
566Appletalk network attached to the interface.
567Values of 1 or 2 are permitted.
568.Sm off
569.It Cm link Op Cm 0 No - Cm 2
570.Sm on
571Enable special processing of the link level of the interface.
572These three options are interface specific in actual effect, however,
573they are in general used to select special modes of operation.
574An example
575of this is to enable SLIP compression, or to select the connector type
576for some Ethernet cards.
577Refer to the man page for the specific driver
578for more information.
579.Sm off
580.It Fl link Op Cm 0 No - Cm 2
581.Sm on
582Disable special processing at the link level with the specified interface.
b50e4759
MD
583.\".It Cm monitor
584.\"Put the interface in monitor mode.
585.\"No packets are transmitted, and received packets are discarded after
586.\".Xr bpf 4
587.\"processing.
588.\".It Fl monitor
589.\"Take the interface out of monitor mode.
984263bc
MD
590.It Cm up
591Mark an interface
592.Dq up .
593This may be used to enable an interface after an
594.Dq Nm Cm down .
595It happens automatically when setting the first address on an interface.
596If the interface was reset when previously marked down,
597the hardware will be re-initialized.
55fc9f88
SZ
598.\" Wireless only
599.El
600.Pp
601The following parameters are specific to IEEE 802.11 wireless interfaces:
602.Bl -tag -width indent
603.It Cm apbridge
604When operating as an access point, pass packets between
605wireless clients directly (default).
606To instead let them pass up through the
607system and be forwarded using some other mechanism, use
608.Fl apbridge .
609Disabling the internal bridging
610is useful when traffic is to be processed with
611packet filtering.
984263bc 612.It Cm authmode Ar mode
55fc9f88 613Set the desired authentication mode in infrastructure mode.
984263bc
MD
614Not all adaptors support all modes.
615The set of
616valid modes is
55fc9f88
SZ
617.Cm none , open , shared
618(shared key),
619.Cm 8021x
620(IEEE 802.1x),
621and
622.Cm wpa
623(IEEE WPA/WPA2/802.11i).
624The
625.Cm 8021x
984263bc 626and
55fc9f88
SZ
627.Cm wpa
628modes are only useful when using an authentication service
629(a supplicant for client operation or an authenticator when
630operating as an access point).
984263bc 631Modes are case insensitive.
55fc9f88
SZ
632.It Cm bintval Ar interval
633Set the interval at which beacon frames are sent when operating in
634ad-hoc or ap mode.
635The
636.Ar interval
637parameter is specified in TU's (1/1024 msecs).
638By default beacon frames are transmitted every 100 TU's.
639.It Cm bssid Ar address
640Specify the MAC address of the access point to use when operating
641as a station in a BSS network.
642This overrides any automatic selection done by the system.
643To disable a previously selected access point, supply
644.Cm any , none ,
645or
646.Cm -
647for the address.
648This option is useful when more than one access points have the same SSID.
649Another name for the
650.Cm bssid
651parameter is
652.Cm ap .
653.It Cm burst
654Enable packet bursting.
655Packet bursting is a transmission technique whereby the wireless
656medium is acquired once to send multiple frames and the interframe
657spacing is reduced.
658This technique can significantly increase throughput by reducing
659transmission overhead.
660Packet bursting is supported by the 802.11e QoS specification
661and some devices that do not support QoS may still be capable.
662By default packet bursting is enabled if a device is capable
663of doing it.
664To disable packet bursting, use
665.Fl burst .
666.It Cm chanlist Ar channels
667Set the desired channels to use when scanning for access
668points, neighbors in an IBSS network, or looking for unoccupied
669channels when operating as an access point.
670The set of channels is specified as a comma-separated list with
671each element in the list representing either a single channel number or a range
672of the form
673.Dq Li a-b .
674Channel numbers must be in the range 1 to 255 and be permissible
675according to the operating characteristics of the device.
676.It Cm channel Ar number
677Set a single desired channel.
678Channels range from 1 to 255, but the exact selection available
679depends on the region your adaptor was manufactured for.
680Setting
681the channel to
682.Li 0 ,
683.Cm any ,
684or
685.Cm -
686will give you the default for your adaptor.
687Some
688adaptors ignore this setting unless you are in ad-hoc mode.
689Alternatively the frequency, in megahertz, may be specified
690instead of the channel number.
691.It Cm deftxkey Ar index
692Set the default key to use for transmission.
693Typically this is only set when using WEP encryption.
694The
695.Cm weptxkey
696is an alias for this request; it is provided for backwards compatibility.
697.It Cm dtimperiod Ar period
698Set the
699DTIM
700period for transmitting buffered multicast data frames when
701operating in ap mode.
702The
703.Ar period
704specifies the number of beacon intervals between DTIM
705and must be in the range 1 to 15.
706By default DTIM is 1 (i.e., DTIM occurs at each beacon).
707.It Cm fragthreshold Ar length
708Set the threshold for which transmitted frames are broken into fragments.
709The
710.Ar length
711argument is the frame size in bytes and must be in the range 256 to 2346.
712Setting
713.Ar length
714to
715.Li 2346 ,
716.Cm any ,
717or
718.Cm -
719disables transmit fragmentation.
720Not all adaptors honor the fragmentation threshold.
721.It Cm hidessid
722When operating as an access point, do not broadcast the SSID
723in beacon frames or respond to probe request frames unless
724they are directed to the ap (i.e., they include the ap's SSID).
725By default, the SSID is included in beacon frames and
726undirected probe request frames are answered.
727To re-enable the broadcast of the SSID etc., use
728.Fl hidessid .
729.It Cm list active
730Display the list of channels available for use taking into account
731any restrictions set with the
732.Cm chanlist
733directive.
734See the description of
735.Cm list chan
736for more information.
737.It Cm list caps
738Display the adaptor's capabilities, including the operating
739modes supported.
740.It Cm list chan
741Display the list of channels available for use.
742Channels are shown with their IEEE channel number, equivalent
743frequency, and usage modes.
744Channels identified as
745.Ql 11g
746are also usable in
747.Ql 11b
748mode.
749Channels identified as
750.Ql 11a Turbo
751may be used only for Atheros' Static Turbo mode
752.Pq specified with Cm mediaopt turbo .
753Channels marked with a
754.Ql *
755have a regulatory constraint that they be passively scanned.
756This means a station is not permitted to transmit on the channel until
757it identifies the channel is being used for 802.11 communication;
758typically by hearing a beacon frame from an access point operating
759on the channel.
760.Cm list freq
761is another way of requesting this information.
762.It Cm list mac
763Display the current MAC Access Control List state.
764Each address is prefixed with a character that indicates the
765current policy applied to it:
766.Ql +
767indicates the address is allowed access,
768.Ql -
769indicates the address is denied access,
770.Ql *
771indicates the address is present but the current policy open
772(so the ACL is not consulted).
773.It Cm list scan
774Display the access points and/or ad-hoc neighbors
775located in the vicinity.
776This information may be updated automatically by the adaptor
777and/or with a
778.Cm scan
779request.
780.Cm list ap
781is another way of requesting this information.
782.It Cm list sta
783When operating as an access point display the stations that are
784currently associated.
785When operating in ad-hoc mode display stations identified as
786neighbors in the IBSS.
787.It Cm list wme
788Display the current parameters to use when operating in WME mode.
789When WME mode is enabled for an adaptor this information will be
790displayed with the regular status; this command is mostly useful
791for examining parameters when WME mode is disabled.
792See the description of the
793.Cm wme
794directive for information on the various parameters.
795.It Cm mcastrate Ar rate
796Set the rate for transmitting multicast/broadcast frames.
797Rates are specified as megabits/second in decimal; e.g. 5.5 for 5.5 Mb/s.
798This rate should be valid for the current operating conditions;
799if an invalid rate is specified drivers are free to chose an
800appropriate rate.
984263bc 801.It Cm powersave
55fc9f88
SZ
802Enable powersave operation.
803When operating as a client, the station will conserve power by
804periodically turning off the radio and listening for
805messages from the access point telling it there are packets waiting.
806The station must then retrieve the packets.
807When operating as an access point, the station must honor power
808save operation of associated clients.
809Not all devices support power save operation, either as a client
810or as an access point.
811Use
812.Fl powersave
813to disable powersave operation.
984263bc 814.It Cm powersavesleep Ar sleep
55fc9f88 815Set the desired max powersave sleep time in milliseconds.
b50e4759 816.It Cm protmode Ar technique
55fc9f88 817For interfaces operating in 802.11g, use the specified
b50e4759
MD
818.Ar technique
819for protecting OFDM frames in a mixed 11b/11g network.
820The set of valid techniques is
55fc9f88 821.Cm off , cts
b50e4759
MD
822(CTS to self),
823and
55fc9f88 824.Cm rtscts
b50e4759
MD
825(RTS/CTS).
826Technique names are case insensitive.
55fc9f88
SZ
827.It Cm pureg
828When operating as an access point in 802.11g mode allow only
82911g-capable stations to associate (11b-only stations are not
830permitted to associate).
831To allow both 11g and 11b-only stations to associate, use
832.Fl pureg .
833.It Cm roaming Ar mode
834When operating as a station, control how the system will
835behave when communication with the current access point
836is broken.
837The
838.Ar mode
839argument may be one of
840.Cm device
841(leave it to the hardware device to decide),
842.Cm auto
843(handle either in the device or the operating system\[em]as appropriate),
844.Cm manual
845(do nothing until explicitly instructed).
846By default, the device is left to handle this if it is
847capable; otherwise, the operating system will automatically
848attempt to reestablish communication.
849Manual mode is mostly useful when an application wants to
850control the selection of an access point.
b9334f94
SZ
851.It Cm ratectl Ar algorithm
852Set the TX rate control algorithm.
853The set of valid
854.Ar algorithm
855is
856.Cm onoe
857(Onoe TX rate control algorithm)
858and
859.Cm amrr
860(AMRR TX rate control algorithm).
861.Ar Algorithm
862names are case sensitive.
b50e4759 863.It Cm rtsthreshold Ar length
55fc9f88 864Set the threshold for which
b50e4759
MD
865transmitted frames are preceded by transmission of an
866RTS
867control frame.
868The
869.Ar length
870argument
55fc9f88
SZ
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.
b50e4759 880Not all adaptors support setting the RTS threshold.
55fc9f88
SZ
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 E
897Extended Service Set (ESS).
898Indicates that the station is part of an infrastructure network
899(in contrast to an IBSS/ad-hoc network).
900.It Li I
901IBSS/ad-hoc network.
902Indicates that the station is part of an ad-hoc network
903(in contrast to an ESS network).
904.It Li P
905Privacy.
906Data confidentiality is required for all data frames
907exchanged within the BSS.
908This means that this BSS requires the station to
909use cryptographic means such as WEP, TKIP or AES-CCMP to
910encrypt/decrypt data frames being exchanged with others.
911.It Li S
912Short Preamble.
913Indicates that the network is using short preambles (defined
914in 802.11b High Rate/DSSS PHY, short preamble utilizes a
91556 bit sync field in contrast to a 128 bit field used in long
916preamble mode).
917.It Li s
918Short slot time.
919Indicates that the network is using a short slot time.
920.El
921.Pp
922The
923.Cm list scan
924request can be used to show recent scan results without
925initiating a new scan.
926.It Cm stationname Ar name
927Set the name of this station.
928It appears that the station name is not really part of the IEEE 802.11
929protocol though all interfaces seem to support it.
930As such it only
931seems to be meaningful to identical or virtually identical equipment.
932Setting the station name is identical in syntax to setting the SSID.
b50e4759 933.It Cm txpower Ar power
55fc9f88 934Set the power used to transmit frames.
b50e4759
MD
935The
936.Ar power
937argument
938is a unitless value in the range 0 to 100 that is interpreted
939by drivers to derive a device-specific value.
940Out of range values are truncated.
941Typically only a few discreet power settings are available and
942the driver will use the setting closest to the specified value.
943Not all adaptors support changing the transmit power.
984263bc 944.It Cm wepmode Ar mode
55fc9f88 945Set the desired WEP mode.
984263bc
MD
946Not all adaptors support all modes.
947The set of valid modes is
55fc9f88 948.Cm off , on ,
984263bc 949and
55fc9f88 950.Cm mixed .
b50e4759 951The
55fc9f88 952.Cm mixed
984263bc
MD
953mode explicitly tells the adaptor to allow association with access
954points which allow both encrypted and unencrypted traffic.
955On these adaptors,
55fc9f88 956.Cm on
984263bc
MD
957means that the access point must only allow encrypted connections.
958On other adaptors,
55fc9f88 959.Cm on
984263bc 960is generally another name for
55fc9f88 961.Cm mixed .
984263bc
MD
962Modes are case insensitive.
963.It Cm weptxkey Ar index
55fc9f88
SZ
964Set the WEP key to be used for transmission.
965This is the same as setting the default transmission key with
966.Cm deftxkey .
984263bc 967.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
55fc9f88 968Set the selected WEP key.
984263bc
MD
969If an
970.Ar index
971is not given, key 1 is set.
972A WEP key will be either 5 or 13
973characters (40 or 104 bits) depending of the local network and the
974capabilities of the adaptor.
975It may be specified either as a plain
55fc9f88 976string or as a string of hexadecimal digits preceded by
984263bc
MD
977.Ql 0x .
978For maximum portability, hex keys are recommended;
979the mapping of text keys to WEP encryption is usually driver-specific.
980In particular, the
981.Tn Windows
982drivers do this mapping differently to
b50e4759 983.Fx .
984263bc
MD
984A key may be cleared by setting it to
985.Ql - .
986If WEP is supported then there are at least four keys.
987Some adaptors support more than four keys.
988If that is the case, then the first four keys
989(1-4) will be the standard temporary keys and any others will be adaptor
990specific keys such as permanent keys stored in NVRAM.
55fc9f88
SZ
991.It Cm wme
992Enable Wireless Multimedia Extensions (WME) support, if available,
993for the specified interface.
994WME is a subset of the IEEE 802.11e standard to support the
995efficient communication of realtime and multimedia data.
996To disable WME support, use
997.Fl wme .
998.Pp
999The following parameters are meaningful only when WME support is in use.
1000Parameters are specified per-AC (Access Category) and
1001split into those that are used by a station when acting
1002as an access point and those for client stations in the BSS.
1003The latter are received from the access point and may not be changed
1004(at the station).
1005The following Access Categories are recognized:
1006.Pp
1007.Bl -tag -width ".Cm AC_BK" -compact
1008.It Cm AC_BE
1009(or
1010.Cm BE )
1011best effort delivery,
1012.It Cm AC_BK
1013(or
1014.Cm BK )
1015background traffic,
1016.It Cm AC_VI
1017(or
1018.Cm VI )
1019video traffic,
1020.It Cm AC_VO
1021(or
1022.Cm VO )
1023voice traffic.
1024.El
1025.Pp
1026AC parameters are case-insensitive.
1027Traffic classification is done in the operating system using the
1028vlan priority associated with data frames or the
1029ToS (Type of Service) indication in IP-encapsulated frames.
1030If neither information is present, traffic is assigned to the
1031Best Effort (BE) category.
1032.Bl -tag -width indent
1033.It Cm ack Ar ac
1034Set the ACK policy for QoS transmissions by the local station;
1035this controls whether or not data frames transmitted by a station
1036require an ACK response from the receiving station.
1037To disable waiting for an ACK use
1038.Fl ack .
1039This parameter is applied only to the local station.
1040.It Cm acm Ar ac
1041Enable the Admission Control Mandatory (ACM) mechanism
1042for transmissions by the local station.
1043To disable the ACM use
1044.Fl acm .
1045On stations in a BSS this parameter is read-only and indicates
1046the setting received from the access point.
1047NB: ACM is not supported right now.
1048.It Cm aifs Ar ac Ar count
1049Set the Arbitration Inter Frame Spacing (AIFS)
1050channel access parameter to use for transmissions
1051by the local station.
1052On stations in a BSS this parameter is read-only and indicates
1053the setting received from the access point.
1054.It Cm cwmin Ar ac Ar count
1055Set the CWmin channel access parameter to use for transmissions
1056by the local station.
1057On stations in a BSS this parameter is read-only and indicates
1058the setting received from the access point.
1059.It Cm cwmax Ar ac Ar count
1060Set the CWmax channel access parameter to use for transmissions
1061by the local station.
1062On stations in a BSS this parameter is read-only and indicates
1063the setting received from the access point.
1064.It Cm txoplimit Ar ac Ar limit
1065Set the Transmission Opportunity Limit channel access parameter
1066to use for transmissions by the local station.
1067This parameter defines an interval of time when a WME station
1068has the right to initiate transmissions onto the wireless medium.
1069On stations in a BSS this parameter is read-only and indicates
1070the setting received from the access point.
1071.It Cm bss:aifs Ar ac Ar count
1072Set the AIFS channel access parameter to send to stations in a BSS.
1073This parameter is meaningful only when operating in ap mode.
1074.It Cm bss:cwmin Ar ac Ar count
1075Set the CWmin channel access parameter to send to stations in a BSS.
1076This parameter is meaningful only when operating in ap mode.
1077.It Cm bss:cwmax Ar ac Ar count
1078Set the CWmax channel access parameter to send to stations in a BSS.
1079This parameter is meaningful only when operating in ap mode.
1080.It Cm bss:txoplimit Ar ac Ar limit
1081Set the TxOpLimit channel access parameter to send to stations in a BSS.
1082This parameter is meaningful only when operating in ap mode.
1083.El
1084.El
1085.Pp
1086The following parameters support an optional access control list
1087feature available with some adaptors when operating in ap mode; see
1088.Xr wlan_acl 4 .
1089This facility allows an access point to accept/deny association
1090requests based on the MAC address of the station.
1091Note that this feature does not significantly enhance security
1092as MAC address spoofing is easy to do.
1093.Bl -tag -width indent
1094.It Cm mac:add Ar address
1095Add the specified MAC address to the database.
1096Depending on the policy setting association requests from the
1097specified station will be allowed or denied.
1098.It Cm mac:allow
1099Set the ACL policy to permit association only by
1100stations registered in the database.
1101.It Cm mac:del Ar address
1102Delete the specified MAC address from the database.
1103.It Cm mac:deny
1104Set the ACL policy to deny association only by
1105stations registered in the database.
1106.It Cm mac:kick Ar address
1107Force the specified station to be deauthenticated.
1108This typically is done to block a station after updating the
1109address database.
1110.It Cm mac:open
1111Set the ACL policy to allow all stations to associate.
1112.It Cm mac:flush
1113Delete all entries in the database.
1114.El
1115.Pp
1116The following parameters are for compatibility with other systems:
1117.Bl -tag -width indent
1118.It Cm nwid Ar ssid
1119Another name for the
1120.Cm ssid
1121parameter.
1122Included for
1123.Nx
1124compatibility.
1125.It Cm station Ar name
1126Another name for the
1127.Cm stationname
1128parameter.
1129Included for
1130.Bsx
1131compatibility.
984263bc
MD
1132.It Cm wep
1133Another way of saying
1134.Cm wepmode on .
1135Included for
1136.Bsx
1137compatibility.
1138.It Fl wep
1139Another way of saying
1140.Cm wepmode off .
1141Included for
1142.Bsx
1143compatibility.
1144.It Cm nwkey key
1145Another way of saying:
984263bc 1146.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
984263bc
MD
1147Included for
1148.Nx
1149compatibility.
1150.It Cm nwkey Xo
1151.Sm off
1152.Ar n : k1 , k2 , k3 , k4
1153.Sm on
1154.Xc
1155Another way of saying
984263bc 1156.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
984263bc
MD
1157Included for
1158.Nx
1159compatibility.
1160.It Fl nwkey
1161Another way of saying
1162.Cm wepmode off .
984263bc
MD
1163Included for
1164.Nx
1165compatibility.
55fc9f88
SZ
1166.\" Bridge only
1167.El
1168.Pp
1169The following parameters are specific to bridge interfaces:
1170.Bl -tag -width indent
1171.It Cm addm Ar interface
1172Add the interface named by
1173.Ar interface
1174as a member of the bridge.
1175The interface is put into promiscuous mode
1176so that it can receive every packet sent on the network.
1177.It Cm deletem Ar interface
1178Remove the interface named by
1179.Ar interface
1180from the bridge.
1181Promiscuous mode is disabled on the interface when
1182it is removed from the bridge.
1183.It Cm maxaddr Ar size
1184Set the size of the bridge address cache to
1185.Ar size .
1186The default is 100 entries.
1187.It Cm timeout Ar seconds
1188Set the timeout of address cache entries to
1189.Ar seconds
1190seconds.
1191If
1192.Ar seconds
1193is zero, then address cache entries will not be expired.
1194The default is 240 seconds.
1195.It Cm addr
1196Display the addresses that have been learned by the bridge.
1197.It Cm static Ar interface-name Ar address
1198Add a static entry into the address cache pointing to
1199.Ar interface-name .
1200Static entries are never aged out of the cache or re-placed, even if the
1201address is seen on a different interface.
1202.It Cm deladdr Ar address
1203Delete
1204.Ar address
1205from the address cache.
1206.It Cm flush
1207Delete all dynamically-learned addresses from the address cache.
1208.It Cm flushall
1209Delete all addresses, including static addresses, from the address cache.
1210.It Cm discover Ar interface
1211Mark an interface as a
1212.Dq discovering
1213interface.
1214When the bridge has no address cache entry
1215(either dynamic or static)
1216for the destination address of a packet,
1217the bridge will forward the packet to all
1218member interfaces marked as
1219.Dq discovering .
1220This is the default for all interfaces added to a bridge.
1221.It Cm -discover Ar interface
1222Clear the
1223.Dq discovering
1224attribute on a member interface.
1225For packets without the
1226.Dq discovering
1227attribute, the only packets forwarded on the interface are broadcast
1228or multicast packets and packets for which the destination address
1229is known to be on the interface's segment.
1230.It Cm learn Ar interface
1231Mark an interface as a
1232.Dq learning
1233interface.
1234When a packet arrives on such an interface, the source
1235address of the packet is entered into the address cache as being a
1236destination address on the interface's segment.
1237This is the default for all interfaces added to a bridge.
1238.It Cm -learn Ar interface
1239Clear the
1240.Dq learning
1241attribute on a member interface.
1242.\".It Cm span Ar interface
1243.\"Add the interface named by
1244.\".Ar interface
1245.\"as a span port on the bridge.
1246.\"Span ports transmit a copy of every frame received by the bridge.
1247.\"This is most useful for snooping a bridged network passively on
1248.\"another host connected to one of the span ports of the bridge.
1249.\".It Cm -span Ar interface
1250.\"Delete the interface named by
1251.\".Ar interface
1252.\"from the list of span ports of the bridge.
1253.It Cm stp Ar interface
1254Enable Spanning Tree protocol on
1255.Ar interface .
1256The
1257.Xr bridge 4
1258driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
1259Spanning Tree is used to detect and remove loops in a network topology.
1260.It Cm -stp Ar interface
1261Disable Spanning Tree protocol on
1262.Ar interface .
1263This is the default for all interfaces added to a bridge.
1264.It Cm maxage Ar seconds
1265Set the time that a Spanning Tree protocol configuration is valid.
1266The default is 20 seconds.
1267The minimum is 1 second and the maximum is 255 seconds.
1268.It Cm fwddelay Ar seconds
1269Set the time that must pass before an interface begins forwarding
1270packets when Spanning Tree is enabled.
1271The default is 15 seconds.
1272The minimum is 1 second and the maximum is 255 seconds.
1273.It Cm hellotime Ar seconds
1274Set the time between broadcasting of Spanning Tree protocol
1275configuration messages.
1276The default is 2 seconds.
1277The minimum is 1 second and the maximum is 255 seconds.
1278.It Cm priority Ar value
1279Set the bridge priority for Spanning Tree.
1280The default is 32768.
1281The minimum is 0 and the maximum is 65536.
1282.It Cm ifpriority Ar interface Ar value
1283Set the Spanning Tree priority of
1284.Ar interface
1285to
1286.Ar value .
1287The default is 128.
1288The minimum is 0 and the maximum is 255.
1289.It Cm ifpathcost Ar interface Ar value
1290Set the Spanning Tree path cost of
1291.Ar interface
1292to
1293.Ar value .
1294The default is 55.
1295The minimum is 0 and the maximum is 65535.
984263bc
MD
1296.El
1297.Pp
1298The
1299.Nm
1300utility displays the current configuration for a network interface
1301when no optional parameters are supplied.
1302If a protocol family is specified,
1303.Nm
1304will report only the details specific to that protocol family.
1305.Pp
1306If the driver does supports the media selection system, the supported
1307media list will be included in the output.
1308.Pp
1309If the
1310.Fl m
1311flag is passed before an interface name,
1312.Nm
b50e4759 1313will display the capability list and all
984263bc
MD
1314of the supported media for the specified interface.
1315If
1316.Fl L
1317flag is supplied, address lifetime is displayed for IPv6 addresses,
1318as time offset string.
1319.Pp
1320Optionally, the
1321.Fl a
1322flag may be used instead of an interface name.
1323This flag instructs
1324.Nm
1325to display information about all interfaces in the system.
1326The
1327.Fl d
1328flag limits this to interfaces that are down, and
1329.Fl u
1330limits this to interfaces that are up.
1331When no arguments are given,
1332.Fl a
1333is implied.
1334.Pp
1335The
1336.Fl l
1337flag may be used to list all available interfaces on the system, with
1338no other additional information.
1339Use of this flag is mutually exclusive
1340with all other flags and commands, except for
1341.Fl d
1342(only list interfaces that are down)
1343and
1344.Fl u
1345(only list interfaces that are up).
1346.Pp
1347The
55fc9f88
SZ
1348.Fl v
1349flag may be used to get more verbose status for an interface.
1350.Pp
1351The
984263bc
MD
1352.Fl C
1353flag may be used to list all of the interface cloners available on
1354the system, with no additional information.
1355Use of this flag is mutually exclusive with all other flags and commands.
1356.Pp
55fc9f88
SZ
1357The
1358.Fl k
1359flag causes keying information for the interface, if available, to be
1360printed.
1361For example, the values of 802.11 WEP keys will be printed, if accessible to
1362the current user.
1363This information is not printed by default, as it may be considered
1364sensitive.
1365.Pp
984263bc
MD
1366Only the super-user may modify the configuration of a network interface.
1367.Sh NOTES
1368The media selection system is relatively new and only some drivers support
1369it (or have need for it).
1370.Sh DIAGNOSTICS
1371Messages indicating the specified interface does not exist, the
1372requested address is unknown, or the user is not privileged and
1373tried to alter an interface's configuration.
984263bc
MD
1374.Sh SEE ALSO
1375.Xr netstat 1 ,
1376.Xr netintro 4 ,
b50e4759 1377.Xr vlan 4 ,
984263bc
MD
1378.\" .Xr eon 5 ,
1379.Xr rc 8 ,
b50e4759
MD
1380.Xr routed 8 ,
1381.Xr sysctl 8
984263bc
MD
1382.Sh HISTORY
1383The
1384.Nm
1385utility appeared in
1386.Bx 4.2 .
d600454b
SW
1387.Sh BUGS
1388Basic IPv6 node operation requires a link-local address on each
1389interface configured for IPv6.
1390Normally, such an address is automatically configured by the
1391kernel on each interface added to the system; this behaviour may
1392be disabled by setting the sysctl MIB variable
1393.Va net.inet6.ip6.auto_linklocal
1394to 0.
1395.Pp
1396If you delete such an address using
1397.Nm ,
1398the kernel may act very oddly.
1399Do this at your own risk.