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