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