1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
28 .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
29 .\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.85 2004/07/27 09:51:49 yar Exp $
30 .\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.5 2005/03/06 05:01:59 dillon Exp $
37 .Nd configure network interface parameters
74 utility is used to assign an address
75 to a network interface and/or configure
76 network interface parameters.
79 utility must be used at boot time to define the network address
80 of each interface present on a machine; it may also be used at
81 a later time to redefine an interface's address
82 or other operating parameters.
84 The following options are available:
85 .Bl -tag -width indent
88 .Tn DARPA Ns -Internet
90 the address is either a host name present in the host name data
95 Internet address expressed in the Internet standard
98 It is also possible to use the CIDR notation (also known as the
99 slash notation) to include the netmask.
100 That is, one can specify an address like
105 family, it is also possible to specify the prefix length using the slash
110 parameter below for more information.
111 .\" For the Xerox Network Systems(tm) family,
113 .\" .Ar net:a.b.c.d.e.f ,
116 .\" is the assigned network number (in decimal),
117 .\" and each of the six bytes of the host number,
121 .\" are specified in hexadecimal.
122 .\" The host number may be omitted on IEEE 802 protocol
123 .\" (Ethernet, FDDI, and Token Ring) interfaces,
124 .\" which use the hardware physical address,
125 .\" and on interfaces other than the first.
128 .\" family, addresses are specified as a long hexadecimal string,
129 .\" as in the Xerox family.
130 .\" However, two consecutive dots imply a zero
131 .\" byte, and the dots are optional, if the user wishes to (carefully)
132 .\" count out long strings of digits in network byte order.
137 is specified as a series of colon-separated hex digits.
139 e.g.\& set a new MAC address on an ethernet interface, though the
140 mechanism used is not ethernet-specific.
141 If the interface is already
142 up when this option is used, it will be briefly brought down and
143 then brought back up again in order to ensure that the receive
144 filter in the underlying ethernet hardware is properly reprogrammed.
145 .It Ar address_family
148 which affects interpretation of the remaining parameters.
149 Since an interface can receive transmissions in differing protocols
150 with different naming schemes, specifying the address family is recommended.
151 The address or protocol families currently
170 Specify the address of the correspondent on the other end
171 of a point to point link.
174 parameter is a string of the form
180 The following parameters may be set with
182 .Bl -tag -width indent
187 Introduced for compatibility
191 Establish an additional network address for this interface.
192 This is sometimes useful when changing network numbers, and
193 one wishes to accept packets addressed to the old interface.
194 If the address is on the same subnet as the first network address
195 for this interface, a non-conflicting netmask must be given.
200 Remove the network address specified.
201 This would be used if you incorrectly specified an alias, or it
202 was no longer needed.
203 If you have incorrectly set an NS address having the side effect
204 of specifying the host portion, removing all NS addresses will
205 allow you to respecify the host portion.
208 Specify that the address configured is an anycast address.
209 Based on the current specification,
210 only routers may configure anycast addresses.
211 Anycast address will not be used as source address of any of outgoing
214 Enable the use of the Address Resolution Protocol
217 between network level addresses and link level addresses (default).
218 This is currently implemented for mapping between
223 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
225 Disable the use of the Address Resolution Protocol
229 Specify the address to use to represent broadcasts to the
231 The default broadcast address is the address with a host part of all 1's.
233 Enable driver dependent debugging code; usually, this turns on
234 extra console error logging.
236 Disable driver dependent debugging code.
238 Put interface into permanently promiscuous mode.
240 Disable permanently promiscuous mode.
248 When an interface is marked
250 the system will not attempt to
251 transmit messages through that interface.
252 If possible, the interface will be reset to disable reception as well.
253 This action does not automatically disable routes using the interface.
257 (lowermost 64bit of an IPv6 address)
260 .\" This is used to specify an Internet host who is willing to receive
261 .\" ip packets encapsulating NS packets bound for a remote network.
262 .\" An apparent point to point link is constructed, and
263 .\" the address specified will be taken as the NS address and network
264 .\" of the destination.
265 .\" IP encapsulation of
267 .\" packets is done differently.
268 .It Cm maclabel Ar label
269 If Mandatory Access Control support is enabled in the kernel,
273 .\" .Xr maclabel 7 ) .
275 If the driver supports the media selection system, set the media type
278 Some interfaces support the mutually exclusive use of one of several
279 different physical media connectors.
280 For example, a 10Mb/s Ethernet
281 interface might support the use of either
283 or twisted pair connectors.
284 Setting the media type to
286 would change the currently active connector to the AUI port.
289 would activate twisted pair.
290 Refer to the interfaces' driver
291 specific documentation or man page for a complete list of the
293 .It Cm mediaopt Ar opts
294 If the driver supports the media selection system, set the specified
295 media options on the interface.
299 is a comma delimited list of options to apply to the interface.
300 Refer to the interfaces' driver specific man page for a complete
301 list of available options.
302 .It Fl mediaopt Ar opts
303 If the driver supports the media selection system, disable the
304 specified media options on the interface.
306 If the driver supports the media selection system, set the specified
307 operating mode on the interface to
309 For IEEE 802.11 wireless interfaces that support multiple operating modes
310 this directive is used to select between 802.11a
318 Set the interface name to
320 .It Cm rxcsum , txcsum
321 If the driver supports user-configurable checksum offloading,
322 enable receive (or transmit) checksum offloading on the interface.
323 Some drivers may not be able to enable these flags independently
324 of each other, so setting one may also set the other.
325 The driver will offload as much checksum work as it can reliably
326 support, the exact level of offloading varies between drivers.
327 .\".It Fl rxcsum , Fl txcsum
328 .\"If the driver supports user-configurable checksum offloading,
329 .\"disable receive (or transmit) checksum offloading on the interface.
330 .\"These settings may not always be independent of each other.
332 .\"If the driver has user-configurable
334 .\"support, select the polling mode on the interface.
336 .\"If the driver has user-configurable
338 .\"support, select the interrupt mode on the interface.
339 .It Cm tunnel Ar src_addr dest_addr
340 (IP tunnel devices only.)
341 Configure the physical source and destination address for IP tunnel
348 are interpreted as the outer source/destination for the encapsulating
351 Unconfigure the physical source and destination address for IP tunnel
352 interfaces previously configured with
355 Create the specified network pseudo-device.
356 If the interface is given without a unit number, try to create a new
357 device with an arbitrary unit number.
358 If creation of an arbitrary device is successful, the new device name is
359 printed to standard output.
361 Destroy the specified network pseudo-device.
376 .It Cm vlan Ar vlan_tag
377 If the interface is a
379 pseudo interface, set the VLAN tag value
382 This value is a 16-bit number which is used to create an 802.1Q
383 VLAN header for packets sent from the
390 must both be set at the same time.
391 .It Cm vlandev Ar iface
392 If the interface is a
394 pseudo device, associate physical interface
397 Packets transmitted through the
400 diverted to the specified physical interface
402 with 802.1Q VLAN encapsulation.
403 Packets with 802.1Q encapsulation received
404 by the parent interface with the correct VLAN tag will be diverted to
410 interface is assigned a
411 copy of the parent interface's flags and the parent's ethernet address.
416 must both be set at the same time.
419 interface already has
420 a physical interface associated with it, this command will fail.
422 change the association to another physical interface, the existing
423 association must be cleared first.
425 Note: if the hardware tagging capability
426 is set on the parent interface, the
429 interface's behavior changes:
432 interface recognizes that the
433 parent interface supports insertion and extraction of VLAN tags on its
434 own (usually in firmware) and that it should pass packets to and from
435 the parent unaltered.
436 .It Fl vlandev Ar iface
439 pseudo device, disassociate the physical interface
442 This breaks the link between the
444 interface and its parent,
445 clears its VLAN tag, flags and its link address and shuts the interface down.
446 .It Cm vlanmtu , vlanhwtag
447 If the driver offers user-configurable VLAN support, enable
448 reception of extended frames or tag processing in hardware,
450 Note that this must be issued on a physical interface associated with
455 .It Fl vlanmtu , Fl vlanhwtag
456 If the driver offers user-configurable VLAN support, disable
457 reception of extended frames or tag processing in hardware,
460 Set the routing metric of the interface to
463 The routing metric is used by the routing protocol
465 Higher metrics have the effect of making a route
466 less favorable; metrics are counted as addition hops
467 to the destination network or host.
469 Set the maximum transmission unit of the interface to
471 default is interface specific.
472 The MTU is used to limit the size of packets that are transmitted on an
474 Not all interfaces support setting the MTU, and some interfaces have
476 .It Cm netmask Ar mask
479 Specify how much of the address to reserve for subdividing
480 networks into sub-networks.
481 The mask includes the network part of the local address
482 and the subnet part, which is taken from the host field of the address.
483 The mask can be specified as a single hexadecimal number
486 with a dot-notation Internet address,
487 or with a pseudo-network name listed in the network table
489 The mask contains 1's for the bit positions in the 32-bit address
490 which are to be used for the network and subnet parts,
491 and 0's for the host part.
492 The mask should contain at least the standard network portion,
493 and the subnet field should be contiguous with the network
496 The netmask can also be specified in CIDR notation after the address.
499 option above for more information.
500 .It Cm prefixlen Ar len
504 bits are reserved for subdividing networks into sub-networks.
507 must be integer, and for syntactical reason it must be between 0 to 128.
508 It is almost always 64 under the current IPv6 assignment rule.
509 If the parameter is omitted, 64 is used.
511 The prefix can also be specified using the slash notation after the address.
514 option above for more information.
517 .\" .It Cm nsellength Ar n
520 .\" This specifies a trailing number of bytes for a received
522 .\" used for local identification, the remaining leading part of which is
525 .\" (Network Entity Title).
526 .\" The default value is 1, which is conformant to US
528 .\" When an ISO address is set in an ifconfig command,
531 .\" which is being specified.
534 .\" 20 hex digits should be
537 .\" to be assigned to the interface.
538 .\" There is some evidence that a number different from 1 may be useful
541 .\" 37 type addresses.
542 .It Cm range Ar netrange
543 Under appletalk, set the interface to respond to a
546 .Ar startnet Ns - Ns Ar endnet .
547 Appletalk uses this scheme instead of
550 implements it internally as a set of netmasks.
555 Introduced for compatibility
559 The argument following this specifies the version (phase) of the
560 Appletalk network attached to the interface.
561 Values of 1 or 2 are permitted.
563 .It Cm link Op Cm 0 No - Cm 2
565 Enable special processing of the link level of the interface.
566 These three options are interface specific in actual effect, however,
567 they are in general used to select special modes of operation.
569 of this is to enable SLIP compression, or to select the connector type
570 for some Ethernet cards.
571 Refer to the man page for the specific driver
572 for more information.
574 .It Fl link Op Cm 0 No - Cm 2
576 Disable special processing at the link level with the specified interface.
578 .\"Put the interface in monitor mode.
579 .\"No packets are transmitted, and received packets are discarded after
583 .\"Take the interface out of monitor mode.
587 This may be used to enable an interface after an
589 It happens automatically when setting the first address on an interface.
590 If the interface was reset when previously marked down,
591 the hardware will be re-initialized.
593 For IEEE 802.11 wireless interfaces, set the desired Service Set
594 Identifier (aka network name).
595 The SSID is a string up to 32 characters
596 in length and may be specified as either a normal string or in
597 hexadecimal when proceeded by
599 Additionally, the SSID may be cleared by setting it to
608 .It Cm stationname Ar name
609 For IEEE 802.11 wireless interfaces, set the name of this station.
610 It appears that the station name is not really part of the IEEE 802.11
611 protocol though all interfaces seem to support it.
613 seems to be meaningful to identical or virtually identical equipment.
614 Setting the station name is identical in syntax to setting the SSID.
615 .It Cm station Ar name
622 .It Cm channel Ar number
623 For IEEE 802.11 wireless interfaces, set the desired channel.
624 Channels range from 1 to 14, but the exact selection available
625 depends on the region your adaptor was manufactured for.
627 the channel to 0 will give you the default for your adaptor.
629 adaptors ignore this setting unless you are in ad-hoc mode.
630 .It Cm authmode Ar mode
631 For IEEE 802.11 wireless interfaces, set the desired authentication mode
632 in infrastructure mode.
633 Not all adaptors support all modes.
640 Modes are case insensitive.
642 For IEEE 802.11 wireless interfaces, enable powersave mode.
644 For IEEE 802.11 wireless interfaces, disable powersave mode.
645 .It Cm powersavesleep Ar sleep
646 For IEEE 802.11 wireless interfaces, set the desired max powersave sleep
647 time in milliseconds.
648 .It Cm protmode Ar technique
649 For IEEE 802.11 wireless interfaces operating in 11g, use the specified
651 for protecting OFDM frames in a mixed 11b/11g network.
652 The set of valid techniques is
659 Technique names are case insensitive.
660 .It Cm rtsthreshold Ar length
661 For IEEE 802.11 wireless interfaces, set the threshold for which
662 transmitted frames are preceded by transmission of an
668 is the frame size in bytes and must be in the range 1 to 2312.
669 Not all adaptors support setting the RTS threshold.
670 .It Cm txpower Ar power
671 For IEEE 802.11 wireless interfaces, set the power used to transmit frames.
675 is a unitless value in the range 0 to 100 that is interpreted
676 by drivers to derive a device-specific value.
677 Out of range values are truncated.
678 Typically only a few discreet power settings are available and
679 the driver will use the setting closest to the specified value.
680 Not all adaptors support changing the transmit power.
681 .It Cm wepmode Ar mode
682 For IEEE 802.11 wireless interfaces, set the desired WEP mode.
683 Not all adaptors support all modes.
684 The set of valid modes is
691 mode explicitly tells the adaptor to allow association with access
692 points which allow both encrypted and unencrypted traffic.
695 means that the access point must only allow encrypted connections.
698 is generally another name for
700 Modes are case insensitive.
701 .It Cm weptxkey Ar index
702 For IEEE 802.11 wireless interfaces, set the WEP key to be used for
704 .It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
705 For IEEE 802.11 wireless interfaces, set the selected WEP key.
708 is not given, key 1 is set.
709 A WEP key will be either 5 or 13
710 characters (40 or 104 bits) depending of the local network and the
711 capabilities of the adaptor.
712 It may be specified either as a plain
713 string or as a string of hexadecimal digits proceeded by
715 For maximum portability, hex keys are recommended;
716 the mapping of text keys to WEP encryption is usually driver-specific.
719 drivers do this mapping differently to
721 A key may be cleared by setting it to
723 If WEP is supported then there are at least four keys.
724 Some adaptors support more than four keys.
725 If that is the case, then the first four keys
726 (1-4) will be the standard temporary keys and any others will be adaptor
727 specific keys such as permanent keys stored in NVRAM.
729 Another way of saying
735 Another way of saying
741 Another way of saying:
743 .Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
750 .Ar n : k1 , k2 , k3 , k4
753 Another way of saying
755 .Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
761 Another way of saying
771 utility displays the current configuration for a network interface
772 when no optional parameters are supplied.
773 If a protocol family is specified,
775 will report only the details specific to that protocol family.
777 If the driver does supports the media selection system, the supported
778 media list will be included in the output.
782 flag is passed before an interface name,
784 will display the capability list and all
785 of the supported media for the specified interface.
788 flag is supplied, address lifetime is displayed for IPv6 addresses,
789 as time offset string.
793 flag may be used instead of an interface name.
796 to display information about all interfaces in the system.
799 flag limits this to interfaces that are down, and
801 limits this to interfaces that are up.
802 When no arguments are given,
808 flag may be used to list all available interfaces on the system, with
809 no other additional information.
810 Use of this flag is mutually exclusive
811 with all other flags and commands, except for
813 (only list interfaces that are down)
816 (only list interfaces that are up).
820 flag may be used to list all of the interface cloners available on
821 the system, with no additional information.
822 Use of this flag is mutually exclusive with all other flags and commands.
824 Only the super-user may modify the configuration of a network interface.
826 The media selection system is relatively new and only some drivers support
827 it (or have need for it).
829 Messages indicating the specified interface does not exist, the
830 requested address is unknown, or the user is not privileged and
831 tried to alter an interface's configuration.
833 Basic IPv6 node operation requires a link-local address on each
834 interface configured for IPv6.
835 Normally, such an address is automatically configured by the
836 kernel on each interface added to the system; this behaviour may
837 be disabled by setting the sysctl MIB variable
838 .Va net.inet6.ip6.auto_linklocal
841 If you delete such an address using
843 the kernel may act very oddly.
844 Do this at your own risk.