xref: /netbsd-src/sbin/ifconfig/ifconfig.8 (revision 0c4ddb1599a0bea866fde8522a74cfbd2f68cd1b)
1.\"	$NetBSD: ifconfig.8,v 1.92 2007/12/16 13:49:22 degroote Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)ifconfig.8	8.4 (Berkeley) 6/1/94
31.\"
32.Dd January 9, 2007
33.Dt IFCONFIG 8
34.Os
35.Sh NAME
36.Nm ifconfig
37.Nd configure network interface parameters
38.Sh SYNOPSIS
39.Nm
40.Ar interface address_family
41.Oo
42.Ar address
43.Op Ar dest_address
44.Oc
45.Op Ar parameters
46.Nm
47.Op Fl hLmvz
48.Ar interface
49.Op Ar protocol_family
50.Nm
51.Fl a
52.Op Fl bdhLmsuvz
53.Op Ar protocol_family
54.Nm
55.Fl l
56.Op Fl bdsu
57.Nm
58.Fl s
59.Ar interface
60.Nm
61.Fl C
62.Sh DESCRIPTION
63.Nm
64is used to assign an address
65to a network interface and/or configure
66network interface parameters.
67.Nm
68must be used at boot time to define the network address
69of each interface present on a machine; it may also be used at
70a later time to redefine an interface's address
71or other operating parameters.
72.Pp
73Available operands for
74.Nm :
75.Bl -tag -width Ds
76.It Ar address
77For the
78.Tn DARPA-Internet
79family,
80the address is either a host name present in the host name data
81base,
82.Xr hosts 5 ,
83or a
84.Tn DARPA
85Internet address expressed in the Internet standard
86.Dq dot notation .
87For the Xerox Network Systems(tm) family,
88addresses are
89.Ar net:a.b.c.d.e.f ,
90where
91.Ar net
92is the assigned network number
93.Pq in decimal ,
94and each of the six bytes of the host number,
95.Ar a
96through
97.Ar f ,
98are specified in hexadecimal.
99The host number may be omitted on Ethernet interfaces,
100which use the hardware physical address,
101and on interfaces other than the first.
102For the
103.Tn ISO
104family, addresses are specified as a long hexadecimal string,
105as in the Xerox family.
106However, two consecutive dots imply a zero
107byte, and the dots are optional, if the user wishes to
108.Pq carefully
109count out long strings of digits in network byte order.
110.It Ar address_family
111Specifies the
112.Ar address_family
113which affects interpretation of the remaining parameters.
114Since an interface can receive transmissions in differing protocols
115with different naming schemes, specifying the address family is recommended.
116The address or protocol families currently
117supported are
118.Dq inet ,
119.Dq inet6 ,
120.Dq atalk ,
121.Dq iso ,
122and
123.Dq ns .
124.It Ar interface
125The
126.Ar interface
127parameter is a string of the form
128.Dq name unit ,
129for example,
130.Dq en0
131.El
132.Pp
133The following parameters may be set with
134.Nm :
135.Bl -tag -width dest_addressxx
136.It Cm advbase Ar n
137If the driver is a
138.Xr carp 4
139pseudo-device, set the base advertisement interval to
140.Ar n
141seconds.
142This ia an 8-bit number; the default value is 1 second.
143.It Cm advskew Ar n
144If the driver is a
145.Xr carp 4
146pseudo-device, skew the advertisement interval by
147.Ar n .
148This is an 8-bit number; the default value is 0.
149.Pp
150Taken together the
151.Cm advbase
152indicate how frequently, in seconds, the host will advertise the fact that it
153considers itself the master of the virtual host.
154The formula is
155.Cm advbase
156+
157.Pf ( Cm advskew
158/ 256).
159If the master does not advertise within three times this interval, this host
160will begin advertising as master.
161.It Cm alias
162Establish an additional network address for this interface.
163This is sometimes useful when changing network numbers, and
164one wishes to accept packets addressed to the old interface.
165.It Fl alias
166Remove the specified network address alias.
167.It Cm arp
168Enable the use of the Address Resolution Protocol in mapping
169between network level addresses and link level addresses
170.Pq default .
171This is currently implemented for mapping between
172.Tn DARPA
173Internet
174addresses and Ethernet addresses.
175.It Fl arp
176Disable the use of the Address Resolution Protocol.
177.It Cm anycast
178.Pq inet6 only
179Set the IPv6 anycast address bit.
180.It Fl anycast
181.Pq inet6 only
182Clear the IPv6 anycast address bit.
183.It Cm broadcast Ar mask
184.Pq Inet only
185Specify the address to use to represent broadcasts to the
186network.
187The default broadcast address is the address with a host part of all 1's.
188.It Cm carpdev Ar iface
189If the driver is a
190.Xr carp 4
191pseudo-device, attach it to
192.Ar iface .
193If not specified, the kernel will attempt to select an interface with
194a subnet matching that of the carp interface.
195.It Cm debug
196Enable driver dependent debugging code; usually, this turns on
197extra console error logging.
198.It Fl debug
199Disable driver dependent debugging code.
200.ne 1i
201.It Cm delete
202Remove the network address specified.
203This would be used if you incorrectly specified an alias, or it
204was no longer needed.
205If you have incorrectly set an NS address having the side effect
206of specifying the host portion, removing all NS addresses will
207allow you to respecify the host portion.
208.Cm delete
209does not work for IPv6 addresses.
210Use
211.Fl alias
212with explicit IPv6 address instead.
213.It Ar dest_address
214Specify the address of the correspondent on the other end
215of a point to point link.
216.It Cm down
217Mark an interface ``down''.
218When an interface is
219marked ``down'', the system will not attempt to
220transmit messages through that interface.
221If possible, the interface will be reset to disable reception as well.
222This action does not automatically disable routes using the interface.
223.It Cm ipdst
224This is used to specify an Internet host who is willing to receive
225ip packets encapsulating NS packets bound for a remote network.
226An apparent point to point link is constructed, and
227the address specified will be taken as the NS address and network
228of the destination.
229IP encapsulation of
230.Tn CLNP
231packets is done differently.
232.It Cm media Ar type
233Set the media type of the interface to
234.Ar type .
235Some interfaces support the mutually exclusive use of one of several
236different physical media connectors.
237For example, a 10Mb/s Ethernet
238interface might support the use of either
239.Tn AUI
240or twisted pair connectors.
241Setting the media type to
242.Dq 10base5
243or
244.Dq AUI
245would change the currently active connector to the AUI port.
246Setting it to
247.Dq 10baseT
248or
249.Dq UTP
250would activate twisted pair.
251Refer to the interfaces' driver
252specific man page for a complete list of the available types.
253.It Cm mediaopt Ar opts
254Set the specified media options on the interface.
255.Ar opts
256is a comma delimited list of options to apply to the interface.
257Refer to the interfaces' driver specific man page for a complete
258list of available options.
259.It Fl mediaopt Ar opts
260Disable the specified media options on the interface.
261.It Cm mode Ar mode
262If the driver supports the media selection system, set the specified
263operating mode on the interface to
264.Ar mode .
265For IEEE 802.11 wireless interfaces that support multiple operating modes
266this directive is used to select between 802.11a
267.Pq Dq 11a ,
268802.11b
269.Pq Dq 11b ,
270and 802.11g
271.Pq Dq 11g
272operating modes.
273.It Cm instance Ar minst
274Set the media instance to
275.Ar minst .
276This is useful for devices which have multiple physical layer interfaces
277.Pq PHYs .
278Setting the instance on such devices may not be strictly required
279by the network interface driver as the driver may take care of this
280automatically; see the driver's manual page for more information.
281.It Cm metric Ar n
282Set the routing metric of the interface to
283.Ar n ,
284default 0.
285The routing metric is used by the routing protocol
286.Pq Xr routed 8 .
287Higher metrics have the effect of making a route
288less favorable; metrics are counted as addition hops
289to the destination network or host.
290.It Cm mtu Ar n
291Set the maximum transmission unit of the interface to
292.Ar n .
293Most interfaces don't support this option.
294.It Cm netmask Ar mask
295.Pq inet, inet6, and ISO
296Specify how much of the address to reserve for subdividing
297networks into sub-networks.
298The mask includes the network part of the local address
299and the subnet part, which is taken from the host field of the address.
300The mask can be specified as a single hexadecimal number
301with a leading 0x, with a dot-notation Internet address,
302or with a pseudo-network name listed in the network table
303.Xr networks 5 .
304The mask contains 1's for the bit positions in the 32-bit address
305which are to be used for the network and subnet parts,
306and 0's for the host part.
307The mask should contain at least the standard network portion,
308and the subnet field should be contiguous with the network
309portion.
310.Pp
311For INET and INET6 addresses, the netmask can also be given with
312slash-notation after the address
313.Pq e.g 192.168.17.3/24 .
314.\" see
315.\" Xr eon 5 .
316.It Cm nsellength Ar n
317.Pf ( Tn ISO
318only)
319This specifies a trailing number of bytes for a received
320.Tn NSAP
321used for local identification, the remaining leading part of which is
322taken to be the
323.Tn NET
324.Pq Network Entity Title .
325The default value is 1, which is conformant to US
326.Tn GOSIP .
327When an ISO address is set in an ifconfig command,
328it is really the
329.Tn NSAP
330which is being specified.
331For example, in
332.Tn US GOSIP ,
33320 hex digits should be
334specified in the
335.Tn ISO NSAP
336to be assigned to the interface.
337There is some evidence that a number different from 1 may be useful
338for
339.Tn AFI
34037 type addresses.
341.It Cm state Ar state
342Explicitly force the
343.Xr carp 4
344pseudo-device to enter this state.
345Valid states are
346.Ar init ,
347.Ar backup ,
348and
349.Ar master .
350.It Cm frag Ar threshold
351.Pq IEEE 802.11 devices only
352Configure the fragmentation threshold for IEEE 802.11-based wireless
353network interfaces.
354.It Cm ssid Ar id
355.Pq IEEE 802.11 devices only
356Configure the Service Set Identifier (a.k.a. the network name)
357for IEEE 802.11-based wireless network interfaces.
358The
359.Ar id
360can either be any text string up to 32 characters in length,
361or a series of up to 64 hexadecimal digits preceded by
362.Dq 0x .
363Setting
364.Ar id
365to the empty string allows the interface to connect to any available
366access point.
367.It Cm nwid Ar id
368Synonym for
369.Dq ssid .
370.It Cm hidessid
371.Pq IEEE 802.11 devices only
372When operating as an access point, do not broadcast the SSID
373in beacon frames or respond to probe request frames unless
374they are directed to the ap (i.e., they include the ap's SSID).
375By default, the SSID is included in beacon frames and
376undirected probe request frames are answered.
377.It Fl hidessid
378.Pq IEEE 802.11 devices only
379When operating as an access point, broadcast the SSID
380in beacon frames and answer and respond to undirected probe
381request frames (default).
382.It Cm nwkey Ar key
383.Pq IEEE 802.11 devices only
384Enable WEP encryption for IEEE 802.11-based wireless network interfaces
385with the
386.Ar key .
387The
388.Ar key
389can either be a string, a series of hexadecimal digits preceded by
390.Dq 0x ,
391or a set of keys in the form
392.Ar n:k1,k2,k3,k4 ,
393where
394.Ar n
395specifies which of keys will be used for all transmitted packets,
396and four keys,
397.Ar k1
398through
399.Ar k4 ,
400are configured as WEP keys.
401Note that the order must be match within same network if multiple keys
402are used.
403For IEEE 802.11 wireless network, the length of each key is restricted to
40440 bits, i.e. 5-character string or 10 hexadecimal digits,
405while the WaveLAN/IEEE Gold cards accept the 104 bits
406.Pq 13 characters
407key.
408.It Cm nwkey Cm persist
409.Pq IEEE 802.11 devices only
410Enable WEP encryption for IEEE 802.11-based wireless network interfaces
411with the persistent key written in the network card.
412.It Cm nwkey Cm persist: Ns Ar key
413.Pq IEEE 802.11 devices only
414Write the
415.Ar key
416to the persistent memory of the network card, and
417enable WEP encryption for IEEE 802.11-based wireless network interfaces
418with the
419.Ar key .
420.It Fl nwkey
421.Pq IEEE 802.11 devices only
422Disable WEP encryption for IEEE 802.11-based wireless network interfaces.
423.It Cm apbridge
424.Pq IEEE 802.11 devices only
425When operating as an access point, pass packets between
426wireless clients directly (default).
427.It Fl apbridge
428.Pq IEEE 802.11 devices only
429When operating as an access point, pass packets through
430the system so that they can be forwared using some other mechanism.
431Disabling the internal bridging is useful when traffic
432is to be processed with packet filtering.
433.It Cm pass Ar passphrase
434If the driver is a
435.Xr carp 4
436pseudo-device, set the authentication key to
437.Ar passphrase .
438There is no passphrase by default
439.It Cm powersave
440.Pq IEEE 802.11 devices only
441Enable 802.11 power saving mode.
442.It Fl powersave
443.Pq IEEE 802.11 devices only
444Disable 802.11 power saving mode.
445.It Cm powersavesleep Ar duration
446.Pq IEEE 802.11 devices only
447Set the receiver sleep duration in milliseconds for 802.11 power saving mode.
448.It Cm bssid Ar bssid
449.Pq IEEE 802.11 devices only
450Set the desired BSSID for IEEE 802.11-based wireless network interfaces.
451.It Fl bssid
452.Pq IEEE 802.11 devices only
453Unset the desired BSSID for IEEE 802.11-based wireless network interfaces.
454The interface will automatically select a BSSID in this mode, which is
455the default.
456.It Cm chan Ar chan
457.Pq IEEE 802.11 devices only
458Select the channel
459.Pq radio frequency
460to be used for IEEE 802.11-based wireless network interfaces.
461.It Fl chan
462.Pq IEEE 802.11 devices only
463Unset the desired channel to be used
464for IEEE 802.11-based wireless network interfaces.
465It doesn't affect the channel to be created for IBSS or hostap mode.
466.It Bk -words
467.It Cm list scan
468.Pq IEEE 802.11 devices only
469Display the access points and/or ad-hoc neighbors
470located in the vicinity.
471The
472.Fl v
473flag may be used to display long SSIDs.
474.Fl v
475also causes received information elements to be displayed symbolicaly.
476Only the super-user can use this command.
477.It Cm tunnel Ar src_addr Ns Op Ar ,src_port
478.Ar dest_addr Ns Op Ar ,dest_port
479.Ek
480.Pq IP tunnel devices only
481Configure the physical source and destination address for IP tunnel
482interfaces, including
483.Xr gif 4 .
484The arguments
485.Ar src_addr
486and
487.Ar dest_addr
488are interpreted as the outer source/destination for the encapsulating
489IPv4/IPv6 header.
490.Pp
491On a
492.Xr gre 4
493interface in UDP mode, the arguments
494.Ar src_port
495and
496.Ar dest_port
497are interpreted as the outer source/destination port for the encapsulating
498UDP header.
499.It Cm deletetunnel
500Unconfigure the physical source and destination address for IP tunnel
501interfaces previously configured with
502.Cm tunnel .
503.It Cm create
504Create the specified network pseudo-device.
505.It Cm destroy
506Destroy the specified network pseudo-device.
507.It Cm pltime Ar n
508.Pq inet6 only
509Set preferred lifetime for the address.
510.It Cm prefixlen Ar n
511.Pq inet and inet6 only
512Effect is similar to
513.Cm netmask .
514but you can specify by prefix length by digits.
515.It Cm deprecated
516.Pq inet6 only
517Set the IPv6 deprecated address bit.
518.It Fl deprecated
519.Pq inet6 only
520Clear the IPv6 deprecated address bit.
521.It Cm tentative
522.Pq inet6 only
523Set the IPv6 tentative address bit.
524.It Fl tentative
525.Pq inet6 only
526Clear the IPv6 tentative address bit.
527.It Cm eui64
528.Pq inet6 only
529Fill interface index
530.Pq lowermost 64bit of an IPv6 address
531automatically.
532.It Cm link[0-2]
533Enable special processing of the link level of the interface.
534These three options are interface specific in actual effect, however,
535they are in general used to select special modes of operation.
536An example
537of this is to enable SLIP compression, or to select the connector type
538for some ethernet cards.
539Refer to the man page for the specific driver
540for more information.
541.It Fl link[0-2]
542Disable special processing at the link level with the specified interface.
543.It Cm up
544Mark an interface ``up''.
545This may be used to enable an interface after an ``ifconfig down.''
546It happens automatically when setting the first address on an interface.
547If the interface was reset when previously marked down,
548the hardware will be re-initialized.
549.It Cm vhid Ar n
550If the driver is a
551.Xr carp 4
552pseudo-device, set the virtual host ID to
553.Ar n .
554Acceptable values are 1 to 255.
555.It Cm vlan Ar vid
556If the interface is a
557.Xr vlan 4
558pseudo-interface, set the VLAN identifier to
559.Ar vid .
560These are the first 12 bits (0-4095) from a 16-bit integer used
561to create an 802.1Q VLAN header for packets sent from the
562.Xr vlan 4
563interface.
564Note that
565.Cm vlan
566and
567.Cm vlanif
568must be set at the same time.
569.It Cm vlanif Ar iface
570If the interface is a
571.Xr vlan 4
572pseudo-interface, associate the physical interface
573.Ar iface
574with it.
575Packets transmitted through the
576.Xr vlan 4
577interface will be diverted to the specified physical interface
578.Ar iface
579with 802.1Q VLAN encapsulation.
580Packets with 802.1Q encapsulation received
581by the physical interface with the correct VLAN tag will be diverted to the
582associated
583.Xr vlan 4
584pseudo-interface.
585The VLAN interface is assigned a copy of the physical
586interface's flags and
587.Tn Ethernet
588address.
589If the
590.Xr vlan 4
591interface already has a physical interface associated with it, this command
592will fail.
593To change the association to another physical interface, the
594existing association must be cleared first.
595Note that
596.Cm vlanif
597and
598.Cm vlan
599must be set at the same time.
600.It Cm agrport Ar iface
601Add
602.Ar iface
603to the
604.Xr agr 4
605interface.
606.It Cm -agrport Ar iface
607Remove
608.Ar iface
609from the
610.Xr agr 4
611interface.
612.It Cm vltime Ar n
613.Pq inet6 only
614Set valid lifetime for the address.
615.It Cm ip4csum
616Shorthand of
617.Dq ip4csum-tx ip4csum-rx
618.It Cm -ip4csum
619Shorthand of
620.Dq -ip4csum-tx -ip4csum-rx
621.It Cm tcp4csum
622Shorthand of
623.Dq tcp4csum-tx tcp4csum-rx
624.It Cm -tcp4csum
625Shorthand of
626.Dq -tcp4csum-tx -tcp4csum-rx
627.It Cm udp4csum
628Shorthand of
629.Dq udp4csum-tx udp4csum-rx
630.It Cm -udp4csum
631Shorthand of
632.Dq -udp4csum-tx -udp4csum-rx
633.It Cm tcp6csum
634Shorthand of
635.Dq tcp6csum-tx tcp6csum-rx
636.It Cm -tcp6csum
637Shorthand of
638.Dq -tcp6csum-tx -tcp6csum-rx
639.It Cm udp6csum
640Shorthand of
641.Dq udp6csum-tx udp6csum-rx
642.It Cm -udp6csum
643Shorthand of
644.Dq -udp6csum-tx -udp6csum-rx
645.It Cm ip4csum-tx
646Enable hardware-assisted IPv4 header checksums for the out-bound direction.
647.It Cm -ip4csum-tx
648Disable hardware-assisted IPv4 header checksums for the out-bound direction.
649.It Cm ip4csum-rx
650Enable hardware-assisted IPv4 header checksums for the in-bound direction.
651.It Cm -ip4csum-rx
652Disable hardware-assisted IPv4 header checksums for the in-bound direction.
653.It Cm tcp4csum-tx
654Enable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
655.It Cm -tcp4csum-tx
656Disable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
657.It Cm tcp4csum-rx
658Enable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
659.It Cm -tcp4csum-rx
660Disable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
661.It Cm udp4csum-tx
662Enable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
663.It Cm -udp4csum-tx
664Disable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
665.It Cm udp4csum-rx
666Enable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
667.It Cm -udp4csum-rx
668Disable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
669.It Cm tcp6csum-tx
670Enable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
671.It Cm -tcp6csum-tx
672Disable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
673.It Cm tcp6csum-rx
674Enable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
675.It Cm -tcp6csum-rx
676Disable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
677.It Cm udp6csum-tx
678Enable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
679.It Cm -udp6csum-tx
680Disable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
681.It Cm udp6csum-rx
682Enable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
683.It Cm -udp6csum-rx
684Disable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
685.It Cm tso4
686Enable hardware-assisted TCP/IPv4 segmentation on interfaces that
687support it.
688.It Cm -tso4
689Disable hardware-assisted TCP/IPv4 segmentation on interfaces that
690support it.
691.It Cm tso6
692Enable hardware-assisted TCP/IPv6 segmentation on interfaces that
693support it.
694.It Cm -tso6
695Disable hardware-assisted TCP/IPv6 segmentation on interfaces that
696support it.
697.El
698.Pp
699.Nm
700displays the current configuration for a network interface
701when no optional parameters are supplied.
702If a protocol family is specified,
703.Nm
704will report only the details specific to that protocol
705family.
706.Pp
707If the
708.Fl s
709flag is passed before an interface name,
710.Nm
711will attempt to query the interface for its media status.
712If the
713interface supports reporting media status, and it reports that it does
714not appear to be connected to a network,
715.Nm
716will exit with status of 1
717.Pq false ;
718otherwise, it will exit with a
719zero
720.Pq true
721exit status.
722Not all interface drivers support media
723status reporting.
724.Pp
725If the
726.Fl m
727flag is passed before an interface name,
728.Nm
729will display all of the supported media for the specified interface.
730If the
731.Fl L
732flag is supplied, address lifetime is displayed for IPv6 addresses,
733as time offset string.
734.Pp
735Optionally, the
736.Fl a
737flag may be used instead of an interface name.
738This flag instructs
739.Nm
740to display information about all interfaces in the system.
741.Fl d
742limits this to interfaces that are down,
743.Fl u
744limits this to interfaces that are up,
745.Fl b
746limits this to broadcast interfaces, and
747.Fl s
748omits interfaces which appear not to be connected to a network.
749.Pp
750The
751.Fl l
752flag may be used to list all available interfaces on the system, with
753no other additional information.
754Use of this flag is mutually exclusive
755with all other flags and commands, except for
756.Fl d
757.Pq only list interfaces that are down ,
758.Fl u
759.Pq only list interfaces that are up ,
760.Fl s
761.Pq only list interfaces that may be connected ,
762.Fl b
763.Pq only list broadcast interfaces .
764.Pp
765The
766.Fl C
767flag may be used to list all of the interface cloners available on
768the system, with no additional information.
769Use of this flag is
770mutually exclusive with all other flags and commands.
771.Pp
772The
773.Fl v
774flag prints statistics on packets sent and received on the given
775interface.
776If
777.Fl h
778is used in conjunction with
779.Fl v ,
780the byte statistics will be printed in "human-readable" format.
781The
782.Fl z
783flag is identical to the
784.Fl v
785flag except that it zeros the interface input and output statistics
786after printing them.
787.Pp
788Only the super-user may modify the configuration of a network interface.
789.Sh DIAGNOSTICS
790Messages indicating the specified interface does not exist, the
791requested address is unknown, or the user is not privileged and
792tried to alter an interface's configuration.
793.Sh SEE ALSO
794.Xr netstat 1 ,
795.Xr agr 4 ,
796.Xr carp 4 ,
797.Xr ifmedia 4 ,
798.Xr netintro 4 ,
799.Xr vlan 4 ,
800.Xr ifconfig.if 5 ,
801.\" .Xr eon 5 ,
802.Xr rc 8 ,
803.Xr routed 8
804.Sh HISTORY
805The
806.Nm
807command appeared in
808.Bx 4.2 .
809