1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 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. 19.\" 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 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 33.\" $FreeBSD$ 34.\" 35.Dd February 13, 1996 36.Dt IFCONFIG 8 37.Os BSD 4.2 38.Sh NAME 39.Nm ifconfig 40.Nd configure network interface parameters 41.Sh SYNOPSIS 42.Nm ifconfig 43.Ar interface address_family 44.Oo 45.Ar address 46.Op Ar dest_address 47.Oc 48.Op Ar parameters 49.Nm ifconfig 50.Fl a 51.Op Fl d 52.Op Fl u 53.Op Ar address_family 54.Nm ifconfig 55.Fl l 56.Op Fl d 57.Op Fl u 58.Op Ar address_family 59.Sh DESCRIPTION 60.Nm Ifconfig 61is used to assign an address 62to a network interface and/or configure 63network interface parameters. 64.Nm Ifconfig 65must be used at boot time to define the network address 66of each interface present on a machine; it may also be used at 67a later time to redefine an interface's address 68or other operating parameters. 69.Pp 70The following options are available: 71.Bl -tag -width indent 72.It Ar address 73For the 74.Tn DARPA Ns -Internet 75family, 76the address is either a host name present in the host name data 77base, 78.Xr hosts 5 , 79or a 80.Tn DARPA 81Internet address expressed in the Internet standard 82.Dq dot notation . 83.\" For the Xerox Network Systems(tm) family, 84.\" addresses are 85.\" .Ar net:a.b.c.d.e.f , 86.\" where 87.\" .Ar net 88.\" is the assigned network number (in decimal), 89.\" and each of the six bytes of the host number, 90.\" .Ar a 91.\" through 92.\" .Ar f , 93.\" are specified in hexadecimal. 94.\" The host number may be omitted on 10Mb/s Ethernet interfaces, 95.\" which use the hardware physical address, 96.\" and on interfaces other than the first. 97.\" For the 98.\" .Tn ISO 99.\" family, addresses are specified as a long hexadecimal string, 100.\" as in the Xerox family. However, two consecutive dots imply a zero 101.\" byte, and the dots are optional, if the user wishes to (carefully) 102.\" count out long strings of digits in network byte order. 103.It Ar address_family 104Specify the 105.Ar "address family" 106which affects interpretation of the remaining parameters. 107Since an interface can receive transmissions in differing protocols 108with different naming schemes, specifying the address family is recommended. 109The address or protocol families currently 110supported are 111.Dq inet , 112.Dq inet6 , 113.Dq atalk , 114.\" .Dq iso , 115and 116.Dq ipx . 117.\" and 118.\" .Dq ns . 119.It Ar dest_address 120Specify the address of the correspondent on the other end 121of a point to point link. 122.It Ar interface 123This 124parameter is a string of the form 125.Dq name unit , 126for example, 127.Dq en0 . 128.El 129.Pp 130The following parameters may be set with 131.Nm ifconfig : 132.Bl -tag -width indent 133.It Cm add 134Another name for the ``alias'' parameter. Introduced for compatibility 135with BSD/OS. 136.It Cm alias 137Establish an additional network address for this interface. 138This is sometimes useful when changing network numbers, and 139one wishes to accept packets addressed to the old interface. 140If the address is on the same subnet as the first network address 141for this interface, a netmask of 0xffffffff has to be specified. 142.It Cm anycast 143(Inet6 only) 144Specify that the address configured is an anycast address. 145Based on the current specification, 146only routers may configure anycast addresses. 147Anycast address will not be used as source address of any of outgoing 148IPv6 packets. 149.It Cm arp 150Enable the use of the Address Resolution Protocol in mapping 151between network level addresses and link level addresses (default). 152This is currently implemented for mapping between 153.Tn DARPA 154Internet 155addresses and 10Mb/s Ethernet addresses. 156.It Fl arp 157Disable the use of the Address Resolution Protocol. 158.It Cm broadcast 159(Inet only) 160Specify the address to use to represent broadcasts to the 161network. 162The default broadcast address is the address with a host part of all 1's. 163.It Cm debug 164Enable driver dependent debugging code; usually, this turns on 165extra console error logging. 166.It Fl debug 167Disable driver dependent debugging code. 168.It Cm delete 169Remove the network address specified. 170This would be used if you incorrectly specified an alias, or it 171was no longer needed. 172If you have incorrectly set an NS address having the side effect 173of specifying the host portion, removing all NS addresses will 174allow you to respecify the host portion. 175.It Cm down 176Mark an interface ``down''. When an interface is 177marked ``down'', the system will not attempt to 178transmit messages through that interface. 179If possible, the interface will be reset to disable reception as well. 180This action does not automatically disable routes using the interface. 181.\" .It Cm ipdst 182.\" This is used to specify an Internet host who is willing to receive 183.\" ip packets encapsulating NS packets bound for a remote network. 184.\" An apparent point to point link is constructed, and 185.\" the address specified will be taken as the NS address and network 186.\" of the destination. 187.\" IP encapsulation of 188.\" .Tn CLNP 189.\" packets is done differently. 190.It Cm media Ar type 191If the driver supports the media selection system, set the media type 192of the interface to 193.Ar type . 194Some interfaces support the mutually exclusive use of one of several 195different physical media connectors. For example, a 10Mb/s Ethernet 196interface might support the use of either 197.Tn AUI 198or twisted pair connectors. Setting the media type to 199.Dq 10base5/AUI 200would change the currently active connector to the AUI port. 201Setting it to 202.Dq 10baseT/UTP 203would activate twisted pair. Refer to the interfaces' driver 204specific documentation or man page for a complete list of the 205available types. 206.It Cm mediaopt Ar opts 207If the driver supports the media selection system, set the specified 208media options on the interface. 209.Ar Opts 210is a comma delimited list of options to apply to the interface. 211Refer to the interfaces' driver specific man page for a complete 212list of available options. 213.It Fl mediaopt Ar opts 214If the driver supports the media selection system, disable the 215specified media options on the interface. 216.It Cm vlan Ar vlan_tag 217If the interface is a vlan pseudo interface, set the vlan tag value 218to 219.Ar vlan_tag . 220This value is a 16-bit number which is used to create an 802.1Q 221vlan header for packets sent from the vlan interface. Note that 222.Cm vlan 223and 224.Cm vlandev 225must both be set at the same time. 226.It Cm vlandev Ar iface 227If the interface is a vlan pseudo device, associate physical interface 228.Ar iface 229with it. Packets transmitted through the vlan interface will be 230diverted to the specified physical interface 231.Ar iface 232with 802.1Q vlan encapsulation. Packets with 802.1Q encapsulation received 233by the parent interface with the correct vlan tag will be diverted to 234the associated vlan pseudo-interface. The vlan interface is assigned a 235copy of the parent interface's flags and the parent's ethernet address. 236The 237.Cm vlandev 238and 239.Cm vlan 240must both be set at the same time. If the vlan interface already has 241a physical interface associated with it, this command will fail. To 242change the association to another physical interface, the existing 243association must be cleared first. 244.Pp 245Note: if the 246.Ar link0 247flag is set on the vlan interface, the vlan pseudo 248interface's behavior changes: the 249.Ar link0 250tells the vlan interface that the 251parent interface supports insertion and extraction of vlan tags on its 252own (usually in firmware) and that it should pass packets to and from 253the parent unaltered. 254.It Fl vlandev Ar iface 255If the driver is a vlan pseudo device, disassociate the physical interface 256.Ar iface 257from it. This breaks the link between the vlan interface and its parent, 258clears its vlan tag, flags and its link address and shuts the interface down. 259.It Cm metric Ar n 260Set the routing metric of the interface to 261.Ar n , 262default 0. 263The routing metric is used by the routing protocol 264.Pq Xr routed 8 . 265Higher metrics have the effect of making a route 266less favorable; metrics are counted as addition hops 267to the destination network or host. 268.It Cm mtu Ar n 269Set the maximum transmission unit of the interface to 270.Ar n , 271default is interface specific. 272The mtu is used to limit the size of packets that are transmitted on an 273interface. 274Not all interfaces support setting the mtu, and some interfaces have 275range restrictions. 276.It Cm netmask Ar mask 277.\" (Inet and ISO) 278(Inet only) 279Specify how much of the address to reserve for subdividing 280networks into sub-networks. 281The mask includes the network part of the local address 282and the subnet part, which is taken from the host field of the address. 283The mask can be specified as a single hexadecimal number 284with a leading 0x, with a dot-notation Internet address, 285or with a pseudo-network name listed in the network table 286.Xr networks 5 . 287The mask contains 1's for the bit positions in the 32-bit address 288which are to be used for the network and subnet parts, 289and 0's for the host part. 290The mask should contain at least the standard network portion, 291and the subnet field should be contiguous with the network 292portion. 293.It Cm prefixlen Ar len 294(Inet6 only) 295Specify that 296.Ar len 297bits are reserved for subdividing networks into sub-networks. 298The 299.Ar len 300must be integer, and for syntactical reason it must be between 0 to 128. 301It is almost always 64 under the current IPv6 assignment rule. 302If the parameter is ommitted, 64 is used. 303.\" see 304.\" Xr eon 5 . 305.\" .It Cm nsellength Ar n 306.\" .Pf ( Tn ISO 307.\" only) 308.\" This specifies a trailing number of bytes for a received 309.\" .Tn NSAP 310.\" used for local identification, the remaining leading part of which is 311.\" taken to be the 312.\" .Tn NET 313.\" (Network Entity Title). 314.\" The default value is 1, which is conformant to US 315.\" .Tn GOSIP . 316.\" When an ISO address is set in an ifconfig command, 317.\" it is really the 318.\" .Tn NSAP 319.\" which is being specified. 320.\" For example, in 321.\" .Tn US GOSIP , 322.\" 20 hex digits should be 323.\" specified in the 324.\" .Tn ISO NSAP 325.\" to be assigned to the interface. 326.\" There is some evidence that a number different from 1 may be useful 327.\" for 328.\" .Tn AFI 329.\" 37 type addresses. 330.It Cm range 331Under appletalk, set the interface to respond to a 332.Em netrange. 333of the form startnet-endnet. Appletalk uses this scheme instead of 334netmasks though 335.Fx 336implements it internally as a set of netmasks. 337.It Cm remove 338Another name for the ``delete'' parameter. Introduced for compatibility 339with BSD/OS. 340.It Cm phase 341The argument following this specifies the version (phase) of the 342Appletalk network attached to the interface. Values of 1 or 2 are permitted. 343.It Cm link[0-2] 344Enable special processing of the link level of the interface. 345These three options are interface specific in actual effect, however, 346they are in general used to select special modes of operation. An example 347of this is to enable SLIP compression, or to select the connector type 348for some Ethernet cards. Refer to the man page for the specific driver 349for more information. 350.It Fl link[0-2] 351Disable special processing at the link level with the specified interface. 352.It Cm up 353Mark an interface 354.Dq up . 355This may be used to enable an interface after an 356.Dq ifconfig down . 357It happens automatically when setting the first address on an interface. 358If the interface was reset when previously marked down, 359the hardware will be re-initialized. 360.El 361.Pp 362.Nm Ifconfig 363displays the current configuration for a network interface 364when no optional parameters are supplied. 365If a protocol family is specified, 366.Nm 367will report only the details specific to that protocol family. 368.Pp 369If the driver does supports the media selection system, the supported 370media list will be included in the output. 371.Pp 372If 373.Fl L 374flag is supplied, address lifetime is dislayed for IPv6 addresses, 375as time offset string. 376.Pp 377Optionally, the 378.Fl a 379flag may be used instead of an interface name. This flag instructs 380.Nm 381to display information about all interfaces in the system. 382The 383.Fl d 384flag limits this to interfaces that are down, and 385.Fl u 386limits this to interfaces that are up. 387.Pp 388The 389.Fl l 390flag may be used to list all available interfaces on the system, with 391no other additional information. Use of this flag is mutually exclusive 392with all other flags and commands, except for 393.Fl d 394(only list interfaces that are down) 395and 396.Fl u 397(only list interfaces that are up). 398.Pp 399Only the super-user may modify the configuration of a network interface. 400.Sh NOTES 401The media selection system is relatively new and only some drivers support 402it (or have need for it). 403.Sh DIAGNOSTICS 404Messages indicating the specified interface does not exist, the 405requested address is unknown, or the user is not privileged and 406tried to alter an interface's configuration. 407.Sh BUGS 408IPv6 link-local addresses are required for several basic communication 409between IPv6 node. If they are deleted by 410.Nm ifconfig 411manually, the kernel might show very strange behavior. 412So, such manual deletions are strongly discouraged. 413.Sh SEE ALSO 414.Xr netstat 1 , 415.Xr netintro 4 , 416.Xr rc 8 , 417.Xr routed 8 418.\" .Xr eon 5 419.Sh HISTORY 420The 421.Nm 422command appeared in 423.Bx 4.2 . 424