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