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