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
76 is used to assign an address
77 to a network interface and/or configure
78 network interface parameters.
80 must be used at boot time to define the network address
81 of each interface present on a machine; it may also be used at
82 a later time to redefine an interface's address
83 or other operating parameters.
85 The following options are available:
86 .Bl -tag -width indent
89 .Tn DARPA Ns -Internet
91 the address is either a host name present in the host name data
96 Internet address expressed in the Internet standard
99 It is also possible to use the CIDR notation (also known as the
100 slash notation) to include the netmask.
101 That is, one can specify an address like
103 .\" For the Xerox Network Systems(tm) family,
105 .\" .Ar net:a.b.c.d.e.f ,
108 .\" is the assigned network number (in decimal),
109 .\" and each of the six bytes of the host number,
113 .\" are specified in hexadecimal.
114 .\" The host number may be omitted on IEEE 802 protocol
115 .\" (Ethernet, FDDI, and Token Ring) interfaces,
116 .\" which use the hardware physical address,
117 .\" and on interfaces other than the first.
120 .\" family, addresses are specified as a long hexadecimal string,
121 .\" as in the Xerox family.
122 .\" However, two consecutive dots imply a zero
123 .\" byte, and the dots are optional, if the user wishes to (carefully)
124 .\" count out long strings of digits in network byte order.
125 .It Ar address_family
128 which affects interpretation of the remaining parameters.
129 Since an interface can receive transmissions in differing protocols
130 with different naming schemes, specifying the address family is recommended.
131 The address or protocol families currently
138 Specify the address of the correspondent on the other end
139 of a point to point link.
142 parameter is a string of the form
148 The following parameters may be set with
150 .Bl -tag -width indent
155 Introduced for compatibility
159 Establish an additional network address for this interface.
160 This is sometimes useful when changing network numbers, and
161 one wishes to accept packets addressed to the old interface.
162 If the address is on the same subnet as the first network address
163 for this interface, a netmask of
167 Remove the network address specified.
168 This would be used if you incorrectly specified an alias, or it
169 was no longer needed.
170 If you have incorrectly set an NS address having the side effect
171 of specifying the host portion, removing all NS addresses will
172 allow you to respecify the host portion.
175 Specify that the address configured is an anycast address.
176 Based on the current specification,
177 only routers may configure anycast addresses.
178 Anycast address will not be used as source address of any of outgoing
181 Enable the use of the Address Resolution Protocol
184 between network level addresses and link level addresses (default).
185 This is currently implemented for mapping between
190 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
192 Disable the use of the Address Resolution Protocol
196 Specify the address to use to represent broadcasts to the
198 The default broadcast address is the address with a host part of all 1's.
200 Enable driver dependent debugging code; usually, this turns on
201 extra console error logging.
203 Disable driver dependent debugging code.
211 When an interface is marked
213 the system will not attempt to
214 transmit messages through that interface.
215 If possible, the interface will be reset to disable reception as well.
216 This action does not automatically disable routes using the interface.
222 .\" This is used to specify an Internet host who is willing to receive
223 .\" ip packets encapsulating NS packets bound for a remote network.
224 .\" An apparent point to point link is constructed, and
225 .\" the address specified will be taken as the NS address and network
226 .\" of the destination.
227 .\" IP encapsulation of
229 .\" packets is done differently.
230 .It Cm lladdr Ar addr
231 Set the link-level address on an interface.
233 e.g. set a new MAC address on an ethernet interface, though the
234 mechanism used is not ethernet-specific.
237 is specified as a series of colon-separated hex digits.
238 If the interface is already
239 up when this option is used, it will be briefly brought down and
240 then brought back up again in order to ensure that the receive
241 filter in the underlying ethernet hardware is properly reprogrammed.
243 If the driver supports the media selection system, set the media type
246 Some interfaces support the mutually exclusive use of one of several
247 different physical media connectors.
248 For example, a 10Mb/s Ethernet
249 interface might support the use of either
251 or twisted pair connectors.
252 Setting the media type to
254 would change the currently active connector to the AUI port.
257 would activate twisted pair.
258 Refer to the interfaces' driver
259 specific documentation or man page for a complete list of the
261 .It Cm mediaopt Ar opts
262 If the driver supports the media selection system, set the specified
263 media options on the interface.
267 is a comma delimited list of options to apply to the interface.
268 Refer to the interfaces' driver specific man page for a complete
269 list of available options.
270 .It Fl mediaopt Ar opts
271 If the driver supports the media selection system, disable the
272 specified media options on the interface.
273 .It Cm tunnel Ar src_addr dest_addr
274 (IP tunnel devices only.)
275 Configure the physical source and destination address for IP tunnel
282 are interpreted as the outer source/destination for the encapsulating
285 Unconfigure the physical source and destination address for IP tunnel
286 interfaces previously configured with
289 Create the specified network pseudo-device.
290 If the interface is given without a unit number, try to create a new
291 device with an arbitrary unit number.
292 If creation of an arbitrary device is sucessful, the new device name is
293 printed to standard output.
295 Destroy the specified network pseudo-device.
311 Set the routing metric of the interface to
314 The routing metric is used by the routing protocol
316 Higher metrics have the effect of making a route
317 less favorable; metrics are counted as addition hops
318 to the destination network or host.
320 Set the maximum transmission unit of the interface to
322 default is interface specific.
323 The MTU is used to limit the size of packets that are transmitted on an
325 Not all interfaces support setting the MTU, and some interfaces have
327 .It Cm netmask Ar mask
330 Specify how much of the address to reserve for subdividing
331 networks into sub-networks.
332 The mask includes the network part of the local address
333 and the subnet part, which is taken from the host field of the address.
334 The mask can be specified as a single hexadecimal number
337 with a dot-notation Internet address,
338 or with a pseudo-network name listed in the network table
340 The mask contains 1's for the bit positions in the 32-bit address
341 which are to be used for the network and subnet parts,
342 and 0's for the host part.
343 The mask should contain at least the standard network portion,
344 and the subnet field should be contiguous with the network
347 The netmask can also be specified in CIDR notation after the address.
350 option above for more information.
351 .It Cm prefixlen Ar len
355 bits are reserved for subdividing networks into sub-networks.
358 must be integer, and for syntactical reason it must be between 0 to 128.
359 It is almost always 64 under the current IPv6 assignment rule.
360 If the parameter is omitted, 64 is used.
363 .\" .It Cm nsellength Ar n
366 .\" This specifies a trailing number of bytes for a received
368 .\" used for local identification, the remaining leading part of which is
371 .\" (Network Entity Title).
372 .\" The default value is 1, which is conformant to US
374 .\" When an ISO address is set in an ifconfig command,
377 .\" which is being specified.
380 .\" 20 hex digits should be
383 .\" to be assigned to the interface.
384 .\" There is some evidence that a number different from 1 may be useful
387 .\" 37 type addresses.
392 Introduced for compatibility
396 .It Cm link Op Cm 0 No - Cm 2
398 Enable special processing of the link level of the interface.
399 These three options are interface specific in actual effect, however,
400 they are in general used to select special modes of operation.
402 of this is to enable SLIP compression, or to select the connector type
403 for some Ethernet cards.
404 Refer to the man page for the specific driver
405 for more information.
407 .It Fl link Op Cm 0 No - Cm 2
409 Disable special processing at the link level with the specified interface.
413 This may be used to enable an interface after an
415 It happens automatically when setting the first address on an interface.
416 If the interface was reset when previously marked down,
417 the hardware will be re-initialized.
421 displays the current configuration for a network interface
422 when no optional parameters are supplied.
423 If a protocol family is specified,
425 will report only the details specific to that protocol family.
427 If the driver does supports the media selection system, the supported
428 media list will be included in the output.
432 flag is passed before an interface name,
435 of the supported media for the specified interface.
438 flag is supplied, address lifetime is displayed for IPv6 addresses,
439 as time offset string.
443 flag may be used instead of an interface name.
446 to display information about all interfaces in the system.
449 flag limits this to interfaces that are down, and
451 limits this to interfaces that are up.
452 When no arguments are given,
458 flag may be used to list all available interfaces on the system, with
459 no other additional information.
460 Use of this flag is mutually exclusive
461 with all other flags and commands, except for
463 (only list interfaces that are down)
466 (only list interfaces that are up).
470 flag may be used to list all of the interface cloners available on
471 the system, with no additional information.
472 Use of this flag is mutually exclusive with all other flags and commands.
474 Only the super-user may modify the configuration of a network interface.
476 The media selection system is relatively new and only some drivers support
477 it (or have need for it).
479 Messages indicating the specified interface does not exist, the
480 requested address is unknown, or the user is not privileged and
481 tried to alter an interface's configuration.
483 IPv6 link-local addresses are required for several basic communication
485 If they are deleted by
487 manually, the kernel might show very strange behavior.
488 So, such manual deletions are strongly discouraged.