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.4 2004/11/13 04:13:22 cpressey 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 specified network address from this interface
205 (if none is specified, all network addresses for the interface
207 This would be used if you incorrectly specified an alias, or it
208 was no longer needed.
209 If you have incorrectly set an NS address having the side effect
210 of specifying the host portion, removing all NS addresses will
211 allow you to respecify the host portion.
214 Specify that the address configured is an anycast address.
215 Based on the current specification,
216 only routers may configure anycast addresses.
217 Anycast address will not be used as source address of any of outgoing
220 Enable the use of the Address Resolution Protocol
223 between network level addresses and link level addresses (default).
224 This is currently implemented for mapping between
229 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
231 Disable the use of the Address Resolution Protocol
235 Specify the address to use to represent broadcasts to the
237 The default broadcast address is the address with a host part of all 1's.
239 Enable driver dependent debugging code; usually, this turns on
240 extra console error logging.
242 Disable driver dependent debugging code.
244 Put interface into permanently promiscuous mode.
246 Disable permanently promiscuous mode.
254 When an interface is marked
256 the system will not attempt to
257 transmit messages through that interface.
258 If possible, the interface will be reset to disable reception as well.
259 This action does not automatically disable routes using the interface.
263 (lowermost 64bit of an IPv6 address)
266 .\" This is used to specify an Internet host who is willing to receive
267 .\" ip packets encapsulating NS packets bound for a remote network.
268 .\" An apparent point to point link is constructed, and
269 .\" the address specified will be taken as the NS address and network
270 .\" of the destination.
271 .\" IP encapsulation of
273 .\" packets is done differently.
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.
305 .It Cm tunnel Ar src_addr dest_addr
306 (IP tunnel devices only.)
307 Configure the physical source and destination address for IP tunnel
314 are interpreted as the outer source/destination for the encapsulating
317 Unconfigure the physical source and destination address for IP tunnel
318 interfaces previously configured with
321 Create the specified network pseudo-device.
322 If the interface is given without a unit number, try to create a new
323 device with an arbitrary unit number.
324 If creation of an arbitrary device is successful, the new device name is
325 printed to standard output.
327 Destroy the specified network pseudo-device.
342 .It Cm vlan Ar vlan_tag
343 If the interface is a vlan pseudo interface, set the vlan tag value
346 This value is a 16-bit number which is used to create an 802.1Q
347 vlan header for packets sent from the vlan interface.
352 must both be set at the same time.
353 .It Cm vlandev Ar iface
354 If the interface is a vlan pseudo device, associate physical interface
357 Packets transmitted through the vlan interface will be
358 diverted to the specified physical interface
360 with 802.1Q vlan encapsulation.
361 Packets with 802.1Q encapsulation received
362 by the parent interface with the correct vlan tag will be diverted to
363 the associated vlan pseudo-interface.
364 The vlan interface is assigned a
365 copy of the parent interface's flags and the parent's ethernet address.
370 must both be set at the same time.
371 If the vlan interface already has
372 a physical interface associated with it, this command will fail.
374 change the association to another physical interface, the existing
375 association must be cleared first.
379 flag is set on the vlan interface, the vlan pseudo
380 interface's behavior changes: the
382 tells the vlan interface that the
383 parent interface supports insertion and extraction of vlan tags on its
384 own (usually in firmware) and that it should pass packets to and from
385 the parent unaltered.
386 .It Fl vlandev Ar iface
387 If the driver is a vlan pseudo device, disassociate the physical interface
390 This breaks the link between the vlan interface and its parent,
391 clears its vlan tag, flags and its link address and shuts the interface down.
393 Set the routing metric of the interface to
396 The routing metric is used by the routing protocol
398 Higher metrics have the effect of making a route
399 less favorable; metrics are counted as addition hops
400 to the destination network or host.
402 Set the maximum transmission unit of the interface to
404 default is interface specific.
405 The MTU is used to limit the size of packets that are transmitted on an
407 Not all interfaces support setting the MTU, and some interfaces have
409 .It Cm netmask Ar mask
412 Specify how much of the address to reserve for subdividing
413 networks into sub-networks.
414 The mask includes the network part of the local address
415 and the subnet part, which is taken from the host field of the address.
416 The mask can be specified as a single hexadecimal number
419 with a dot-notation Internet address,
420 or with a pseudo-network name listed in the network table
422 The mask contains 1's for the bit positions in the 32-bit address
423 which are to be used for the network and subnet parts,
424 and 0's for the host part.
425 The mask should contain at least the standard network portion,
426 and the subnet field should be contiguous with the network
429 The netmask can also be specified in CIDR notation after the address.
432 option above for more information.
433 .It Cm prefixlen Ar len
437 bits are reserved for subdividing networks into sub-networks.
440 must be integer, and for syntactical reason it must be between 0 to 128.
441 It is almost always 64 under the current IPv6 assignment rule.
442 If the parameter is omitted, 64 is used.
444 The prefix can also be specified using the slash notation after the address.
447 option above for more information.
450 .\" .It Cm nsellength Ar n
453 .\" This specifies a trailing number of bytes for a received
455 .\" used for local identification, the remaining leading part of which is
458 .\" (Network Entity Title).
459 .\" The default value is 1, which is conformant to US
461 .\" When an ISO address is set in an ifconfig command,
464 .\" which is being specified.
467 .\" 20 hex digits should be
470 .\" to be assigned to the interface.
471 .\" There is some evidence that a number different from 1 may be useful
474 .\" 37 type addresses.
475 .It Cm range Ar netrange
476 Under appletalk, set the interface to respond to a
479 .Ar startnet Ns - Ns Ar endnet .
480 Appletalk uses this scheme instead of
483 implements it internally as a set of netmasks.
488 Introduced for compatibility
492 The argument following this specifies the version (phase) of the
493 Appletalk network attached to the interface.
494 Values of 1 or 2 are permitted.
496 .It Cm link Op Cm 0 No - Cm 2
498 Enable special processing of the link level of the interface.
499 These three options are interface specific in actual effect, however,
500 they are in general used to select special modes of operation.
502 of this is to enable SLIP compression, or to select the connector type
503 for some Ethernet cards.
504 Refer to the man page for the specific driver
505 for more information.
507 .It Fl link Op Cm 0 No - Cm 2
509 Disable special processing at the link level with the specified interface.
513 This may be used to enable an interface after an
515 It happens automatically when setting the first address on an interface.
516 If the interface was reset when previously marked down,
517 the hardware will be re-initialized.
519 For IEEE 802.11 wireless interfaces, set the desired Service Set
520 Identifier (aka network name).
521 The SSID is a string up to 32 characters
522 in length and may be specified as either a normal string or in
523 hexadecimal when proceeded by
525 Additionally, the SSID may be cleared by setting it to
534 .It Cm stationname Ar name
535 For IEEE 802.11 wireless interfaces, set the name of this station.
536 It appears that the station name is not really part of the IEEE 802.11
537 protocol though all interfaces seem to support it.
539 seems to be meaningful to identical or virtually identical equipment.
540 Setting the station name is identical in syntax to setting the SSID.
541 .It Cm station Ar name
548 .It Cm channel Ar number
549 For IEEE 802.11 wireless interfaces, set the desired channel.
550 Channels range from 1 to 14, but the exact selection available
551 depends on the region your adaptor was manufactured for.
553 the channel to 0 will give you the default for your adaptor.
555 adaptors ignore this setting unless you are in ad-hoc mode.
556 .It Cm authmode Ar mode
557 For IEEE 802.11 wireless interfaces, set the desired authentication mode
558 in infrastructure mode.
559 Not all adaptors support all modes.
566 Modes are case insensitive.
568 For IEEE 802.11 wireless interfaces, enable powersave mode.
570 For IEEE 802.11 wireless interfaces, disable powersave mode.
571 .It Cm powersavesleep Ar sleep
572 For IEEE 802.11 wireless interfaces, set the desired max powersave sleep
573 time in milliseconds.
574 .It Cm wepmode Ar mode
575 For IEEE 802.11 wireless interfaces, set the desired WEP mode.
576 Not all adaptors support all modes.
577 The set of valid modes is
583 mode explicitly tells the adaptor to allow association with access
584 points which allow both encrypted and unencrypted traffic.
587 means that the access point must only allow encrypted connections.
590 is generally another name for
592 Modes are case insensitive.
593 .It Cm weptxkey Ar index
594 For IEEE 802.11 wireless interfaces, set the WEP key to be used for
596 .It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key
597 For IEEE 802.11 wireless interfaces, set the selected WEP key.
600 is not given, key 1 is set.
601 A WEP key will be either 5 or 13
602 characters (40 or 104 bits) depending of the local network and the
603 capabilities of the adaptor.
604 It may be specified either as a plain
605 string or as a string of hexadecimal digits proceeded by
607 For maximum portability, hex keys are recommended;
608 the mapping of text keys to WEP encryption is usually driver-specific.
611 drivers do this mapping differently to
613 A key may be cleared by setting it to
615 If WEP is supported then there are at least four keys.
616 Some adaptors support more than four keys.
617 If that is the case, then the first four keys
618 (1-4) will be the standard temporary keys and any others will be adaptor
619 specific keys such as permanent keys stored in NVRAM.
621 Another way of saying
627 Another way of saying
633 Another way of saying:
635 .Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" .
642 .Ar n : k1 , k2 , k3 , k4
645 Another way of saying
647 .Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" .
653 Another way of saying
663 utility displays the current configuration for a network interface
664 when no optional parameters are supplied.
665 If a protocol family is specified,
667 will report only the details specific to that protocol family.
669 If the driver does supports the media selection system, the supported
670 media list will be included in the output.
674 flag is passed before an interface name,
677 of the supported media for the specified interface.
680 flag is supplied, address lifetime is displayed for IPv6 addresses,
681 as time offset string.
685 flag may be used instead of an interface name.
688 to display information about all interfaces in the system.
691 flag limits this to interfaces that are down, and
693 limits this to interfaces that are up.
694 When no arguments are given,
700 flag may be used to list all available interfaces on the system, with
701 no other additional information.
702 Use of this flag is mutually exclusive
703 with all other flags and commands, except for
705 (only list interfaces that are down)
708 (only list interfaces that are up).
712 flag may be used to list all of the interface cloners available on
713 the system, with no additional information.
714 Use of this flag is mutually exclusive with all other flags and commands.
716 Only the super-user may modify the configuration of a network interface.
718 The media selection system is relatively new and only some drivers support
719 it (or have need for it).
721 Messages indicating the specified interface does not exist, the
722 requested address is unknown, or the user is not privileged and
723 tried to alter an interface's configuration.
725 IPv6 link-local addresses are required for several basic communication
727 If they are deleted by
729 manually, the kernel might show very strange behavior.
730 So, such manual deletions are strongly discouraged.