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.14 2001/08/23 06:35:38 yar Exp $
40 .Nd configure network interface parameters
49 .Ar address Ns Op Cm / Ns Ar prefixlength
75 is used to assign an address
76 to a network interface and/or configure
77 network interface parameters.
79 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
102 .\" For the Xerox Network Systems(tm) family,
104 .\" .Ar net:a.b.c.d.e.f ,
107 .\" is the assigned network number (in decimal),
108 .\" and each of the six bytes of the host number,
112 .\" are specified in hexadecimal.
113 .\" The host number may be omitted on IEEE 802 protocol
114 .\" (Ethernet, FDDI, and Token Ring) interfaces,
115 .\" which use the hardware physical address,
116 .\" and on interfaces other than the first.
119 .\" family, addresses are specified as a long hexadecimal string,
120 .\" as in the Xerox family.
121 .\" However, two consecutive dots imply a zero
122 .\" byte, and the dots are optional, if the user wishes to (carefully)
123 .\" count out long strings of digits in network byte order.
124 .It Ar address_family
127 which affects interpretation of the remaining parameters.
128 Since an interface can receive transmissions in differing protocols
129 with different naming schemes, specifying the address family is recommended.
130 The address or protocol families currently
137 Specify the address of the correspondent on the other end
138 of a point to point link.
141 parameter is a string of the form
147 The following parameters may be set with
149 .Bl -tag -width indent
154 Introduced for compatibility
158 Establish an additional network address for this interface.
159 This is sometimes useful when changing network numbers, and
160 one wishes to accept packets addressed to the old interface.
161 If the address is on the same subnet as the first network address
162 for this interface, a netmask of
166 Remove the network address specified.
167 This would be used if you incorrectly specified an alias, or it
168 was no longer needed.
169 If you have incorrectly set an NS address having the side effect
170 of specifying the host portion, removing all NS addresses will
171 allow you to respecify the host portion.
174 Specify that the address configured is an anycast address.
175 Based on the current specification,
176 only routers may configure anycast addresses.
177 Anycast address will not be used as source address of any of outgoing
180 Enable the use of the Address Resolution Protocol
183 between network level addresses and link level addresses (default).
184 This is currently implemented for mapping between
189 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
191 Disable the use of the Address Resolution Protocol
195 Specify the address to use to represent broadcasts to the
197 The default broadcast address is the address with a host part of all 1's.
199 Enable driver dependent debugging code; usually, this turns on
200 extra console error logging.
202 Disable driver dependent debugging code.
210 When an interface is marked
212 the system will not attempt to
213 transmit messages through that interface.
214 If possible, the interface will be reset to disable reception as well.
215 This action does not automatically disable routes using the interface.
221 .\" This is used to specify an Internet host who is willing to receive
222 .\" ip packets encapsulating NS packets bound for a remote network.
223 .\" An apparent point to point link is constructed, and
224 .\" the address specified will be taken as the NS address and network
225 .\" of the destination.
226 .\" IP encapsulation of
228 .\" packets is done differently.
229 .It Cm lladdr Ar addr
230 Set the link-level address on an interface.
232 e.g. set a new MAC address on an ethernet interface, though the
233 mechanism used is not ethernet-specific.
236 is specified as a series of colon-separated hex digits.
237 If the interface is already
238 up when this option is used, it will be briefly brought down and
239 then brought back up again in order to ensure that the receive
240 filter in the underlying ethernet hardware is properly reprogrammed.
242 If the driver supports the media selection system, set the media type
245 Some interfaces support the mutually exclusive use of one of several
246 different physical media connectors.
247 For example, a 10Mb/s Ethernet
248 interface might support the use of either
250 or twisted pair connectors.
251 Setting the media type to
253 would change the currently active connector to the AUI port.
256 would activate twisted pair.
257 Refer to the interfaces' driver
258 specific documentation or man page for a complete list of the
260 .It Cm mediaopt Ar opts
261 If the driver supports the media selection system, set the specified
262 media options on the interface.
266 is a comma delimited list of options to apply to the interface.
267 Refer to the interfaces' driver specific man page for a complete
268 list of available options.
269 .It Fl mediaopt Ar opts
270 If the driver supports the media selection system, disable the
271 specified media options on the interface.
272 .It Cm tunnel Ar src_addr dest_addr
273 (IP tunnel devices only.)
274 Configure the physical source and destination address for IP tunnel
281 are interpreted as the outer source/destination for the encapsulating
284 Unconfigure the physical source and destination address for IP tunnel
285 interfaces previously configured with
288 Create the specified network pseudo-device.
289 If the interface is given without a unit number, try to create a new
290 device with an arbitrary unit number.
291 If creation of an arbitrary device is successful, the new device name is
292 printed to standard output.
294 Destroy the specified network pseudo-device.
309 .It Cm vlan Ar vlan_tag
310 If the interface is a vlan pseudo interface, set the vlan tag value
313 This value is a 16-bit number which is used to create an 802.1Q
314 vlan header for packets sent from the vlan interface.
319 must both be set at the same time.
320 .It Cm vlandev Ar iface
321 If the interface is a vlan pseudo device, associate physical interface
324 Packets transmitted through the vlan interface will be
325 diverted to the specified physical interface
327 with 802.1Q vlan encapsulation.
328 Packets with 802.1Q encapsulation received
329 by the parent interface with the correct vlan tag will be diverted to
330 the associated vlan pseudo-interface.
331 The vlan interface is assigned a
332 copy of the parent interface's flags and the parent's ethernet address.
337 must both be set at the same time.
338 If the vlan interface already has
339 a physical interface associated with it, this command will fail.
341 change the association to another physical interface, the existing
342 association must be cleared first.
344 Note: if the hardware tagging capability
345 is set on the vlan interface, the vlan pseudo
346 interface's behavior changes:
347 the vlan interface recognizes that the
348 parent interface supports insertion and extraction of vlan tags on its
349 own (usually in firmware) and that it should pass packets to and from
350 the parent unaltered.
351 .It Fl vlandev Ar iface
352 If the driver is a vlan pseudo device, disassociate the physical interface
355 This breaks the link between the vlan interface and its parent,
356 clears its vlan tag, flags and its link address and shuts the interface down.
358 Set the routing metric of the interface to
361 The routing metric is used by the routing protocol
363 Higher metrics have the effect of making a route
364 less favorable; metrics are counted as addition hops
365 to the destination network or host.
367 Set the maximum transmission unit of the interface to
369 default is interface specific.
370 The MTU is used to limit the size of packets that are transmitted on an
372 Not all interfaces support setting the MTU, and some interfaces have
374 .It Cm netmask Ar mask
377 Specify how much of the address to reserve for subdividing
378 networks into sub-networks.
379 The mask includes the network part of the local address
380 and the subnet part, which is taken from the host field of the address.
381 The mask can be specified as a single hexadecimal number
384 with a dot-notation Internet address,
385 or with a pseudo-network name listed in the network table
387 The mask contains 1's for the bit positions in the 32-bit address
388 which are to be used for the network and subnet parts,
389 and 0's for the host part.
390 The mask should contain at least the standard network portion,
391 and the subnet field should be contiguous with the network
394 The netmask can also be specified in CIDR notation after the address.
397 option above for more information.
398 .It Cm prefixlen Ar len
402 bits are reserved for subdividing networks into sub-networks.
405 must be integer, and for syntactical reason it must be between 0 to 128.
406 It is almost always 64 under the current IPv6 assignment rule.
407 If the parameter is omitted, 64 is used.
410 .\" .It Cm nsellength Ar n
413 .\" This specifies a trailing number of bytes for a received
415 .\" used for local identification, the remaining leading part of which is
418 .\" (Network Entity Title).
419 .\" The default value is 1, which is conformant to US
421 .\" When an ISO address is set in an ifconfig command,
424 .\" which is being specified.
427 .\" 20 hex digits should be
430 .\" to be assigned to the interface.
431 .\" There is some evidence that a number different from 1 may be useful
434 .\" 37 type addresses.
439 Introduced for compatibility
443 .It Cm link Op Cm 0 No - Cm 2
445 Enable special processing of the link level of the interface.
446 These three options are interface specific in actual effect, however,
447 they are in general used to select special modes of operation.
449 of this is to enable SLIP compression, or to select the connector type
450 for some Ethernet cards.
451 Refer to the man page for the specific driver
452 for more information.
454 .It Fl link Op Cm 0 No - Cm 2
456 Disable special processing at the link level with the specified interface.
460 This may be used to enable an interface after an
462 It happens automatically when setting the first address on an interface.
463 If the interface was reset when previously marked down,
464 the hardware will be re-initialized.
468 displays the current configuration for a network interface
469 when no optional parameters are supplied.
470 If a protocol family is specified,
472 will report only the details specific to that protocol family.
474 If the driver does supports the media selection system, the supported
475 media list will be included in the output.
479 flag is passed before an interface name,
482 of the supported media for the specified interface.
485 flag is supplied, address lifetime is displayed for IPv6 addresses,
486 as time offset string.
490 flag may be used instead of an interface name.
493 to display information about all interfaces in the system.
496 flag limits this to interfaces that are down, and
498 limits this to interfaces that are up.
499 When no arguments are given,
505 flag may be used to list all available interfaces on the system, with
506 no other additional information.
507 Use of this flag is mutually exclusive
508 with all other flags and commands, except for
510 (only list interfaces that are down)
513 (only list interfaces that are up).
515 Only the super-user may modify the configuration of a network interface.
517 The media selection system is relatively new and only some drivers support
518 it (or have need for it).
520 Messages indicating the specified interface does not exist, the
521 requested address is unknown, or the user is not privileged and
522 tried to alter an interface's configuration.
524 IPv6 link-local addresses are required for several basic communication
526 If they are deleted by
528 manually, the kernel might show very strange behavior.
529 So, such manual deletions are strongly discouraged.