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