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