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.\" @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 33.\" 34.Dd January 5, 1994 35.Dt IFCONFIG 8 36.Os BSD 4.2 37.Sh NAME 38.Nm ifconfig 39.Nd configure network interface parameters 40.Sh SYNOPSIS 41.Nm ifconfig 42.Ar interface address_family 43.Oo 44.Ar address 45.Op Ar dest_address 46.Oc 47.Op Ar parameters 48.Nm ifconfig 49.Ar interface 50.Op Ar protocol_family 51.Nm ifconfig 52.Ar -a 53.Sh DESCRIPTION 54.Nm Ifconfig 55is used to assign an address 56to a network interface and/or configure 57network interface parameters. 58.Nm Ifconfig 59must be used at boot time to define the network address 60of each interface present on a machine; it may also be used at 61a later time to redefine an interface's address 62or other operating parameters. 63.Pp 64Available operands for 65.Nm ifconfig: 66.Bl -tag -width Ds 67.It Ar Address 68For the 69.Tn DARPA-Internet 70family, 71the address is either a host name present in the host name data 72base, 73.Xr hosts 5 , 74or a 75.Tn DARPA 76Internet address expressed in the Internet standard 77.Dq dot notation . 78For the Xerox Network Systems(tm) family, 79addresses are 80.Ar net:a.b.c.d.e.f , 81where 82.Ar net 83is the assigned network number (in decimal), 84and each of the six bytes of the host number, 85.Ar a 86through 87.Ar f , 88are specified in hexadecimal. 89The host number may be omitted on 10Mb/s Ethernet interfaces, 90which use the hardware physical address, 91and on interfaces other than the first. 92For the 93.Tn ISO 94family, addresses are specified as a long hexadecimal string, 95as in the Xerox family. However, two consecutive dots imply a zero 96byte, and the dots are optional, if the user wishes to (carefully) 97count out long strings of digits in network byte order. 98.It Ar address_family 99Specifies the 100.Ar address family 101which affects interpretation of the remaining parameters. 102Since an interface can receive transmissions in differing protocols 103with different naming schemes, specifying the address family is recommeded. 104The address or protocol families currently 105supported are 106.Dq inet , 107.Dq iso , 108and 109.Dq ns . 110.It Ar Interface 111The 112.Ar interface 113parameter is a string of the form 114.Dq name unit , 115for example, 116.Dq en0 117.El 118.Pp 119The following parameters may be set with 120.Nm ifconfig : 121.Bl -tag -width dest_addressxx 122.It Cm alias 123Establish an additional network address for this interface. 124This is sometimes useful when changing network numbers, and 125one wishes to accept packets addressed to the old interface. 126.It Cm arp 127Enable the use of the Address Resolution Protocol in mapping 128between network level addresses and link level addresses (default). 129This is currently implemented for mapping between 130.Tn DARPA 131Internet 132addresses and 10Mb/s Ethernet addresses. 133.It Fl arp 134Disable the use of the Address Resolution Protocol. 135.It Cm broadcast 136(Inet only) 137Specify the address to use to represent broadcasts to the 138network. 139The default broadcast address is the address with a host part of all 1's. 140.It Cm debug 141Enable driver dependent debugging code; usually, this turns on 142extra console error logging. 143.It Fl debug 144Disable driver dependent debugging code. 145.It Cm delete 146Remove the network address specified. 147This would be used if you incorrectly specified an alias, or it 148was no longer needed. 149If you have incorrectly set an NS address having the side effect 150of specifying the host portion, removing all NS addresses will 151allow you to respecify the host portion. 152.It Cm dest_address 153Specify the address of the correspondent on the other end 154of a point to point link. 155.It Cm down 156Mark an interface ``down''. When an interface is 157marked ``down'', the system will not attempt to 158transmit messages through that interface. 159If possible, the interface will be reset to disable reception as well. 160This action does not automatically disable routes using the interface. 161.It Cm ipdst 162This is used to specify an Internet host who is willing to receive 163ip packets encapsulating NS packets bound for a remote network. 164An apparent point to point link is constructed, and 165the address specified will be taken as the NS address and network 166of the destination. 167IP encapsulation of 168.Tn CLNP 169packets is done differently. 170.It Cm metric Ar n 171Set the routing metric of the interface to 172.Ar n , 173default 0. 174The routing metric is used by the routing protocol 175.Pq Xr routed 8 . 176Higher metrics have the effect of making a route 177less favorable; metrics are counted as addition hops 178to the destination network or host. 179.It Cm mtu Ar n 180Set the maximum transmission unit of the interface to 181.Ar n , 182default is interface specific. 183The mtu is used to limit the size of packets that are transmitted on an 184interface. 185Not all interfaces support setting the mtu, and some interfaces have 186range restrictions. 187.It Cm netmask Ar mask 188(Inet and ISO) 189Specify how much of the address to reserve for subdividing 190networks into sub-networks. 191The mask includes the network part of the local address 192and the subnet part, which is taken from the host field of the address. 193The mask can be specified as a single hexadecimal number 194with a leading 0x, with a dot-notation Internet address, 195or with a pseudo-network name listed in the network table 196.Xr networks 5 . 197The mask contains 1's for the bit positions in the 32-bit address 198which are to be used for the network and subnet parts, 199and 0's for the host part. 200The mask should contain at least the standard network portion, 201and the subnet field should be contiguous with the network 202portion. 203.\" see 204.\" Xr eon 5 . 205.It Cm nsellength Ar n 206.Pf ( Tn ISO 207only) 208This specifies a trailing number of bytes for a received 209.Tn NSAP 210used for local identification, the remaining leading part of which is 211taken to be the 212.Tn NET 213(Network Entity Title). 214The default value is 1, which is conformant to US 215.Tn GOSIP . 216When an ISO address is set in an ifconfig command, 217it is really the 218.Tn NSAP 219which is being specified. 220For example, in 221.Tn US GOSIP , 22220 hex digits should be 223specified in the 224.Tn ISO NSAP 225to be assigned to the interface. 226There is some evidence that a number different from 1 may be useful 227for 228.Tn AFI 22937 type addresses. 230.It Cm trailers 231Request the use of a ``trailer'' link level encapsulation when 232sending (default). 233If a network interface supports 234.Cm trailers , 235the system will, when possible, encapsulate outgoing 236messages in a manner which minimizes the number of 237memory to memory copy operations performed by the receiver. 238On networks that support the Address Resolution Protocol (see 239.Xr arp 4 ; 240currently, only 10 Mb/s Ethernet), 241this flag indicates that the system should request that other 242systems use trailers when sending to this host. 243Similarly, trailer encapsulations will be sent to other 244hosts that have made such requests. 245Currently used by Internet protocols only. 246.It Fl trailers 247Disable the use of a ``trailer'' link level encapsulation. 248.It Cm link[0-2] 249Enable special processing of the link level of the interface. 250These three options are interface specific in actual effect, however, 251they are in general used to select special modes of operation. An example 252of this is to enable SLIP compression. Currently, only used by SLIP. 253.It Fl link[0-2] 254Disable special processing at the link level with the specified interface. 255.It Cm up 256Mark an interface ``up''. 257This may be used to enable an interface after an ``ifconfig down.'' 258It happens automatically when setting the first address on an interface. 259If the interface was reset when previously marked down, 260the hardware will be re-initialized. 261.El 262.Pp 263.Pp 264.Nm Ifconfig 265.Ar -a 266displays information on all interfaces. When followed by a configuration 267parameter, will also set the configuration on all interfaces. 268.Pp 269.Nm Ifconfig 270displays the current configuration for a network interface 271when no optional parameters are supplied. 272If a protocol family is specified, 273Ifconfig will report only the details specific to that protocol family. 274.Pp 275Only the super-user may modify the configuration of a network interface. 276.Sh DIAGNOSTICS 277Messages indicating the specified interface does not exit, the 278requested address is unknown, or the user is not privileged and 279tried to alter an interface's configuration. 280.Sh SEE ALSO 281.Xr netstat 1 , 282.Xr netintro 4 , 283.Xr rc 8 , 284.Xr routed 8 , 285.\" .Xr eon 5 286.Sh HISTORY 287The 288.Nm 289command appeared in 290.Bx 4.2 . 291