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