xref: /netbsd-src/sbin/ifconfig/ifconfig.8 (revision 4d7e773266e3c3f48566c86c0ad52d51c6454fd1)
1.\"	$NetBSD: ifconfig.8,v 1.21 1997/10/11 02:44:36 enami Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)ifconfig.8	8.4 (Berkeley) 6/1/94
35.\"
36.Dd April 16, 1997
37.Dt IFCONFIG 8
38.Os BSD 4.2
39.Sh NAME
40.Nm ifconfig
41.Nd configure network interface parameters
42.Sh SYNOPSIS
43.Nm
44.Ar interface address_family
45.Oo
46.Ar address
47.Op Ar dest_address
48.Oc
49.Op Ar parameters
50.Nm ""
51.Op Fl m
52.Ar interface
53.Op Ar protocol_family
54.Nm ""
55.Fl a
56.Op Fl m
57.Op Fl d
58.Op Fl u
59.Op Ar protocol_family
60.Nm ""
61.Fl l
62.Op Fl d
63.Op Fl u
64.Sh DESCRIPTION
65.Nm
66is used to assign an address
67to a network interface and/or configure
68network interface parameters.
69.Nm
70must be used at boot time to define the network address
71of each interface present on a machine; it may also be used at
72a later time to redefine an interface's address
73or other operating parameters.
74.Pp
75Available operands for
76.Nm "" :
77.Bl -tag -width Ds
78.It Ar Address
79For the
80.Tn DARPA-Internet
81family,
82the address is either a host name present in the host name data
83base,
84.Xr hosts 5 ,
85or a
86.Tn DARPA
87Internet address expressed in the Internet standard
88.Dq dot notation .
89For the Xerox Network Systems(tm) family,
90addresses are
91.Ar net:a.b.c.d.e.f ,
92where
93.Ar net
94is the assigned network number (in decimal),
95and each of the six bytes of the host number,
96.Ar a
97through
98.Ar f ,
99are specified in hexadecimal.
100The host number may be omitted on 10Mb/s Ethernet interfaces,
101which use the hardware physical address,
102and on interfaces other than the first.
103For the
104.Tn ISO
105family, addresses are specified as a long hexadecimal string,
106as in the Xerox family.  However, two consecutive dots imply a zero
107byte, and the dots are optional, if the user wishes to (carefully)
108count out long strings of digits in network byte order.
109.It Ar address_family
110Specifies the
111.Ar address family
112which affects interpretation of the remaining parameters.
113Since an interface can receive transmissions in differing protocols
114with different naming schemes, specifying the address family is recommended.
115The address or protocol families currently
116supported are
117.Dq inet ,
118.Dq atalk ,
119.Dq iso ,
120and
121.Dq ns .
122.It Ar Interface
123The
124.Ar interface
125parameter is a string of the form
126.Dq name unit ,
127for example,
128.Dq en0
129.El
130.Pp
131The following parameters may be set with
132.Nm "" :
133.Bl -tag -width dest_addressxx
134.It Cm alias
135Establish an additional network address for this interface.
136This is sometimes useful when changing network numbers, and
137one wishes to accept packets addressed to the old interface.
138.It Cm arp
139Enable the use of the Address Resolution Protocol in mapping
140between network level addresses and link level addresses (default).
141This is currently implemented for mapping between
142.Tn DARPA
143Internet
144addresses and 10Mb/s Ethernet addresses.
145.It Fl arp
146Disable the use of the Address Resolution Protocol.
147.It Cm broadcast Ar mask
148(Inet only)
149Specify the address to use to represent broadcasts to the
150network.
151The default broadcast address is the address with a host part of all 1's.
152.It Cm debug
153Enable driver dependent debugging code; usually, this turns on
154extra console error logging.
155.It Fl debug
156Disable driver dependent debugging code.
157.ne 1i
158.It Cm delete
159Remove the network address specified.
160This would be used if you incorrectly specified an alias, or it
161was no longer needed.
162If you have incorrectly set an NS address having the side effect
163of specifying the host portion, removing all NS addresses will
164allow you to respecify the host portion.
165.It Cm dest_address
166Specify the address of the correspondent on the other end
167of a point to point link.
168.It Cm down
169Mark an interface ``down''.  When an interface is
170marked ``down'', the system will not attempt to
171transmit messages through that interface.
172If possible, the interface will be reset to disable reception as well.
173This action does not automatically disable routes using the interface.
174.It Cm ipdst
175This is used to specify an Internet host who is willing to receive
176ip packets encapsulating NS packets bound for a remote network.
177An apparent point to point link is constructed, and
178the address specified will be taken as the NS address and network
179of the destination.
180IP encapsulation of
181.Tn CLNP
182packets is done differently.
183.It Cm media Ar type
184Set the media type of the interface to
185.Ar type .
186Some interfaces support the mutually exclusive use of one of several
187different physical media connectors.  For example, a 10Mb/s Ethernet
188interface might support the use of either
189.Tn AUI
190or twisted pair connectors.  Setting the media type to
191.Dq 10base5/AUI
192would change the currently active connector to the AUI port.
193Setting it to
194.Dq 10baseT/UTP
195would activate twisted pair.  Refer to the interfaces' driver
196specific man page for a complete list of the available types.
197.It Cm mediaopt Ar opts
198Set the specified media options on the interface.
199.Ar opts
200is a comma delimited list of options to apply to the interface.
201Refer to the interfaces' driver specific man page for a complete
202list of available options.
203.It Fl mediaopt Ar opts
204Disable the specified media options on the interface.
205.It Cm metric Ar n
206Set the routing metric of the interface to
207.Ar n ,
208default 0.
209The routing metric is used by the routing protocol
210.Pq Xr routed 8 .
211Higher metrics have the effect of making a route
212less favorable; metrics are counted as addition hops
213to the destination network or host.
214.It Cm mtu Ar n
215Set the maximum transmission unit of the interface to
216.Ar n .
217Most interfaces don't support this option.
218.It Cm netmask Ar mask
219(Inet and ISO)
220Specify how much of the address to reserve for subdividing
221networks into sub-networks.
222The mask includes the network part of the local address
223and the subnet part, which is taken from the host field of the address.
224The mask can be specified as a single hexadecimal number
225with a leading 0x, with a dot-notation Internet address,
226or with a pseudo-network name listed in the network table
227.Xr networks 5 .
228The mask contains 1's for the bit positions in the 32-bit address
229which are to be used for the network and subnet parts,
230and 0's for the host part.
231The mask should contain at least the standard network portion,
232and the subnet field should be contiguous with the network
233portion.
234.\" see
235.\" Xr eon 5 .
236.It Cm nsellength Ar n
237.Pf ( Tn ISO
238only)
239This specifies a trailing number of bytes for a received
240.Tn NSAP
241used for local identification, the remaining leading part of which is
242taken to be the
243.Tn NET
244(Network Entity Title).
245The default value is 1, which is conformant to US
246.Tn GOSIP .
247When an ISO address is set in an ifconfig command,
248it is really the
249.Tn NSAP
250which is being specified.
251For example, in
252.Tn US GOSIP ,
25320 hex digits should be
254specified in the
255.Tn ISO NSAP
256to be assigned to the interface.
257There is some evidence that a number different from 1 may be useful
258for
259.Tn AFI
26037 type addresses.
261.It Cm trailers
262Request the use of a ``trailer'' link level encapsulation when
263sending (default).
264If a network interface supports
265.Cm trailers ,
266the system will, when possible, encapsulate outgoing
267messages in a manner which minimizes the number of
268memory to memory copy operations performed by the receiver.
269On networks that support the Address Resolution Protocol (see
270.Xr arp 4 ;
271currently, only 10 Mb/s Ethernet),
272this flag indicates that the system should request that other
273systems use trailers when sending to this host.
274Similarly, trailer encapsulations will be sent to other
275hosts that have made such requests.
276Currently used by Internet protocols only.
277.It Fl trailers
278Disable the use of a ``trailer'' link level encapsulation.
279.It Cm link[0-2]
280Enable special processing of the link level of the interface.
281These three options are interface specific in actual effect, however,
282they are in general used to select special modes of operation. An example
283of this is to enable SLIP compression, or to select the connector type
284for some ethernet cards.  Refer to the man page for the specific driver
285for more information.
286.ne 1i
287.It Fl link[0-2]
288Disable special processing at the link level with the specified interface.
289.It Cm up
290Mark an interface ``up''.
291This may be used to enable an interface after an ``ifconfig down.''
292It happens automatically when setting the first address on an interface.
293If the interface was reset when previously marked down,
294the hardware will be re-initialized.
295.El
296.Pp
297.Nm
298displays the current configuration for a network interface
299when no optional parameters are supplied.
300If a protocol family is specified,
301Ifconfig will report only the details specific to that protocol family.
302.Pp
303If the
304.Fl m
305flag is passed before an interface name,
306.Nm
307will display all of the supported media for the specified interface.
308.Pp
309Optionally, the
310.Fl a
311flag may be used instead of an interface name.  This flag instructs
312.Nm
313to display information about all interfaces in the system.
314.Fl d
315limits this to interfaces that are down, and
316.Fl u
317limits this to interfaces that are up.
318.Pp
319The
320.Fl l
321flag may be used to list all available interfaces on the system, with
322no other additional information.  Use of this flag is mutually exclusive
323with all other flags and commands, except for
324.Fl d
325(only list interfaces that are down)
326and
327.Fl u
328(only list interfaces that are up).
329.Pp
330Only the super-user may modify the configuration of a network interface.
331.Sh DIAGNOSTICS
332Messages indicating the specified interface does not exit, the
333requested address is unknown, or the user is not privileged and
334tried to alter an interface's configuration.
335.Sh SEE ALSO
336.Xr netstat 1 ,
337.Xr netintro 4 ,
338.Xr rc 8 ,
339.Xr routed 8 ,
340.\" .Xr eon 5
341.Sh HISTORY
342The
343.Nm
344command appeared in
345.Bx 4.2 .
346