xref: /freebsd/sbin/ifconfig/ifconfig.8 (revision 262e143bd46171a6415a5b28af260a5efa2a3db8)
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 October 1, 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 chanlist Ar channels
574Set the desired channels to use when scanning for access
575points, neighbors in an IBSS network, or looking for unoccupied
576channels when operating as an access point.
577The set of channels is specified as a comma-separated list with
578each element in the list representing either a single channel number or a range
579of the form
580.Dq Li a-b .
581Channel numbers must be in the range 1 to 255 and be permissible
582according to the operating characteristics of the device.
583.It Cm channel Ar number
584Set a single desired channel.
585Channels range from 1 to 255, but the exact selection available
586depends on the region your adaptor was manufactured for.
587Setting
588the channel to
589.Li 0 ,
590.Cm any ,
591or
592.Cm -
593will give you the default for your adaptor.
594Some
595adaptors ignore this setting unless you are in ad-hoc mode.
596Alternatively the frequency, in megahertz, may be specified
597instead of the channel number.
598.It Cm dtimperiod Ar period
599Set the
600DTIM
601period for transmitting buffered multicast data frames when
602operating in ap mode.
603The
604.Ar period
605specifies the number of beacon intervals between DTIM
606and must be in the range 1 to 15.
607By default DTIM is 1 (i.e., DTIM occurs at each beacon).
608.It Cm fragthreshold Ar length
609Set the threshold for which transmitted frames are broken into fragments.
610The
611.Ar length
612argument is the frame size in bytes and must be in the range 256 to 2346.
613Setting
614.Ar length
615to
616.Li 2346 ,
617.Cm any ,
618or
619.Cm -
620disables transmit fragmentation.
621Not all adaptors honor the fragmentation threshold.
622.It Cm hidessid
623When operating as an access point, do not broadcast the SSID
624in beacon frames or respond to probe request frames unless
625they are directed to the ap (i.e., they include the ap's SSID).
626By default, the SSID is included in beacon frames and
627undirected probe request frames are answered.
628To re-enable the broadcast of the SSID etc., use
629.Fl hidessid .
630.It Cm list active
631Display the list of channels available for use taking into account
632any restrictions set with the
633.Cm chanlist
634and
635.Cm channel
636directives.
637.It Cm list caps
638Display the adaptor's capabilities, including the operating
639modes supported.
640.It Cm list chan
641Display the list of channels available for use.
642.Cm list freq
643is another way of requesting this information.
644.It Cm list mac
645Display the current MAC Access Control List state.
646Each address is prefixed with a character that indicates the
647current policy applied to it:
648.Ql +
649indicates the address is allowed access,
650.Ql -
651indicates the address is denied access,
652.Ql *
653indicates the address is present but the current policy open
654(so the ACL is not consulted).
655.It Cm list scan
656Display the access points and/or ad-hoc neighbors
657located in the vicinity.
658This information may be updated automatically by the adaptor
659and/or with a
660.Cm scan
661request.
662.Cm list ap
663is another way of requesting this information.
664.It Cm list sta
665When operating as an access point display the stations that are
666currently associated.
667When operating in ad-hoc mode display stations identified as
668neighbors in the IBSS.
669.It Cm list wme
670Display the current parameters to use when operating in WME mode.
671When WME mode is enabled for an adaptor this information will be
672displayed with the regular status; this command is mostly useful
673for examining parameters when WME mode is disabled.
674See the description of the
675.Cm wme
676directive for information on the various parameters.
677.It Cm powersave
678Enable powersave operation.
679When operating as a client, the station will conserve power by
680periodically turning off the radio and listening for
681messages from the access point telling it there are packets waiting.
682The station must then retrieve the packets.
683When operating as an access point, the station must honor power
684save operation of associated clients.
685Not all devices support power save operation, either as a client
686or as an access point.
687Use
688.Fl powersave
689to disable powersave operation.
690.It Cm powersavesleep Ar sleep
691Set the desired max powersave sleep time in milliseconds.
692.It Cm protmode Ar technique
693For interfaces operating in 802.11g, use the specified
694.Ar technique
695for protecting OFDM frames in a mixed 11b/11g network.
696The set of valid techniques is
697.Cm off , cts
698(CTS to self),
699and
700.Cm rtscts
701(RTS/CTS).
702Technique names are case insensitive.
703.It Cm pureg
704When operating as an access point in 802.11g mode allow only
70511g-capable stations to associate (11b-only stations are not
706permitted to associate).
707To allow both 11g and 11b-only stations to associate, use
708.Fl pureg .
709.It Cm roaming Ar mode
710When operating as a station, control how the system will
711behave when communication with the current access point
712is broken.
713The
714.Ar mode
715argument may be one of
716.Cm device
717(leave it to the hardware device to decide),
718.Cm auto
719(handle either in the device or the operating system\[em]as appropriate),
720.Cm manual
721(do nothing until explicitly instructed).
722By default, the device is left to handle this if it is
723capable; otherwise, the operating system will automatically
724attempt to reestablish communication.
725Manual mode is mostly useful when an application wants to
726control the selection of an access point.
727.It Cm rtsthreshold Ar length
728Set the threshold for which
729transmitted frames are preceded by transmission of an
730RTS
731control frame.
732The
733.Ar length
734argument
735is the frame size in bytes and must be in the range 1 to 2346.
736Setting
737.Ar length
738to
739.Li 2346 ,
740.Cm any ,
741or
742.Cm -
743disables transmission of RTS frames.
744Not all adaptors support setting the RTS threshold.
745.It Cm ssid Ar ssid
746Set the desired Service Set Identifier (aka network name).
747The SSID is a string up to 32 characters
748in length and may be specified as either a normal string or in
749hexadecimal when preceded by
750.Ql 0x .
751Additionally, the SSID may be cleared by setting it to
752.Ql - .
753.It Cm scan
754Initiate a scan of neighboring stations, wait for it to complete, and
755display all stations found.
756Only the super-user can initiate a scan.
757Depending on the capabilities of the APs, the following
758flags can be included in the output:
759.Bl -tag -width 3n
760.It Li E
761Extended Service Set (ESS).
762Indicates that the station is part of an infrastructure network
763(in contrast to an IBSS/ad-hoc network).
764.It Li I
765IBSS/ad-hoc network.
766Indicates that the station is part of an ad-hoc network
767(in contrast to an ESS network).
768.It Li P
769Privacy.
770Data confidentiality is required for all data frames
771exchanged within the BSS.
772This means that this BSS requires the station to
773use cryptographic means such as WEP, TKIP or AES-CCMP to
774encrypt/decrypt data frames being exchanged with others.
775.It Li S
776Short Preamble.
777Indicates that the network is using short preambles (defined
778in 802.11b High Rate/DSSS PHY, short preamble utilizes a
77956 bit sync field in contrast to a 128 bit field used in long
780preamble mode).
781.It Li s
782Short slot time.
783Indicates that the network is using a short slot time.
784.El
785.Pp
786The
787.Cm list scan
788request can be used to show recent scan results without
789initiating a new scan.
790.It Cm stationname Ar name
791Set the name of this station.
792It appears that the station name is not really part of the IEEE 802.11
793protocol though all interfaces seem to support it.
794As such it only
795seems to be meaningful to identical or virtually identical equipment.
796Setting the station name is identical in syntax to setting the SSID.
797.It Cm txpower Ar power
798Set the power used to transmit frames.
799The
800.Ar power
801argument
802is a unitless value in the range 0 to 100 that is interpreted
803by drivers to derive a device-specific value.
804Out of range values are truncated.
805Typically only a few discreet power settings are available and
806the driver will use the setting closest to the specified value.
807Not all adaptors support changing the transmit power.
808.It Cm wepmode Ar mode
809Set the desired WEP mode.
810Not all adaptors support all modes.
811The set of valid modes is
812.Cm off , on ,
813and
814.Cm mixed .
815The
816.Cm mixed
817mode explicitly tells the adaptor to allow association with access
818points which allow both encrypted and unencrypted traffic.
819On these adaptors,
820.Cm on
821means that the access point must only allow encrypted connections.
822On other adaptors,
823.Cm on
824is generally another name for
825.Cm mixed .
826Modes are case insensitive.
827.It Cm weptxkey Ar index
828Set the WEP key to be used for transmission.
829.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
830Set the selected WEP key.
831If an
832.Ar index
833is not given, key 1 is set.
834A WEP key will be either 5 or 13
835characters (40 or 104 bits) depending of the local network and the
836capabilities of the adaptor.
837It may be specified either as a plain
838string or as a string of hexadecimal digits preceded by
839.Ql 0x .
840For maximum portability, hex keys are recommended;
841the mapping of text keys to WEP encryption is usually driver-specific.
842In particular, the
843.Tn Windows
844drivers do this mapping differently to
845.Fx .
846A key may be cleared by setting it to
847.Ql - .
848If WEP is supported then there are at least four keys.
849Some adaptors support more than four keys.
850If that is the case, then the first four keys
851(1-4) will be the standard temporary keys and any others will be adaptor
852specific keys such as permanent keys stored in NVRAM.
853.It Cm wme
854Enable Wireless Multimedia Extensions (WME) support, if available,
855for the specified interface.
856WME is a subset of the IEEE 802.11e standard to support the
857efficient communication of realtime and multimedia data.
858To disable WME support, use
859.Fl wme .
860.Pp
861The following parameters are meaningful only when WME support is in use.
862Parameters are specified per-AC (Access Category) and
863split into those that are used by a station when acting
864as an access point and those for client stations in the BSS.
865The latter are received from the access point and may not be changed
866(at the station).
867The following Access Categories are recognized:
868.Pp
869.Bl -tag -width ".Cm AC_BK" -compact
870.It Cm AC_BE
871(or
872.Cm BE )
873best effort delivery,
874.It Cm AC_BK
875(or
876.Cm BK )
877background traffic,
878.It Cm AC_VI
879(or
880.Cm VI )
881video traffic,
882.It Cm AC_VO
883(or
884.Cm VO )
885voice traffic.
886.El
887.Pp
888AC parameters are case-insensitive.
889Traffic classification is done in the operating system using the
890vlan priority associated with data frames or the
891ToS (Type of Service) indication in IP-encapsulated frames.
892If neither information is present, traffic is assigned to the
893Best Effort (BE) category.
894.Bl -tag -width indent
895.It Cm ack Ar ac
896Set the ACK policy for QoS transmissions by the local station;
897this controls whether or not data frames transmitted by a station
898require an ACK response from the receiving station.
899To disable waiting for an ACK use
900.Fl ack .
901This parameter is applied only to the local station.
902.It Cm acm Ar ac
903Enable the Admission Control Mandatory (ACM) mechanism
904for transmissions by the local station.
905To disable the ACM use
906.Fl acm .
907On stations in a BSS this parameter is read-only and indicates
908the setting received from the access point.
909NB: ACM is not supported right now.
910.It Cm aifs Ar ac Ar count
911Set the Arbitration Inter Frame Spacing (AIFS)
912channel access parameter to use for transmissions
913by the local station.
914On stations in a BSS this parameter is read-only and indicates
915the setting received from the access point.
916.It Cm cwmin Ar ac Ar count
917Set the CWmin channel access parameter to use for transmissions
918by the local station.
919On stations in a BSS this parameter is read-only and indicates
920the setting received from the access point.
921.It Cm cwmax Ar ac Ar count
922Set the CWmax channel access parameter to use for transmissions
923by the local station.
924On stations in a BSS this parameter is read-only and indicates
925the setting received from the access point.
926.It Cm txoplimit Ar ac Ar limit
927Set the Transmission Opportunity Limit channel access parameter
928to use for transmissions by the local station.
929This parameter defines an interval of time when a WME station
930has the right to initiate transmissions onto the wireless medium.
931On stations in a BSS this parameter is read-only and indicates
932the setting received from the access point.
933.It Cm bss:aifs Ar ac Ar count
934Set the AIFS channel access parameter to send to stations in a BSS.
935This parameter is meaningful only when operating in ap mode.
936.It Cm bss:cwmin Ar ac Ar count
937Set the CWmin channel access parameter to send to stations in a BSS.
938This parameter is meaningful only when operating in ap mode.
939.It Cm bss:cwmax Ar ac Ar count
940Set the CWmax channel access parameter to send to stations in a BSS.
941This parameter is meaningful only when operating in ap mode.
942.It Cm bss:txoplimit Ar ac Ar limit
943Set the TxOpLimit channel access parameter to send to stations in a BSS.
944This parameter is meaningful only when operating in ap mode.
945.El
946.El
947.Pp
948The following parameters support an optional access control list
949feature available with some adaptors when operating in ap mode; see
950.Xr wlan_acl 4 .
951This facility allows an access point to accept/deny association
952requests based on the MAC address of the station.
953Note that this feature does not significantly enhance security
954as MAC address spoofing is easy to do.
955.Bl -tag -width indent
956.It Cm mac:add Ar address
957Add the specified MAC address to the database.
958Depending on the policy setting association requests from the
959specified station will be allowed or denied.
960.It Cm mac:allow
961Set the ACL policy to permit association only by
962stations registered in the database.
963.It Cm mac:del
964Delete the specified MAC address from the database.
965.It Cm mac:deny
966Set the ACL policy to deny association only by
967stations registered in the database.
968.It Cm mac:kick
969Force the specified station to be deauthenticated.
970This typically is done to block a station after updating the
971address database.
972.It Cm mac:open
973Set the ACL policy to allow all stations to associate.
974.It Cm mac:flush
975Delete all entries in the database.
976.El
977.Pp
978The following parameters are for compatibility with other systems:
979.Bl -tag -width indent
980.It Cm nwid Ar ssid
981Another name for the
982.Cm ssid
983parameter.
984Included for
985.Nx
986compatibility.
987.It Cm station Ar name
988Another name for the
989.Cm stationname
990parameter.
991Included for
992.Bsx
993compatibility.
994.It Cm wep
995Another way of saying
996.Cm wepmode on .
997Included for
998.Bsx
999compatibility.
1000.It Fl wep
1001Another way of saying
1002.Cm wepmode off .
1003Included for
1004.Bsx
1005compatibility.
1006.It Cm nwkey key
1007Another way of saying:
1008.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
1009Included for
1010.Nx
1011compatibility.
1012.It Cm nwkey Xo
1013.Sm off
1014.Ar n : k1 , k2 , k3 , k4
1015.Sm on
1016.Xc
1017Another way of saying
1018.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
1019Included for
1020.Nx
1021compatibility.
1022.It Fl nwkey
1023Another way of saying
1024.Cm wepmode off .
1025Included for
1026.Nx
1027compatibility.
1028.El
1029.Pp
1030The following parameters are specific to bridge interfaces:
1031.Bl -tag -width indent
1032.It Cm addm Ar interface
1033Add the interface named by
1034.Ar interface
1035as a member of the bridge.
1036The interface is put into promiscuous mode
1037so that it can receive every packet sent on the network.
1038.It Cm deletem Ar interface
1039Remove the interface named by
1040.Ar interface
1041from the bridge.
1042Promiscuous mode is disabled on the interface when
1043it is removed from the bridge.
1044.It Cm maxaddr Ar size
1045Set the size of the bridge address cache to
1046.Ar size .
1047The default is 100 entries.
1048.It Cm timeout Ar seconds
1049Set the timeout of address cache entries to
1050.Ar seconds
1051seconds.
1052If
1053.Ar seconds
1054is zero, then address cache entries will not be expired.
1055The default is 240 seconds.
1056.It Cm addr
1057Display the addresses that have been learned by the bridge.
1058.It Cm static Ar interface-name Ar address
1059Add a static entry into the address cache pointing to
1060.Ar interface-name .
1061Static entries are never aged out of the cache or re-placed, even if the
1062address is seen on a different interface.
1063.It Cm deladdr Ar address
1064Delete
1065.Ar address
1066from the address cache.
1067.It Cm flush
1068Delete all dynamically-learned addresses from the address cache.
1069.It Cm flushall
1070Delete all addresses, including static addresses, from the address cache.
1071.It Cm discover Ar interface
1072Mark an interface as a
1073.Dq discovering
1074interface.
1075When the bridge has no address cache entry
1076(either dynamic or static)
1077for the destination address of a packet,
1078the bridge will forward the packet to all
1079member interfaces marked as
1080.Dq discovering .
1081This is the default for all interfaces added to a bridge.
1082.It Cm -discover Ar interface
1083Clear the
1084.Dq discovering
1085attribute on a member interface.
1086For packets without the
1087.Dq discovering
1088attribute, the only packets forwarded on the interface are broadcast
1089or multicast packets and packets for which the destination address
1090is known to be on the interface's segment.
1091.It Cm learn Ar interface
1092Mark an interface as a
1093.Dq learning
1094interface.
1095When a packet arrives on such an interface, the source
1096address of the packet is entered into the address cache as being a
1097destination address on the interface's segment.
1098This is the default for all interfaces added to a bridge.
1099.It Cm -learn Ar interface
1100Clear the
1101.Dq learning
1102attribute on a member interface.
1103.It Cm stp Ar interface
1104Enable Spanning Tree protocol on
1105.Ar interface .
1106The
1107.Xr if_bridge 4
1108driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
1109Spanning Tree is used to detect and remove loops in a network topology.
1110.It Cm -stp Ar interface
1111Disable Spanning Tree protocol on
1112.Ar interface .
1113This is the default for all interfaces added to a bridge.
1114.It Cm maxage Ar seconds
1115Set the time that a Spanning Tree protocol configuration is valid.
1116The default is 20 seconds.
1117The minimum is 1 second and the maximum is 255 seconds.
1118.It Cm fwddelay Ar seconds
1119Set the time that must pass before an interface begins forwarding
1120packets when Spanning Tree is enabled.
1121The default is 15 seconds.
1122The minimum is 1 second and the maximum is 255 seconds.
1123.It Cm hellotime Ar seconds
1124Set the time between broadcasting of Spanning Tree protocol
1125configuration messages.
1126The default is 2 seconds.
1127The minimum is 1 second and the maximum is 255 seconds.
1128.It Cm priority Ar value
1129Set the bridge priority for Spanning Tree.
1130The default is 32768.
1131The minimum is 0 and the maximum is 65536.
1132.It Cm ifpriority Ar interface Ar value
1133Set the Spanning Tree priority of
1134.Ar interface
1135to
1136.Ar value .
1137The default is 128.
1138The minimum is 0 and the maximum is 255.
1139.It Cm ifpathcost Ar interface Ar value
1140Set the Spanning Tree path cost of
1141.Ar interface
1142to
1143.Ar value .
1144The default is 55.
1145The minimum is 0 and the maximum is 65535.
1146.El
1147.Pp
1148The following parameters are specific to IP tunnel interfaces,
1149.Xr gif 4 :
1150.Bl -tag -width indent
1151.It Cm tunnel Ar src_addr dest_addr
1152Configure the physical source and destination address for IP tunnel
1153interfaces.
1154The arguments
1155.Ar src_addr
1156and
1157.Ar dest_addr
1158are interpreted as the outer source/destination for the encapsulating
1159IPv4/IPv6 header.
1160.It Fl tunnel
1161Unconfigure the physical source and destination address for IP tunnel
1162interfaces previously configured with
1163.Cm tunnel .
1164.It Cm deletetunnel
1165Another name for the
1166.Fl tunnel
1167parameter.
1168.El
1169.Pp
1170The following parameters are specific to
1171.Xr vlan 4
1172interfaces:
1173.Bl -tag -width indent
1174.It Cm vlan Ar vlan_tag
1175Set the VLAN tag value to
1176.Ar vlan_tag .
1177This value is a 16-bit number which is used to create an 802.1Q
1178VLAN header for packets sent from the
1179.Xr vlan 4
1180interface.
1181Note that
1182.Cm vlan
1183and
1184.Cm vlandev
1185must both be set at the same time.
1186.It Cm vlandev Ar iface
1187Associate the physical interface
1188.Ar iface
1189with a
1190.Xr vlan 4
1191interface.
1192Packets transmitted through the
1193.Xr vlan 4
1194interface will be
1195diverted to the specified physical interface
1196.Ar iface
1197with 802.1Q VLAN encapsulation.
1198Packets with 802.1Q encapsulation received
1199by the parent interface with the correct VLAN tag will be diverted to
1200the associated
1201.Xr vlan 4
1202pseudo-interface.
1203The
1204.Xr vlan 4
1205interface is assigned a
1206copy of the parent interface's flags and the parent's ethernet address.
1207The
1208.Cm vlandev
1209and
1210.Cm vlan
1211must both be set at the same time.
1212If the
1213.Xr vlan 4
1214interface already has
1215a physical interface associated with it, this command will fail.
1216To
1217change the association to another physical interface, the existing
1218association must be cleared first.
1219.Pp
1220Note: if the hardware tagging capability
1221is set on the parent interface, the
1222.Xr vlan 4
1223pseudo
1224interface's behavior changes:
1225the
1226.Xr vlan 4
1227interface recognizes that the
1228parent interface supports insertion and extraction of VLAN tags on its
1229own (usually in firmware) and that it should pass packets to and from
1230the parent unaltered.
1231.It Fl vlandev Op Ar iface
1232If the driver is a
1233.Xr vlan 4
1234pseudo device, disassociate the parent interface from it.
1235This breaks the link between the
1236.Xr vlan 4
1237interface and its parent,
1238clears its VLAN tag, flags and its link address and shuts the interface down.
1239The
1240.Ar iface
1241argument is useless and hence deprecated.
1242.El
1243.Pp
1244The
1245.Nm
1246utility displays the current configuration for a network interface
1247when no optional parameters are supplied.
1248If a protocol family is specified,
1249.Nm
1250will report only the details specific to that protocol family.
1251.Pp
1252If the
1253.Fl m
1254flag is passed before an interface name,
1255.Nm
1256will display the capability list and all
1257of the supported media for the specified interface.
1258If
1259.Fl L
1260flag is supplied, address lifetime is displayed for IPv6 addresses,
1261as time offset string.
1262.Pp
1263Optionally, the
1264.Fl a
1265flag may be used instead of an interface name.
1266This flag instructs
1267.Nm
1268to display information about all interfaces in the system.
1269The
1270.Fl d
1271flag limits this to interfaces that are down, and
1272.Fl u
1273limits this to interfaces that are up.
1274When no arguments are given,
1275.Fl a
1276is implied.
1277.Pp
1278The
1279.Fl l
1280flag may be used to list all available interfaces on the system, with
1281no other additional information.
1282Use of this flag is mutually exclusive
1283with all other flags and commands, except for
1284.Fl d
1285(only list interfaces that are down)
1286and
1287.Fl u
1288(only list interfaces that are up).
1289.Pp
1290The
1291.Fl v
1292flag may be used to get more verbose status for an interface.
1293.Pp
1294The
1295.Fl C
1296flag may be used to list all of the interface cloners available on
1297the system, with no additional information.
1298Use of this flag is mutually exclusive with all other flags and commands.
1299.Pp
1300The
1301.Fl k
1302flag causes keying information for the interface, if available, to be
1303printed.
1304For example, the values of 802.11 WEP keys will be printed, if accessible to
1305the current user.
1306This information is not printed by default, as it may be considered
1307sensitive.
1308.Pp
1309Only the super-user may modify the configuration of a network interface.
1310.Sh NOTES
1311The media selection system is relatively new and only some drivers support
1312it (or have need for it).
1313.Sh DIAGNOSTICS
1314Messages indicating the specified interface does not exist, the
1315requested address is unknown, or the user is not privileged and
1316tried to alter an interface's configuration.
1317.Sh SEE ALSO
1318.Xr netstat 1 ,
1319.Xr carp 4 ,
1320.Xr netintro 4 ,
1321.Xr polling 4 ,
1322.Xr vlan 4 ,
1323.\" .Xr eon 5 ,
1324.Xr rc 8 ,
1325.Xr routed 8 ,
1326.Xr sysctl 8
1327.Sh HISTORY
1328The
1329.Nm
1330utility appeared in
1331.Bx 4.2 .
1332.Sh BUGS
1333Basic IPv6 node operation requires a link-local address on each
1334interface configured for IPv6.
1335Normally, such an address is automatically configured by the
1336kernel on each interface added to the system; this behaviour may
1337be disabled by setting the sysctl MIB variable
1338.Va net.inet6.ip6.auto_linklocal
1339to 0.
1340.Pp
1341If you delete such an address using
1342.Nm ,
1343the kernel may act very oddly.
1344Do this at your own risk.
1345