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