Remove reference to obsolete brconfig(8) command.
[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 $
55fc9f88 30.\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.10 2006/05/18 14:24:34 sephe Exp $
984263bc 31.\"
55fc9f88 32.Dd May 14, 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.
b50e4759 851.It Cm rtsthreshold Ar length
55fc9f88 852Set the threshold for which
b50e4759
MD
853transmitted frames are preceded by transmission of an
854RTS
855control frame.
856The
857.Ar length
858argument
55fc9f88
SZ
859is the frame size in bytes and must be in the range 1 to 2346.
860Setting
861.Ar length
862to
863.Li 2346 ,
864.Cm any ,
865or
866.Cm -
867disables transmission of RTS frames.
b50e4759 868Not all adaptors support setting the RTS threshold.
55fc9f88
SZ
869.It Cm ssid Ar ssid
870Set the desired Service Set Identifier (aka network name).
871The SSID is a string up to 32 characters
872in length and may be specified as either a normal string or in
873hexadecimal when preceded by
874.Ql 0x .
875Additionally, the SSID may be cleared by setting it to
876.Ql - .
877.It Cm scan
878Initiate a scan of neighboring stations, wait for it to complete, and
879display all stations found.
880Only the super-user can initiate a scan.
881Depending on the capabilities of the APs, the following
882flags can be included in the output:
883.Bl -tag -width 3n
884.It Li E
885Extended Service Set (ESS).
886Indicates that the station is part of an infrastructure network
887(in contrast to an IBSS/ad-hoc network).
888.It Li I
889IBSS/ad-hoc network.
890Indicates that the station is part of an ad-hoc network
891(in contrast to an ESS network).
892.It Li P
893Privacy.
894Data confidentiality is required for all data frames
895exchanged within the BSS.
896This means that this BSS requires the station to
897use cryptographic means such as WEP, TKIP or AES-CCMP to
898encrypt/decrypt data frames being exchanged with others.
899.It Li S
900Short Preamble.
901Indicates that the network is using short preambles (defined
902in 802.11b High Rate/DSSS PHY, short preamble utilizes a
90356 bit sync field in contrast to a 128 bit field used in long
904preamble mode).
905.It Li s
906Short slot time.
907Indicates that the network is using a short slot time.
908.El
909.Pp
910The
911.Cm list scan
912request can be used to show recent scan results without
913initiating a new scan.
914.It Cm stationname Ar name
915Set the name of this station.
916It appears that the station name is not really part of the IEEE 802.11
917protocol though all interfaces seem to support it.
918As such it only
919seems to be meaningful to identical or virtually identical equipment.
920Setting the station name is identical in syntax to setting the SSID.
b50e4759 921.It Cm txpower Ar power
55fc9f88 922Set the power used to transmit frames.
b50e4759
MD
923The
924.Ar power
925argument
926is a unitless value in the range 0 to 100 that is interpreted
927by drivers to derive a device-specific value.
928Out of range values are truncated.
929Typically only a few discreet power settings are available and
930the driver will use the setting closest to the specified value.
931Not all adaptors support changing the transmit power.
984263bc 932.It Cm wepmode Ar mode
55fc9f88 933Set the desired WEP mode.
984263bc
MD
934Not all adaptors support all modes.
935The set of valid modes is
55fc9f88 936.Cm off , on ,
984263bc 937and
55fc9f88 938.Cm mixed .
b50e4759 939The
55fc9f88 940.Cm mixed
984263bc
MD
941mode explicitly tells the adaptor to allow association with access
942points which allow both encrypted and unencrypted traffic.
943On these adaptors,
55fc9f88 944.Cm on
984263bc
MD
945means that the access point must only allow encrypted connections.
946On other adaptors,
55fc9f88 947.Cm on
984263bc 948is generally another name for
55fc9f88 949.Cm mixed .
984263bc
MD
950Modes are case insensitive.
951.It Cm weptxkey Ar index
55fc9f88
SZ
952Set the WEP key to be used for transmission.
953This is the same as setting the default transmission key with
954.Cm deftxkey .
984263bc 955.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
55fc9f88 956Set the selected WEP key.
984263bc
MD
957If an
958.Ar index
959is not given, key 1 is set.
960A WEP key will be either 5 or 13
961characters (40 or 104 bits) depending of the local network and the
962capabilities of the adaptor.
963It may be specified either as a plain
55fc9f88 964string or as a string of hexadecimal digits preceded by
984263bc
MD
965.Ql 0x .
966For maximum portability, hex keys are recommended;
967the mapping of text keys to WEP encryption is usually driver-specific.
968In particular, the
969.Tn Windows
970drivers do this mapping differently to
b50e4759 971.Fx .
984263bc
MD
972A key may be cleared by setting it to
973.Ql - .
974If WEP is supported then there are at least four keys.
975Some adaptors support more than four keys.
976If that is the case, then the first four keys
977(1-4) will be the standard temporary keys and any others will be adaptor
978specific keys such as permanent keys stored in NVRAM.
55fc9f88
SZ
979.It Cm wme
980Enable Wireless Multimedia Extensions (WME) support, if available,
981for the specified interface.
982WME is a subset of the IEEE 802.11e standard to support the
983efficient communication of realtime and multimedia data.
984To disable WME support, use
985.Fl wme .
986.Pp
987The following parameters are meaningful only when WME support is in use.
988Parameters are specified per-AC (Access Category) and
989split into those that are used by a station when acting
990as an access point and those for client stations in the BSS.
991The latter are received from the access point and may not be changed
992(at the station).
993The following Access Categories are recognized:
994.Pp
995.Bl -tag -width ".Cm AC_BK" -compact
996.It Cm AC_BE
997(or
998.Cm BE )
999best effort delivery,
1000.It Cm AC_BK
1001(or
1002.Cm BK )
1003background traffic,
1004.It Cm AC_VI
1005(or
1006.Cm VI )
1007video traffic,
1008.It Cm AC_VO
1009(or
1010.Cm VO )
1011voice traffic.
1012.El
1013.Pp
1014AC parameters are case-insensitive.
1015Traffic classification is done in the operating system using the
1016vlan priority associated with data frames or the
1017ToS (Type of Service) indication in IP-encapsulated frames.
1018If neither information is present, traffic is assigned to the
1019Best Effort (BE) category.
1020.Bl -tag -width indent
1021.It Cm ack Ar ac
1022Set the ACK policy for QoS transmissions by the local station;
1023this controls whether or not data frames transmitted by a station
1024require an ACK response from the receiving station.
1025To disable waiting for an ACK use
1026.Fl ack .
1027This parameter is applied only to the local station.
1028.It Cm acm Ar ac
1029Enable the Admission Control Mandatory (ACM) mechanism
1030for transmissions by the local station.
1031To disable the ACM use
1032.Fl acm .
1033On stations in a BSS this parameter is read-only and indicates
1034the setting received from the access point.
1035NB: ACM is not supported right now.
1036.It Cm aifs Ar ac Ar count
1037Set the Arbitration Inter Frame Spacing (AIFS)
1038channel access parameter to use for transmissions
1039by the local station.
1040On stations in a BSS this parameter is read-only and indicates
1041the setting received from the access point.
1042.It Cm cwmin Ar ac Ar count
1043Set the CWmin channel access parameter to use for transmissions
1044by the local station.
1045On stations in a BSS this parameter is read-only and indicates
1046the setting received from the access point.
1047.It Cm cwmax Ar ac Ar count
1048Set the CWmax channel access parameter to use for transmissions
1049by the local station.
1050On stations in a BSS this parameter is read-only and indicates
1051the setting received from the access point.
1052.It Cm txoplimit Ar ac Ar limit
1053Set the Transmission Opportunity Limit channel access parameter
1054to use for transmissions by the local station.
1055This parameter defines an interval of time when a WME station
1056has the right to initiate transmissions onto the wireless medium.
1057On stations in a BSS this parameter is read-only and indicates
1058the setting received from the access point.
1059.It Cm bss:aifs Ar ac Ar count
1060Set the AIFS channel access parameter to send to stations in a BSS.
1061This parameter is meaningful only when operating in ap mode.
1062.It Cm bss:cwmin Ar ac Ar count
1063Set the CWmin channel access parameter to send to stations in a BSS.
1064This parameter is meaningful only when operating in ap mode.
1065.It Cm bss:cwmax Ar ac Ar count
1066Set the CWmax channel access parameter to send to stations in a BSS.
1067This parameter is meaningful only when operating in ap mode.
1068.It Cm bss:txoplimit Ar ac Ar limit
1069Set the TxOpLimit channel access parameter to send to stations in a BSS.
1070This parameter is meaningful only when operating in ap mode.
1071.El
1072.El
1073.Pp
1074The following parameters support an optional access control list
1075feature available with some adaptors when operating in ap mode; see
1076.Xr wlan_acl 4 .
1077This facility allows an access point to accept/deny association
1078requests based on the MAC address of the station.
1079Note that this feature does not significantly enhance security
1080as MAC address spoofing is easy to do.
1081.Bl -tag -width indent
1082.It Cm mac:add Ar address
1083Add the specified MAC address to the database.
1084Depending on the policy setting association requests from the
1085specified station will be allowed or denied.
1086.It Cm mac:allow
1087Set the ACL policy to permit association only by
1088stations registered in the database.
1089.It Cm mac:del Ar address
1090Delete the specified MAC address from the database.
1091.It Cm mac:deny
1092Set the ACL policy to deny association only by
1093stations registered in the database.
1094.It Cm mac:kick Ar address
1095Force the specified station to be deauthenticated.
1096This typically is done to block a station after updating the
1097address database.
1098.It Cm mac:open
1099Set the ACL policy to allow all stations to associate.
1100.It Cm mac:flush
1101Delete all entries in the database.
1102.El
1103.Pp
1104The following parameters are for compatibility with other systems:
1105.Bl -tag -width indent
1106.It Cm nwid Ar ssid
1107Another name for the
1108.Cm ssid
1109parameter.
1110Included for
1111.Nx
1112compatibility.
1113.It Cm station Ar name
1114Another name for the
1115.Cm stationname
1116parameter.
1117Included for
1118.Bsx
1119compatibility.
984263bc
MD
1120.It Cm wep
1121Another way of saying
1122.Cm wepmode on .
1123Included for
1124.Bsx
1125compatibility.
1126.It Fl wep
1127Another way of saying
1128.Cm wepmode off .
1129Included for
1130.Bsx
1131compatibility.
1132.It Cm nwkey key
1133Another way of saying:
984263bc 1134.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
984263bc
MD
1135Included for
1136.Nx
1137compatibility.
1138.It Cm nwkey Xo
1139.Sm off
1140.Ar n : k1 , k2 , k3 , k4
1141.Sm on
1142.Xc
1143Another way of saying
984263bc 1144.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
984263bc
MD
1145Included for
1146.Nx
1147compatibility.
1148.It Fl nwkey
1149Another way of saying
1150.Cm wepmode off .
984263bc
MD
1151Included for
1152.Nx
1153compatibility.
55fc9f88
SZ
1154.\" Bridge only
1155.El
1156.Pp
1157The following parameters are specific to bridge interfaces:
1158.Bl -tag -width indent
1159.It Cm addm Ar interface
1160Add the interface named by
1161.Ar interface
1162as a member of the bridge.
1163The interface is put into promiscuous mode
1164so that it can receive every packet sent on the network.
1165.It Cm deletem Ar interface
1166Remove the interface named by
1167.Ar interface
1168from the bridge.
1169Promiscuous mode is disabled on the interface when
1170it is removed from the bridge.
1171.It Cm maxaddr Ar size
1172Set the size of the bridge address cache to
1173.Ar size .
1174The default is 100 entries.
1175.It Cm timeout Ar seconds
1176Set the timeout of address cache entries to
1177.Ar seconds
1178seconds.
1179If
1180.Ar seconds
1181is zero, then address cache entries will not be expired.
1182The default is 240 seconds.
1183.It Cm addr
1184Display the addresses that have been learned by the bridge.
1185.It Cm static Ar interface-name Ar address
1186Add a static entry into the address cache pointing to
1187.Ar interface-name .
1188Static entries are never aged out of the cache or re-placed, even if the
1189address is seen on a different interface.
1190.It Cm deladdr Ar address
1191Delete
1192.Ar address
1193from the address cache.
1194.It Cm flush
1195Delete all dynamically-learned addresses from the address cache.
1196.It Cm flushall
1197Delete all addresses, including static addresses, from the address cache.
1198.It Cm discover Ar interface
1199Mark an interface as a
1200.Dq discovering
1201interface.
1202When the bridge has no address cache entry
1203(either dynamic or static)
1204for the destination address of a packet,
1205the bridge will forward the packet to all
1206member interfaces marked as
1207.Dq discovering .
1208This is the default for all interfaces added to a bridge.
1209.It Cm -discover Ar interface
1210Clear the
1211.Dq discovering
1212attribute on a member interface.
1213For packets without the
1214.Dq discovering
1215attribute, the only packets forwarded on the interface are broadcast
1216or multicast packets and packets for which the destination address
1217is known to be on the interface's segment.
1218.It Cm learn Ar interface
1219Mark an interface as a
1220.Dq learning
1221interface.
1222When a packet arrives on such an interface, the source
1223address of the packet is entered into the address cache as being a
1224destination address on the interface's segment.
1225This is the default for all interfaces added to a bridge.
1226.It Cm -learn Ar interface
1227Clear the
1228.Dq learning
1229attribute on a member interface.
1230.\".It Cm span Ar interface
1231.\"Add the interface named by
1232.\".Ar interface
1233.\"as a span port on the bridge.
1234.\"Span ports transmit a copy of every frame received by the bridge.
1235.\"This is most useful for snooping a bridged network passively on
1236.\"another host connected to one of the span ports of the bridge.
1237.\".It Cm -span Ar interface
1238.\"Delete the interface named by
1239.\".Ar interface
1240.\"from the list of span ports of the bridge.
1241.It Cm stp Ar interface
1242Enable Spanning Tree protocol on
1243.Ar interface .
1244The
1245.Xr bridge 4
1246driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
1247Spanning Tree is used to detect and remove loops in a network topology.
1248.It Cm -stp Ar interface
1249Disable Spanning Tree protocol on
1250.Ar interface .
1251This is the default for all interfaces added to a bridge.
1252.It Cm maxage Ar seconds
1253Set the time that a Spanning Tree protocol configuration is valid.
1254The default is 20 seconds.
1255The minimum is 1 second and the maximum is 255 seconds.
1256.It Cm fwddelay Ar seconds
1257Set the time that must pass before an interface begins forwarding
1258packets when Spanning Tree is enabled.
1259The default is 15 seconds.
1260The minimum is 1 second and the maximum is 255 seconds.
1261.It Cm hellotime Ar seconds
1262Set the time between broadcasting of Spanning Tree protocol
1263configuration messages.
1264The default is 2 seconds.
1265The minimum is 1 second and the maximum is 255 seconds.
1266.It Cm priority Ar value
1267Set the bridge priority for Spanning Tree.
1268The default is 32768.
1269The minimum is 0 and the maximum is 65536.
1270.It Cm ifpriority Ar interface Ar value
1271Set the Spanning Tree priority of
1272.Ar interface
1273to
1274.Ar value .
1275The default is 128.
1276The minimum is 0 and the maximum is 255.
1277.It Cm ifpathcost Ar interface Ar value
1278Set the Spanning Tree path cost of
1279.Ar interface
1280to
1281.Ar value .
1282The default is 55.
1283The minimum is 0 and the maximum is 65535.
984263bc
MD
1284.El
1285.Pp
1286The
1287.Nm
1288utility displays the current configuration for a network interface
1289when no optional parameters are supplied.
1290If a protocol family is specified,
1291.Nm
1292will report only the details specific to that protocol family.
1293.Pp
1294If the driver does supports the media selection system, the supported
1295media list will be included in the output.
1296.Pp
1297If the
1298.Fl m
1299flag is passed before an interface name,
1300.Nm
b50e4759 1301will display the capability list and all
984263bc
MD
1302of the supported media for the specified interface.
1303If
1304.Fl L
1305flag is supplied, address lifetime is displayed for IPv6 addresses,
1306as time offset string.
1307.Pp
1308Optionally, the
1309.Fl a
1310flag may be used instead of an interface name.
1311This flag instructs
1312.Nm
1313to display information about all interfaces in the system.
1314The
1315.Fl d
1316flag limits this to interfaces that are down, and
1317.Fl u
1318limits this to interfaces that are up.
1319When no arguments are given,
1320.Fl a
1321is implied.
1322.Pp
1323The
1324.Fl l
1325flag may be used to list all available interfaces on the system, with
1326no other additional information.
1327Use of this flag is mutually exclusive
1328with all other flags and commands, except for
1329.Fl d
1330(only list interfaces that are down)
1331and
1332.Fl u
1333(only list interfaces that are up).
1334.Pp
1335The
55fc9f88
SZ
1336.Fl v
1337flag may be used to get more verbose status for an interface.
1338.Pp
1339The
984263bc
MD
1340.Fl C
1341flag may be used to list all of the interface cloners available on
1342the system, with no additional information.
1343Use of this flag is mutually exclusive with all other flags and commands.
1344.Pp
55fc9f88
SZ
1345The
1346.Fl k
1347flag causes keying information for the interface, if available, to be
1348printed.
1349For example, the values of 802.11 WEP keys will be printed, if accessible to
1350the current user.
1351This information is not printed by default, as it may be considered
1352sensitive.
1353.Pp
984263bc
MD
1354Only the super-user may modify the configuration of a network interface.
1355.Sh NOTES
1356The media selection system is relatively new and only some drivers support
1357it (or have need for it).
1358.Sh DIAGNOSTICS
1359Messages indicating the specified interface does not exist, the
1360requested address is unknown, or the user is not privileged and
1361tried to alter an interface's configuration.
984263bc
MD
1362.Sh SEE ALSO
1363.Xr netstat 1 ,
1364.Xr netintro 4 ,
b50e4759 1365.Xr vlan 4 ,
984263bc
MD
1366.\" .Xr eon 5 ,
1367.Xr rc 8 ,
b50e4759
MD
1368.Xr routed 8 ,
1369.Xr sysctl 8
984263bc
MD
1370.Sh HISTORY
1371The
1372.Nm
1373utility appeared in
1374.Bx 4.2 .
d600454b
SW
1375.Sh BUGS
1376Basic IPv6 node operation requires a link-local address on each
1377interface configured for IPv6.
1378Normally, such an address is automatically configured by the
1379kernel on each interface added to the system; this behaviour may
1380be disabled by setting the sysctl MIB variable
1381.Va net.inet6.ip6.auto_linklocal
1382to 0.
1383.Pp
1384If you delete such an address using
1385.Nm ,
1386the kernel may act very oddly.
1387Do this at your own risk.