xref: /freebsd/sbin/ifconfig/ifconfig.8 (revision a8445737e740901f5f2c8d24c12ef7fc8b00134e)
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 acknowledgment:
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.17 1998/06/08 02:00:45 danny 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.Fl a
51.Op Fl d
52.Op Fl u
53.Op Ar address_family
54.Nm ifconfig
55.Fl l
56.Op Fl d
57.Op Fl u
58.Op Ar address_family
59.Sh DESCRIPTION
60.Nm Ifconfig
61is used to assign an address
62to a network interface and/or configure
63network interface parameters.
64.Nm Ifconfig
65must be used at boot time to define the network address
66of each interface present on a machine; it may also be used at
67a later time to redefine an interface's address
68or other operating parameters.
69.Pp
70The following options are available:
71.Bl -tag -width indent
72.It Ar address
73For the
74.Tn DARPA Ns -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
104Specify 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 dest_address
119Specify the address of the correspondent on the other end
120of a point to point link.
121.It Ar interface
122This
123parameter is a string of the form
124.Dq name unit ,
125for example,
126.Dq en0 .
127.El
128.Pp
129The following parameters may be set with
130.Nm ifconfig :
131.Bl -tag -width indent
132.It Cm alias
133Establish an additional network address for this interface.
134This is sometimes useful when changing network numbers, and
135one wishes to accept packets addressed to the old interface.
136.It Cm arp
137Enable the use of the Address Resolution Protocol in mapping
138between network level addresses and link level addresses (default).
139This is currently implemented for mapping between
140.Tn DARPA
141Internet
142addresses and 10Mb/s Ethernet addresses.
143.It Fl arp
144Disable the use of the Address Resolution Protocol.
145.It Cm broadcast
146(Inet only)
147Specify the address to use to represent broadcasts to the
148network.
149The default broadcast address is the address with a host part of all 1's.
150.It Cm debug
151Enable driver dependent debugging code; usually, this turns on
152extra console error logging.
153.It Fl debug
154Disable driver dependent debugging code.
155.It Cm delete
156Remove the network address specified.
157This would be used if you incorrectly specified an alias, or it
158was no longer needed.
159If you have incorrectly set an NS address having the side effect
160of specifying the host portion, removing all NS addresses will
161allow you to respecify the host portion.
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 media Ar type
178If the driver supports the media selection system, set the media type
179of the interface to
180.Ar type .
181Some interfaces support the mutually exclusive use of one of several
182different physical media connectors.  For example, a 10Mb/s Ethernet
183interface might support the use of either
184.Tn AUI
185or twisted pair connectors.  Setting the media type to
186.Dq 10base5/AUI
187would change the currently active connector to the AUI port.
188Setting it to
189.Dq 10baseT/UTP
190would activate twisted pair.  Refer to the interfaces' driver
191specific documentation or man page for a complete list of the
192available types.
193.It Cm mediaopt Ar opts
194If the driver supports the media selection system, set the specified
195media options on the interface.
196.Ar Opts
197is a comma delimited list of options to apply to the interface.
198Refer to the interfaces' driver specific man page for a complete
199list of available options.
200.It Fl mediaopt Ar opts
201If the driver supports the media selection system, disable the
202specified media options on the interface.
203.It Cm metric Ar n
204Set the routing metric of the interface to
205.Ar n ,
206default 0.
207The routing metric is used by the routing protocol
208.Pq Xr routed 8 .
209Higher metrics have the effect of making a route
210less favorable; metrics are counted as addition hops
211to the destination network or host.
212.It Cm mtu Ar n
213Set the maximum transmission unit of the interface to
214.Ar n ,
215default is interface specific.
216The mtu is used to limit the size of packets that are transmitted on an
217interface.
218Not all interfaces support setting the mtu, and some interfaces have
219range restrictions.
220.It Cm netmask Ar mask
221.\" (Inet and ISO)
222(Inet only)
223Specify how much of the address to reserve for subdividing
224networks into sub-networks.
225The mask includes the network part of the local address
226and the subnet part, which is taken from the host field of the address.
227The mask can be specified as a single hexadecimal number
228with a leading 0x, with a dot-notation Internet address,
229or with a pseudo-network name listed in the network table
230.Xr networks 5 .
231The mask contains 1's for the bit positions in the 32-bit address
232which are to be used for the network and subnet parts,
233and 0's for the host part.
234The mask should contain at least the standard network portion,
235and the subnet field should be contiguous with the network
236portion.
237.\" see
238.\" Xr eon 5 .
239.\" .It Cm nsellength Ar n
240.\" .Pf ( Tn ISO
241.\" only)
242.\" This specifies a trailing number of bytes for a received
243.\" .Tn NSAP
244.\" used for local identification, the remaining leading part of which is
245.\" taken to be the
246.\" .Tn NET
247.\" (Network Entity Title).
248.\" The default value is 1, which is conformant to US
249.\" .Tn GOSIP .
250.\" When an ISO address is set in an ifconfig command,
251.\" it is really the
252.\" .Tn NSAP
253.\" which is being specified.
254.\" For example, in
255.\" .Tn US GOSIP ,
256.\" 20 hex digits should be
257.\" specified in the
258.\" .Tn ISO NSAP
259.\" to be assigned to the interface.
260.\" There is some evidence that a number different from 1 may be useful
261.\" for
262.\" .Tn AFI
263.\" 37 type addresses.
264.It Cm range
265Under appletalk, set the interface to respond to a
266.Em netrange.
267of the form startnet-endnet. Appletalk uses this scheme instead of
268netmasks though
269.Bx Free
270implements it internally as a set of netmasks.
271.It Cm phase
272The argument following this specifies the version (phase) of the
273Appletalk network attached to the interface. Values of 1 or 2 are permitted.
274.It Cm link[0-2]
275Enable special processing of the link level of the interface.
276These three options are interface specific in actual effect, however,
277they are in general used to select special modes of operation. An example
278of this is to enable SLIP compression, or to select the connector type
279for some Ethernet cards.  Refer to the man page for the specific driver
280for more information.
281.It Fl link[0-2]
282Disable special processing at the link level with the specified interface.
283.It Cm up
284Mark an interface
285.Dq up .
286This may be used to enable an interface after an
287.Dq ifconfig down .
288It happens automatically when setting the first address on an interface.
289If the interface was reset when previously marked down,
290the hardware will be re-initialized.
291.El
292.Pp
293.Nm Ifconfig
294displays the current configuration for a network interface
295when no optional parameters are supplied.
296If a protocol family is specified,
297.Nm
298will report only the details specific to that protocol family.
299.Pp
300If the driver does supports the media selection system, the supported
301media list will be included in the output.
302.Pp
303Optionally, the
304.Fl a
305flag may be used instead of an interface name.  This flag instructs
306.Nm
307to display information about all interfaces in the system.
308The
309.Fl d
310flag limits this to interfaces that are down, and
311.Fl u
312limits this to interfaces that are up.
313.Pp
314The
315.Fl l
316flag may be used to list all available interfaces on the system, with
317no other additional information.  Use of this flag is mutually exclusive
318with all other flags and commands, except for
319.Fl d
320(only list interfaces that are down)
321and
322.Fl u
323(only list interfaces that are up).
324.Pp
325Only the super-user may modify the configuration of a network interface.
326.Sh NOTES
327The media selection system is relatively new and only some drivers support
328it (or have need for it).
329.Sh DIAGNOSTICS
330Messages indicating the specified interface does not exist, the
331requested address is unknown, or the user is not privileged and
332tried to alter an interface's configuration.
333.Sh SEE ALSO
334.Xr netstat 1 ,
335.Xr netintro 4 ,
336.Xr rc 8 ,
337.Xr routed 8
338.\" .Xr eon 5
339.Sh HISTORY
340The
341.Nm
342command appeared in
343.Bx 4.2 .
344