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