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 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgment:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
33 .\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.27.2.22 2003/01/26 03:33:56 keramida Exp $
34 .\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.3 2004/03/11 12:28:54 hmp Exp $
41 .Nd configure network interface parameters
78 utility is used to assign an address
79 to a network interface and/or configure
80 network interface parameters.
83 utility must be used at boot time to define the network address
84 of each interface present on a machine; it may also be used at
85 a later time to redefine an interface's address
86 or other operating parameters.
88 The following options are available:
89 .Bl -tag -width indent
92 .Tn DARPA Ns -Internet
94 the address is either a host name present in the host name data
99 Internet address expressed in the Internet standard
102 It is also possible to use the CIDR notation (also known as the
103 slash notation) to include the netmask.
104 That is, one can specify an address like
109 family, it is also possible to specify the prefix length using the slash
114 parameter below for more information.
115 .\" For the Xerox Network Systems(tm) family,
117 .\" .Ar net:a.b.c.d.e.f ,
120 .\" is the assigned network number (in decimal),
121 .\" and each of the six bytes of the host number,
125 .\" are specified in hexadecimal.
126 .\" The host number may be omitted on IEEE 802 protocol
127 .\" (Ethernet, FDDI, and Token Ring) interfaces,
128 .\" which use the hardware physical address,
129 .\" and on interfaces other than the first.
132 .\" family, addresses are specified as a long hexadecimal string,
133 .\" as in the Xerox family.
134 .\" However, two consecutive dots imply a zero
135 .\" byte, and the dots are optional, if the user wishes to (carefully)
136 .\" count out long strings of digits in network byte order.
141 is specified as a series of colon-separated hex digits.
143 e.g. set a new MAC address on an ethernet interface, though the
144 mechanism used is not ethernet-specific.
145 If the interface is already
146 up when this option is used, it will be briefly brought down and
147 then brought back up again in order to ensure that the receive
148 filter in the underlying ethernet hardware is properly reprogrammed.
149 .It Ar address_family
152 which affects interpretation of the remaining parameters.
153 Since an interface can receive transmissions in differing protocols
154 with different naming schemes, specifying the address family is recommended.
155 The address or protocol families currently
174 Specify the address of the correspondent on the other end
175 of a point to point link.
178 parameter is a string of the form
184 The following parameters may be set with
186 .Bl -tag -width indent
191 Introduced for compatibility
195 Establish an additional network address for this interface.
196 This is sometimes useful when changing network numbers, and
197 one wishes to accept packets addressed to the old interface.
198 If the address is on the same subnet as the first network address
199 for this interface, a non-conflicting netmask must be given.
204 Remove the network address specified.
205 This would be used if you incorrectly specified an alias, or it
206 was no longer needed.
207 If you have incorrectly set an NS address having the side effect
208 of specifying the host portion, removing all NS addresses will
209 allow you to respecify the host portion.
212 Specify that the address configured is an anycast address.
213 Based on the current specification,
214 only routers may configure anycast addresses.
215 Anycast address will not be used as source address of any of outgoing
218 Enable the use of the Address Resolution Protocol
221 between network level addresses and link level addresses (default).
222 This is currently implemented for mapping between
227 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
229 Disable the use of the Address Resolution Protocol
233 Specify the address to use to represent broadcasts to the
235 The default broadcast address is the address with a host part of all 1's.
237 Enable driver dependent debugging code; usually, this turns on
238 extra console error logging.
240 Disable driver dependent debugging code.
242 Put interface into permanently promiscuous mode.
244 Disable permanently promiscuous mode.
252 When an interface is marked
254 the system will not attempt to
255 transmit messages through that interface.
256 If possible, the interface will be reset to disable reception as well.
257 This action does not automatically disable routes using the interface.
261 (lowermost 64bit of an IPv6 address)
264 .\" This is used to specify an Internet host who is willing to receive
265 .\" ip packets encapsulating NS packets bound for a remote network.
266 .\" An apparent point to point link is constructed, and
267 .\" the address specified will be taken as the NS address and network
268 .\" of the destination.
269 .\" IP encapsulation of
271 .\" packets is done differently.
273 If the driver supports the media selection system, set the media type
276 Some interfaces support the mutually exclusive use of one of several
277 different physical media connectors.
278 For example, a 10Mb/s Ethernet
279 interface might support the use of either
281 or twisted pair connectors.
282 Setting the media type to
284 would change the currently active connector to the AUI port.
287 would activate twisted pair.
288 Refer to the interfaces' driver
289 specific documentation or man page for a complete list of the
291 .It Cm mediaopt Ar opts
292 If the driver supports the media selection system, set the specified
293 media options on the interface.
297 is a comma delimited list of options to apply to the interface.
298 Refer to the interfaces' driver specific man page for a complete
299 list of available options.
300 .It Fl mediaopt Ar opts
301 If the driver supports the media selection system, disable the
302 specified media options on the interface.
303 .It Cm tunnel Ar src_addr dest_addr
304 (IP tunnel devices only.)
305 Configure the physical source and destination address for IP tunnel
312 are interpreted as the outer source/destination for the encapsulating
315 Unconfigure the physical source and destination address for IP tunnel
316 interfaces previously configured with
319 Create the specified network pseudo-device.
320 If the interface is given without a unit number, try to create a new
321 device with an arbitrary unit number.
322 If creation of an arbitrary device is successful, the new device name is
323 printed to standard output.
325 Destroy the specified network pseudo-device.
340 .It Cm vlan Ar vlan_tag
341 If the interface is a vlan pseudo interface, set the vlan tag value
344 This value is a 16-bit number which is used to create an 802.1Q
345 vlan header for packets sent from the vlan interface.
350 must both be set at the same time.
351 .It Cm vlandev Ar iface
352 If the interface is a vlan pseudo device, associate physical interface
355 Packets transmitted through the vlan interface will be
356 diverted to the specified physical interface
358 with 802.1Q vlan encapsulation.
359 Packets with 802.1Q encapsulation received
360 by the parent interface with the correct vlan tag will be diverted to
361 the associated vlan pseudo-interface.
362 The vlan interface is assigned a
363 copy of the parent interface's flags and the parent's ethernet address.
368 must both be set at the same time.
369 If the vlan interface already has
370 a physical interface associated with it, this command will fail.
372 change the association to another physical interface, the existing
373 association must be cleared first.
377 flag is set on the vlan interface, the vlan pseudo
378 interface's behavior changes: the
380 tells the vlan interface that the
381 parent interface supports insertion and extraction of vlan tags on its
382 own (usually in firmware) and that it should pass packets to and from
383 the parent unaltered.
384 .It Fl vlandev Ar iface
385 If the driver is a vlan pseudo device, disassociate the physical interface
388 This breaks the link between the vlan interface and its parent,
389 clears its vlan tag, flags and its link address and shuts the interface down.
391 Set the routing metric of the interface to
394 The routing metric is used by the routing protocol
396 Higher metrics have the effect of making a route
397 less favorable; metrics are counted as addition hops
398 to the destination network or host.
400 Set the maximum transmission unit of the interface to
402 default is interface specific.
403 The MTU is used to limit the size of packets that are transmitted on an
405 Not all interfaces support setting the MTU, and some interfaces have
407 .It Cm netmask Ar mask
410 Specify how much of the address to reserve for subdividing
411 networks into sub-networks.
412 The mask includes the network part of the local address
413 and the subnet part, which is taken from the host field of the address.
414 The mask can be specified as a single hexadecimal number
417 with a dot-notation Internet address,
418 or with a pseudo-network name listed in the network table
420 The mask contains 1's for the bit positions in the 32-bit address
421 which are to be used for the network and subnet parts,
422 and 0's for the host part.
423 The mask should contain at least the standard network portion,
424 and the subnet field should be contiguous with the network
427 The netmask can also be specified in CIDR notation after the address.
430 option above for more information.
431 .It Cm prefixlen Ar len
435 bits are reserved for subdividing networks into sub-networks.
438 must be integer, and for syntactical reason it must be between 0 to 128.
439 It is almost always 64 under the current IPv6 assignment rule.
440 If the parameter is omitted, 64 is used.
442 The prefix can also be specified using the slash notation after the address.
445 option above for more information.
448 .\" .It Cm nsellength Ar n
451 .\" This specifies a trailing number of bytes for a received
453 .\" used for local identification, the remaining leading part of which is
456 .\" (Network Entity Title).
457 .\" The default value is 1, which is conformant to US
459 .\" When an ISO address is set in an ifconfig command,
462 .\" which is being specified.
465 .\" 20 hex digits should be
468 .\" to be assigned to the interface.
469 .\" There is some evidence that a number different from 1 may be useful
472 .\" 37 type addresses.
473 .It Cm range Ar netrange
474 Under appletalk, set the interface to respond to a
477 .Ar startnet Ns - Ns Ar endnet .
478 Appletalk uses this scheme instead of
481 implements it internally as a set of netmasks.
486 Introduced for compatibility
490 The argument following this specifies the version (phase) of the
491 Appletalk network attached to the interface.
492 Values of 1 or 2 are permitted.
494 .It Cm link Op Cm 0 No - Cm 2
496 Enable special processing of the link level of the interface.
497 These three options are interface specific in actual effect, however,
498 they are in general used to select special modes of operation.
500 of this is to enable SLIP compression, or to select the connector type
501 for some Ethernet cards.
502 Refer to the man page for the specific driver
503 for more information.
505 .It Fl link Op Cm 0 No - Cm 2
507 Disable special processing at the link level with the specified interface.
511 This may be used to enable an interface after an
513 It happens automatically when setting the first address on an interface.
514 If the interface was reset when previously marked down,
515 the hardware will be re-initialized.
517 For IEEE 802.11 wireless interfaces, set the desired Service Set
518 Identifier (aka network name).
519 The SSID is a string up to 32 characters
520 in length and may be specified as either a normal string or in
521 hexadecimal when proceeded by
523 Additionally, the SSID may be cleared by setting it to
532 .It Cm stationname Ar name
533 For IEEE 802.11 wireless interfaces, set the name of this station.
534 It appears that the station name is not really part of the IEEE 802.11
535 protocol though all interfaces seem to support it.
537 seems to be meaningful to identical or virtually identical equipment.
538 Setting the station name is identical in syntax to setting the SSID.
539 .It Cm station Ar name
546 .It Cm channel Ar number
547 For IEEE 802.11 wireless interfaces, set the desired channel.
548 Channels range from 1 to 14, but the exact selection available
549 depends on the region your adaptor was manufactured for.
551 the channel to 0 will give you the default for your adaptor.
553 adaptors ignore this setting unless you are in ad-hoc mode.
554 .It Cm authmode Ar mode
555 For IEEE 802.11 wireless interfaces, set the desired authentication mode
556 in infrastructure mode.
557 Not all adaptors support all modes.
564 Modes are case insensitive.
566 For IEEE 802.11 wireless interfaces, enable powersave mode.
568 For IEEE 802.11 wireless interfaces, disable powersave mode.
569 .It Cm powersavesleep Ar sleep
570 For IEEE 802.11 wireless interfaces, set the desired max powersave sleep
571 time in milliseconds.
572 .It Cm wepmode Ar mode
573 For IEEE 802.11 wireless interfaces, set the desired WEP mode.
574 Not all adaptors support all modes.
575 The set of valid modes is
581 mode explicitly tells the adaptor to allow association with access
582 points which allow both encrypted and unencrypted traffic.
585 means that the access point must only allow encrypted connections.
588 is generally another name for
590 Modes are case insensitive.
591 .It Cm weptxkey Ar index
592 For IEEE 802.11 wireless interfaces, set the WEP key to be used for
594 .It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
595 For IEEE 802.11 wireless interfaces, set the selected WEP key.
598 is not given, key 1 is set.
599 A WEP key will be either 5 or 13
600 characters (40 or 104 bits) depending of the local network and the
601 capabilities of the adaptor.
602 It may be specified either as a plain
603 string or as a string of hexadecimal digits proceeded by
605 For maximum portability, hex keys are recommended;
606 the mapping of text keys to WEP encryption is usually driver-specific.
609 drivers do this mapping differently to
611 A key may be cleared by setting it to
613 If WEP is supported then there are at least four keys.
614 Some adaptors support more than four keys.
615 If that is the case, then the first four keys
616 (1-4) will be the standard temporary keys and any others will be adaptor
617 specific keys such as permanent keys stored in NVRAM.
619 Another way of saying
625 Another way of saying
631 Another way of saying:
633 .Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
640 .Ar n : k1 , k2 , k3 , k4
643 Another way of saying
645 .Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
651 Another way of saying
661 utility displays the current configuration for a network interface
662 when no optional parameters are supplied.
663 If a protocol family is specified,
665 will report only the details specific to that protocol family.
667 If the driver does supports the media selection system, the supported
668 media list will be included in the output.
672 flag is passed before an interface name,
675 of the supported media for the specified interface.
678 flag is supplied, address lifetime is displayed for IPv6 addresses,
679 as time offset string.
683 flag may be used instead of an interface name.
686 to display information about all interfaces in the system.
689 flag limits this to interfaces that are down, and
691 limits this to interfaces that are up.
692 When no arguments are given,
698 flag may be used to list all available interfaces on the system, with
699 no other additional information.
700 Use of this flag is mutually exclusive
701 with all other flags and commands, except for
703 (only list interfaces that are down)
706 (only list interfaces that are up).
710 flag may be used to list all of the interface cloners available on
711 the system, with no additional information.
712 Use of this flag is mutually exclusive with all other flags and commands.
714 Only the super-user may modify the configuration of a network interface.
716 The media selection system is relatively new and only some drivers support
717 it (or have need for it).
719 Messages indicating the specified interface does not exist, the
720 requested address is unknown, or the user is not privileged and
721 tried to alter an interface's configuration.
723 IPv6 link-local addresses are required for several basic communication
725 If they are deleted by
727 manually, the kernel might show very strange behavior.
728 So, such manual deletions are strongly discouraged.