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