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. 222Note that 223.Cm vlan 224and 225.Cm vlandev 226must both be set at the same time. 227.It Cm vlandev Ar iface 228If the interface is a vlan pseudo device, associate physical interface 229.Ar iface 230with it. 231Packets transmitted through the vlan interface will be 232diverted to the specified physical interface 233.Ar iface 234with 802.1Q vlan encapsulation. 235Packets with 802.1Q encapsulation received 236by the parent interface with the correct vlan tag will be diverted to 237the associated vlan pseudo-interface. 238The vlan interface is assigned a 239copy of the parent interface's flags and the parent's ethernet address. 240The 241.Cm vlandev 242and 243.Cm vlan 244must both be set at the same time. 245If the vlan interface already has 246a physical interface associated with it, this command will fail. 247To 248change the association to another physical interface, the existing 249association must be cleared first. 250.Pp 251Note: if the 252.Ar link0 253flag is set on the vlan interface, the vlan pseudo 254interface's behavior changes: the 255.Ar link0 256tells the vlan interface that the 257parent interface supports insertion and extraction of vlan tags on its 258own (usually in firmware) and that it should pass packets to and from 259the parent unaltered. 260.It Fl vlandev Ar iface 261If the driver is a vlan pseudo device, disassociate the physical interface 262.Ar iface 263from it. 264This breaks the link between the vlan interface and its parent, 265clears its vlan tag, flags and its link address and shuts the interface down. 266.It Cm metric Ar n 267Set the routing metric of the interface to 268.Ar n , 269default 0. 270The routing metric is used by the routing protocol 271.Pq Xr routed 8 . 272Higher metrics have the effect of making a route 273less favorable; metrics are counted as addition hops 274to the destination network or host. 275.It Cm mtu Ar n 276Set the maximum transmission unit of the interface to 277.Ar n , 278default is interface specific. 279The mtu is used to limit the size of packets that are transmitted on an 280interface. 281Not all interfaces support setting the mtu, and some interfaces have 282range restrictions. 283.It Cm netmask Ar mask 284.\" (Inet and ISO) 285(Inet only) 286Specify how much of the address to reserve for subdividing 287networks into sub-networks. 288The mask includes the network part of the local address 289and the subnet part, which is taken from the host field of the address. 290The mask can be specified as a single hexadecimal number 291with a leading 0x, with a dot-notation Internet address, 292or with a pseudo-network name listed in the network table 293.Xr networks 5 . 294The mask contains 1's for the bit positions in the 32-bit address 295which are to be used for the network and subnet parts, 296and 0's for the host part. 297The mask should contain at least the standard network portion, 298and the subnet field should be contiguous with the network 299portion. 300.It Cm prefixlen Ar len 301(Inet6 only) 302Specify that 303.Ar len 304bits are reserved for subdividing networks into sub-networks. 305The 306.Ar len 307must be integer, and for syntactical reason it must be between 0 to 128. 308It is almost always 64 under the current IPv6 assignment rule. 309If the parameter is ommitted, 64 is used. 310.\" see 311.\" Xr eon 5 . 312.\" .It Cm nsellength Ar n 313.\" .Pf ( Tn ISO 314.\" only) 315.\" This specifies a trailing number of bytes for a received 316.\" .Tn NSAP 317.\" used for local identification, the remaining leading part of which is 318.\" taken to be the 319.\" .Tn NET 320.\" (Network Entity Title). 321.\" The default value is 1, which is conformant to US 322.\" .Tn GOSIP . 323.\" When an ISO address is set in an ifconfig command, 324.\" it is really the 325.\" .Tn NSAP 326.\" which is being specified. 327.\" For example, in 328.\" .Tn US GOSIP , 329.\" 20 hex digits should be 330.\" specified in the 331.\" .Tn ISO NSAP 332.\" to be assigned to the interface. 333.\" There is some evidence that a number different from 1 may be useful 334.\" for 335.\" .Tn AFI 336.\" 37 type addresses. 337.It Cm range 338Under appletalk, set the interface to respond to a 339.Em netrange. 340of the form startnet-endnet. 341Appletalk uses this scheme instead of 342netmasks though 343.Fx 344implements it internally as a set of netmasks. 345.It Cm remove 346Another name for the ``delete'' parameter. Introduced for compatibility 347with BSD/OS. 348.It Cm phase 349The argument following this specifies the version (phase) of the 350Appletalk network attached to the interface. 351Values of 1 or 2 are permitted. 352.It Cm link[0-2] 353Enable special processing of the link level of the interface. 354These three options are interface specific in actual effect, however, 355they are in general used to select special modes of operation. 356An example 357of this is to enable SLIP compression, or to select the connector type 358for some Ethernet cards. Refer to the man page for the specific driver 359for more information. 360.It Fl link[0-2] 361Disable special processing at the link level with the specified interface. 362.It Cm up 363Mark an interface 364.Dq up . 365This may be used to enable an interface after an 366.Dq ifconfig down . 367It happens automatically when setting the first address on an interface. 368If the interface was reset when previously marked down, 369the hardware will be re-initialized. 370.El 371.Pp 372.Nm Ifconfig 373displays the current configuration for a network interface 374when no optional parameters are supplied. 375If a protocol family is specified, 376.Nm 377will report only the details specific to that protocol family. 378.Pp 379If the driver does supports the media selection system, the supported 380media list will be included in the output. 381.Pp 382If 383.Fl L 384flag is supplied, address lifetime is dislayed for IPv6 addresses, 385as time offset string. 386.Pp 387Optionally, the 388.Fl a 389flag may be used instead of an interface name. This flag instructs 390.Nm 391to display information about all interfaces in the system. 392The 393.Fl d 394flag limits this to interfaces that are down, and 395.Fl u 396limits this to interfaces that are up. 397.Pp 398The 399.Fl l 400flag may be used to list all available interfaces on the system, with 401no other additional information. Use of this flag is mutually exclusive 402with all other flags and commands, except for 403.Fl d 404(only list interfaces that are down) 405and 406.Fl u 407(only list interfaces that are up). 408.Pp 409Only the super-user may modify the configuration of a network interface. 410.Sh NOTES 411The media selection system is relatively new and only some drivers support 412it (or have need for it). 413.Sh DIAGNOSTICS 414Messages indicating the specified interface does not exist, the 415requested address is unknown, or the user is not privileged and 416tried to alter an interface's configuration. 417.Sh BUGS 418IPv6 link-local addresses are required for several basic communication 419between IPv6 node. 420If they are deleted by 421.Nm ifconfig 422manually, the kernel might show very strange behavior. 423So, such manual deletions are strongly discouraged. 424.Sh SEE ALSO 425.Xr netstat 1 , 426.Xr netintro 4 , 427.Xr rc 8 , 428.Xr routed 8 429.\" .Xr eon 5 430.Sh HISTORY 431The 432.Nm 433command appeared in 434.Bx 4.2 . 435