xref: /freebsd/sbin/ifconfig/ifconfig.8 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
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.18 1998/07/06 06:53:42 charnier 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 vlan Ar vlan_tag
204If the interface is a vlan pseudo interface, set the vlan tag value
205to
206.Ar vlan_tag .
207This value is a 16-bit number which is used to create an 802.1Q
208vlan header for packets sent from the vlan interface. Note that
209.Cm vlan
210and
211.Cm vlandev
212must both be set at the same time.
213.It Cm vlandev Ar iface
214If the interface is a vlan pseudo device, associate physical interface
215.Ar iface
216with it. Packets transmitted through the vlan interface will be
217diverted to the specified physical interface
218.Ar iface
219with 802.1Q vlan encapsulation. Packets with 802.1Q encapsulation received
220by the parent interface with the correct vlan tag will be diverted to
221the associated vlan pseudo-interface. The vlan interface is assigned a
222copy of the parent interface's flags and the parent's ethernet address.
223The
224.Cm vlandev
225and
226.Cm vlan
227must both be set at the same time. If the vlan interface already has
228a physical interface associated with it, this command will fail. To
229change the association to another physical interface, the existing
230association must be cleared first.
231.Pp
232Note: if the
233.Ar link0
234flag is set on the vlan interface, the vlan pseudo
235interface's behavior changes: the
236.Ar link0
237tells the vlan interface that the
238parent interface supports insertion and extraction of vlan tags on its
239own (usually in firmware) and that it should pass packets to and from
240the parent unaltered.
241.It Fl vlandev Ar iface
242If the driver is a vlan pseudo device, disassociate the physical interface
243.Ar iface
244from it. This breaks the link between the vlan interface and its parent,
245clears its vlan tag, flags and its link address and shuts the interface down.
246.It Cm metric Ar n
247Set the routing metric of the interface to
248.Ar n ,
249default 0.
250The routing metric is used by the routing protocol
251.Pq Xr routed 8 .
252Higher metrics have the effect of making a route
253less favorable; metrics are counted as addition hops
254to the destination network or host.
255.It Cm mtu Ar n
256Set the maximum transmission unit of the interface to
257.Ar n ,
258default is interface specific.
259The mtu is used to limit the size of packets that are transmitted on an
260interface.
261Not all interfaces support setting the mtu, and some interfaces have
262range restrictions.
263.It Cm netmask Ar mask
264.\" (Inet and ISO)
265(Inet only)
266Specify how much of the address to reserve for subdividing
267networks into sub-networks.
268The mask includes the network part of the local address
269and the subnet part, which is taken from the host field of the address.
270The mask can be specified as a single hexadecimal number
271with a leading 0x, with a dot-notation Internet address,
272or with a pseudo-network name listed in the network table
273.Xr networks 5 .
274The mask contains 1's for the bit positions in the 32-bit address
275which are to be used for the network and subnet parts,
276and 0's for the host part.
277The mask should contain at least the standard network portion,
278and the subnet field should be contiguous with the network
279portion.
280.\" see
281.\" Xr eon 5 .
282.\" .It Cm nsellength Ar n
283.\" .Pf ( Tn ISO
284.\" only)
285.\" This specifies a trailing number of bytes for a received
286.\" .Tn NSAP
287.\" used for local identification, the remaining leading part of which is
288.\" taken to be the
289.\" .Tn NET
290.\" (Network Entity Title).
291.\" The default value is 1, which is conformant to US
292.\" .Tn GOSIP .
293.\" When an ISO address is set in an ifconfig command,
294.\" it is really the
295.\" .Tn NSAP
296.\" which is being specified.
297.\" For example, in
298.\" .Tn US GOSIP ,
299.\" 20 hex digits should be
300.\" specified in the
301.\" .Tn ISO NSAP
302.\" to be assigned to the interface.
303.\" There is some evidence that a number different from 1 may be useful
304.\" for
305.\" .Tn AFI
306.\" 37 type addresses.
307.It Cm range
308Under appletalk, set the interface to respond to a
309.Em netrange.
310of the form startnet-endnet. Appletalk uses this scheme instead of
311netmasks though
312.Bx Free
313implements it internally as a set of netmasks.
314.It Cm phase
315The argument following this specifies the version (phase) of the
316Appletalk network attached to the interface. Values of 1 or 2 are permitted.
317.It Cm link[0-2]
318Enable special processing of the link level of the interface.
319These three options are interface specific in actual effect, however,
320they are in general used to select special modes of operation. An example
321of this is to enable SLIP compression, or to select the connector type
322for some Ethernet cards.  Refer to the man page for the specific driver
323for more information.
324.It Fl link[0-2]
325Disable special processing at the link level with the specified interface.
326.It Cm up
327Mark an interface
328.Dq up .
329This may be used to enable an interface after an
330.Dq ifconfig down .
331It happens automatically when setting the first address on an interface.
332If the interface was reset when previously marked down,
333the hardware will be re-initialized.
334.El
335.Pp
336.Nm Ifconfig
337displays the current configuration for a network interface
338when no optional parameters are supplied.
339If a protocol family is specified,
340.Nm
341will report only the details specific to that protocol family.
342.Pp
343If the driver does supports the media selection system, the supported
344media list will be included in the output.
345.Pp
346Optionally, the
347.Fl a
348flag may be used instead of an interface name.  This flag instructs
349.Nm
350to display information about all interfaces in the system.
351The
352.Fl d
353flag limits this to interfaces that are down, and
354.Fl u
355limits this to interfaces that are up.
356.Pp
357The
358.Fl l
359flag may be used to list all available interfaces on the system, with
360no other additional information.  Use of this flag is mutually exclusive
361with all other flags and commands, except for
362.Fl d
363(only list interfaces that are down)
364and
365.Fl u
366(only list interfaces that are up).
367.Pp
368Only the super-user may modify the configuration of a network interface.
369.Sh NOTES
370The media selection system is relatively new and only some drivers support
371it (or have need for it).
372.Sh DIAGNOSTICS
373Messages indicating the specified interface does not exist, the
374requested address is unknown, or the user is not privileged and
375tried to alter an interface's configuration.
376.Sh SEE ALSO
377.Xr netstat 1 ,
378.Xr netintro 4 ,
379.Xr rc 8 ,
380.Xr routed 8
381.\" .Xr eon 5
382.Sh HISTORY
383The
384.Nm
385command appeared in
386.Bx 4.2 .
387