xref: /freebsd/sbin/ifconfig/ifconfig.8 (revision ce834215a70ff69e7e222827437116eee2f9ac6f)
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: ifconfig.8,v 1.12 1997/02/22 14:32:32 peter 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.Op Fl m
51.Ar interface
52.Op Ar protocol_family
53.Nm ifconfig
54.Fl a
55.Op Fl m
56.Op Fl d
57.Op Fl u
58.Op Ar protocol_family
59.Nm ifconfig
60.Fl l
61.Op Fl d
62.Op Fl u
63.Sh DESCRIPTION
64.Nm
65is used to assign an address
66to a network interface and/or configure
67network interface parameters.
68.Nm
69must be used at boot time to define the network address
70of each interface present on a machine; it may also be used at
71a later time to redefine an interface's address
72or other operating parameters.
73.Pp
74Available operands for
75.Nm ifconfig :
76.Bl -tag -width Ds
77.It Ar Address
78For the
79.Tn DARPA-Internet
80family,
81the address is either a host name present in the host name data
82base,
83.Xr hosts 5 ,
84or a
85.Tn DARPA
86Internet address expressed in the Internet standard
87.Dq dot notation .
88.\" For the Xerox Network Systems(tm) family,
89.\" addresses are
90.\" .Ar net:a.b.c.d.e.f ,
91.\" where
92.\" .Ar net
93.\" is the assigned network number (in decimal),
94.\" and each of the six bytes of the host number,
95.\" .Ar a
96.\" through
97.\" .Ar f ,
98.\" are specified in hexadecimal.
99.\" The host number may be omitted on 10Mb/s Ethernet interfaces,
100.\" which use the hardware physical address,
101.\" and on interfaces other than the first.
102.\" For the
103.\" .Tn ISO
104.\" family, addresses are specified as a long hexadecimal string,
105.\" as in the Xerox family.  However, two consecutive dots imply a zero
106.\" byte, and the dots are optional, if the user wishes to (carefully)
107.\" count out long strings of digits in network byte order.
108.It Ar address_family
109Specifies the
110.Ar address family
111which affects interpretation of the remaining parameters.
112Since an interface can receive transmissions in differing protocols
113with different naming schemes, specifying the address family is recommended.
114The address or protocol families currently
115supported are
116.Dq inet ,
117.Dq atalk ,
118.\" .Dq iso ,
119and
120.Dq ipx .
121.\" and
122.\" .Dq ns .
123.It Ar Interface
124The
125.Ar interface
126parameter is a string of the form
127.Dq name unit ,
128for example,
129.Dq en0
130.El
131.Pp
132The following parameters may be set with
133.Nm ifconfig :
134.Bl -tag -width dest_addressxx
135.It Cm alias
136Establish an additional network address for this interface.
137This is sometimes useful when changing network numbers, and
138one wishes to accept packets addressed to the old interface.
139.It Cm arp
140Enable the use of the Address Resolution Protocol in mapping
141between network level addresses and link level addresses (default).
142This is currently implemented for mapping between
143.Tn DARPA
144Internet
145addresses and 10Mb/s Ethernet addresses.
146.It Fl arp
147Disable the use of the Address Resolution Protocol.
148.It Cm broadcast
149(Inet only)
150Specify the address to use to represent broadcasts to the
151network.
152The default broadcast address is the address with a host part of all 1's.
153.It Cm debug
154Enable driver dependent debugging code; usually, this turns on
155extra console error logging.
156.It Fl debug
157Disable driver dependent debugging code.
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
175.\" This is used to specify an Internet host who is willing to receive
176.\" ip packets encapsulating NS packets bound for a remote network.
177.\" An apparent point to point link is constructed, and
178.\" the address specified will be taken as the NS address and network
179.\" of the destination.
180.\" IP encapsulation of
181.\" .Tn CLNP
182.\" packets 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 ,
217default is interface specific.
218The mtu is used to limit the size of packets that are transmitted on an
219interface.
220Not all interfaces support setting the mtu, and some interfaces have
221range restrictions.
222.It Cm netmask Ar mask
223.\" (Inet and ISO)
224(Inet only)
225Specify how much of the address to reserve for subdividing
226networks into sub-networks.
227The mask includes the network part of the local address
228and the subnet part, which is taken from the host field of the address.
229The mask can be specified as a single hexadecimal number
230with a leading 0x, with a dot-notation Internet address,
231or with a pseudo-network name listed in the network table
232.Xr networks 5 .
233The mask contains 1's for the bit positions in the 32-bit address
234which are to be used for the network and subnet parts,
235and 0's for the host part.
236The mask should contain at least the standard network portion,
237and the subnet field should be contiguous with the network
238portion.
239.\" see
240.\" Xr eon 5 .
241.\" .It Cm nsellength Ar n
242.\" .Pf ( Tn ISO
243.\" only)
244.\" This specifies a trailing number of bytes for a received
245.\" .Tn NSAP
246.\" used for local identification, the remaining leading part of which is
247.\" taken to be the
248.\" .Tn NET
249.\" (Network Entity Title).
250.\" The default value is 1, which is conformant to US
251.\" .Tn GOSIP .
252.\" When an ISO address is set in an ifconfig command,
253.\" it is really the
254.\" .Tn NSAP
255.\" which is being specified.
256.\" For example, in
257.\" .Tn US GOSIP ,
258.\" 20 hex digits should be
259.\" specified in the
260.\" .Tn ISO NSAP
261.\" to be assigned to the interface.
262.\" There is some evidence that a number different from 1 may be useful
263.\" for
264.\" .Tn AFI
265.\" 37 type addresses.
266.It Cm range
267Under appletalk, set the interface to respond to a
268.Em netrange.
269of the form startnet-endnet. Appletalk uses this scheme instead of
270netmasks though FreeBSD impliments 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 ``up''.
285This may be used to enable an interface after an ``ifconfig down.''
286It happens automatically when setting the first address on an interface.
287If the interface was reset when previously marked down,
288the hardware will be re-initialized.
289.El
290.Pp
291.Nm
292displays the current configuration for a network interface
293when no optional parameters are supplied.
294If a protocol family is specified,
295Ifconfig will report only the details specific to that protocol family.
296.Pp
297If the
298.Fl m
299flag is passed before an interface name,
300.Nm
301will display all of the supported media for the specified interface.
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.
308.Fl d
309limits this to interfaces that are down, and
310.Fl u
311limits this to interfaces that are up.
312.Pp
313The
314.Fl l
315flag may be used to list all available interfaces on the system, with
316no other additional information.  Use of this flag is mutually exclusive
317with all other flags and commands, except for
318.Fl d
319(only list interfaces that are down)
320and
321.Fl u
322(only list interfaces that are up).
323.Pp
324Only the super-user may modify the configuration of a network interface.
325.Sh DIAGNOSTICS
326Messages indicating the specified interface does not exit, the
327requested address is unknown, or the user is not privileged and
328tried to alter an interface's configuration.
329.Sh SEE ALSO
330.Xr netstat 1 ,
331.Xr netintro 4 ,
332.Xr rc 8 ,
333.Xr routed 8
334.\" .Xr eon 5
335.Sh HISTORY
336The
337.Nm
338command appeared in
339.Bx 4.2 .
340