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 acknowledgement: 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.\" $Id: ifconfig.8,v 1.6 1996/02/06 20:35:51 wollman Exp $ 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.Ar interface 51.Op Ar protocol_family 52.Nm ifconfig 53.Ar -a 54.Nm ifconfig 55.Ar -au 56.Nm ifconfig 57.Ar -ad 58.Sh DESCRIPTION 59.Nm Ifconfig 60is used to assign an address 61to a network interface and/or configure 62network interface parameters. 63.Nm Ifconfig 64must be used at boot time to define the network address 65of each interface present on a machine; it may also be used at 66a later time to redefine an interface's address 67or other operating parameters. 68.Pp 69Available operands for 70.Nm ifconfig: 71.Bl -tag -width Ds 72.It Ar Address 73For the 74.Tn DARPA-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 104Specifies 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 iso , 113and 114.Dq ipx . 115.\" and 116.\" .Dq ns . 117.It Ar Interface 118The 119.Ar interface 120parameter is a string of the form 121.Dq name unit , 122for example, 123.Dq en0 124.El 125.Pp 126The following parameters may be set with 127.Nm ifconfig : 128.Bl -tag -width dest_addressxx 129.It Cm alias 130Establish an additional network address for this interface. 131This is sometimes useful when changing network numbers, and 132one wishes to accept packets addressed to the old interface. 133.It Cm arp 134Enable the use of the Address Resolution Protocol in mapping 135between network level addresses and link level addresses (default). 136This is currently implemented for mapping between 137.Tn DARPA 138Internet 139addresses and 10Mb/s Ethernet addresses. 140.It Fl arp 141Disable the use of the Address Resolution Protocol. 142.It Cm broadcast 143(Inet only) 144Specify the address to use to represent broadcasts to the 145network. 146The default broadcast address is the address with a host part of all 1's. 147.It Cm debug 148Enable driver dependent debugging code; usually, this turns on 149extra console error logging. 150.It Fl debug 151Disable driver dependent debugging code. 152.It Cm delete 153Remove the network address specified. 154This would be used if you incorrectly specified an alias, or it 155was no longer needed. 156If you have incorrectly set an NS address having the side effect 157of specifying the host portion, removing all NS addresses will 158allow you to respecify the host portion. 159.It Cm dest_address 160Specify the address of the correspondent on the other end 161of a point to point link. 162.It Cm down 163Mark an interface ``down''. When an interface is 164marked ``down'', the system will not attempt to 165transmit messages through that interface. 166If possible, the interface will be reset to disable reception as well. 167This action does not automatically disable routes using the interface. 168.\" .It Cm ipdst 169.\" This is used to specify an Internet host who is willing to receive 170.\" ip packets encapsulating NS packets bound for a remote network. 171.\" An apparent point to point link is constructed, and 172.\" the address specified will be taken as the NS address and network 173.\" of the destination. 174.\" IP encapsulation of 175.\" .Tn CLNP 176.\" packets is done differently. 177.It Cm metric Ar n 178Set the routing metric of the interface to 179.Ar n , 180default 0. 181The routing metric is used by the routing protocol 182.Pq Xr routed 8 . 183Higher metrics have the effect of making a route 184less favorable; metrics are counted as addition hops 185to the destination network or host. 186.It Cm mtu Ar n 187Set the maximum transmission unit of the interface to 188.Ar n , 189default is interface specific. 190The mtu is used to limit the size of packets that are transmitted on an 191interface. 192Not all interfaces support setting the mtu, and some interfaces have 193range restrictions. 194.It Cm netmask Ar mask 195.\" (Inet and ISO) 196(Inet only) 197Specify how much of the address to reserve for subdividing 198networks into sub-networks. 199The mask includes the network part of the local address 200and the subnet part, which is taken from the host field of the address. 201The mask can be specified as a single hexadecimal number 202with a leading 0x, with a dot-notation Internet address, 203or with a pseudo-network name listed in the network table 204.Xr networks 5 . 205The mask contains 1's for the bit positions in the 32-bit address 206which are to be used for the network and subnet parts, 207and 0's for the host part. 208The mask should contain at least the standard network portion, 209and the subnet field should be contiguous with the network 210portion. 211.\" see 212.\" Xr eon 5 . 213.\" .It Cm nsellength Ar n 214.\" .Pf ( Tn ISO 215.\" only) 216.\" This specifies a trailing number of bytes for a received 217.\" .Tn NSAP 218.\" used for local identification, the remaining leading part of which is 219.\" taken to be the 220.\" .Tn NET 221.\" (Network Entity Title). 222.\" The default value is 1, which is conformant to US 223.\" .Tn GOSIP . 224.\" When an ISO address is set in an ifconfig command, 225.\" it is really the 226.\" .Tn NSAP 227.\" which is being specified. 228.\" For example, in 229.\" .Tn US GOSIP , 230.\" 20 hex digits should be 231.\" specified in the 232.\" .Tn ISO NSAP 233.\" to be assigned to the interface. 234.\" There is some evidence that a number different from 1 may be useful 235.\" for 236.\" .Tn AFI 237.\" 37 type addresses. 238.It Cm link[0-2] 239Enable special processing of the link level of the interface. 240These three options are interface specific in actual effect, however, 241they are in general used to select special modes of operation. An example 242of this is to enable SLIP compression. 243.It Fl link[0-2] 244Disable special processing at the link level with the specified interface. 245.It Cm up 246Mark an interface ``up''. 247This may be used to enable an interface after an ``ifconfig down.'' 248It happens automatically when setting the first address on an interface. 249If the interface was reset when previously marked down, 250the hardware will be re-initialized. 251.El 252.Pp 253.Pp 254The 255.Nm ifconfig 256.Fl a 257command 258displays information on all interfaces. When followed by a configuration 259parameter, it will also set the configuration on all interfaces. 260.Pp 261.Nm Ifconfig 262.Fl au 263is similar to 264.Nm ifconfig 265.Fl a , 266except it only affects interfaces that are currently marked as up. 267Similarly, 268.Nm ifconfig 269.Fl ad 270affects only interfaces that are marked down. 271.Pp 272The 273.Nm 274program 275displays the current configuration for a network interface 276when no optional parameters are supplied. 277If a protocol family is specified, 278.Nm ifconfig 279will report only the details specific to that protocol family. 280.Pp 281Only the super-user may modify the configuration of a network interface. 282.Sh DIAGNOSTICS 283Messages indicating the specified interface does not exit, the 284requested address is unknown, or the user is not privileged and 285tried to alter an interface's configuration. 286.Sh SEE ALSO 287.Xr netstat 1 , 288.Xr netintro 4 , 289.Xr rc 8 , 290.Xr routed 8 , 291.\" .Xr eon 5 292.Sh HISTORY 293The 294.Nm 295command appeared in 296.Bx 4.2 . 297