Debian Codegraph @

upstream/opensuse-tumbleweed/man8/ifconfig.8

raw
1 .TH IFCONFIG 8 "2025-09-10" "net\-tools" "Linux System Administrator's Manual"
2
3 .SH NAME
4 ifconfig \- configure a network interface
5
6 .SH SYNOPSIS
7 .SY ifconfig
8 .RB [ \-v "] [" \-a "] [" \-s ]
9 .RI [ interface ]
10 .P
11 .SY ifconfig
12 .RB [ \-v ]
13 .IR interface " [" aftype "] " options " | " address " ..."
14
15 .SH DESCRIPTION
16 .B Ifconfig
17 is used to configure the kernel-resident network interfaces. It is
18 used at boot time to set up interfaces as necessary. After that, it
19 is usually only needed when debugging or when system tuning is needed.
20
21 .P
22 If no arguments are given,
23 .B ifconfig
24 displays the status of the currently active interfaces. If
25 a single
26 .I interface
27 argument is given, it displays the status of the given interface
28 only; if a single
29 .B \-a
30 argument is given, it displays the status of all interfaces, even
31 those that are down. Otherwise, it configures an interface.
32
33 .SS Address Families
34 If the first argument \fIaftype\fP after the \fIinterface\fP name
35 is recognized as the name of a supported address family,
36 that address family is used for decoding and displaying all protocol
37 addresses.
38 .br
39 Currently supported address families include
40 .B inet
41 (TCP/IP, default),
42 .B inet6
43 (IPv6),
44 .B ax25
45 (AMPR Packet Radio),
46 .B ddp
47 (Appletalk Phase 2),
48 .B ipx
49 (Novell IPX) and
50 .B netrom
51 (AMPR Packet radio).
52
53 All numbers supplied as parts in IPv4 dotted decimal notation may be decimal,
54 octal, or hexadecimal, as specified in the ISO C standard
55 (that is, a leading '\fB0x\fR' or '\fB0X\fR' implies hexadecimal;
56 otherwise, a leading '\fB0\fR' implies octal;
57 otherwise, the number is interpreted as decimal).
58 Use of hexadecimal and octal numbers is not RFC-compliant and
59 therefore its use is discouraged.
60
61 .SH OPTIONS
62 .TP
63 .B \-a
64 display all interfaces which are currently available, even if down
65 .TP
66 .B \-s
67 display a short list (like \fBnetstat \-i\fR)
68 .TP
69 .B \-v
70 be more verbose for some error conditions
71 .TP
72 .I interface
73 The name of the interface. This is usually a driver name followed by
74 a unit number, for example
75 .B eth0
76 for the first Ethernet interface. If your kernel supports alias interfaces,
77 you can specify them with syntax like
78 .B eth0:0
79 for the first alias of eth0. You can use them to assign more addresses. To
80 delete an alias interface use
81 .BR "ifconfig eth0:0 down" .
82 Note: for every scope (i.e. same net with address/netmask combination) all
83 aliases are deleted, if you delete the first (primary).
84 .TP
85 .B up
86 This flag causes the interface to be activated. It is implicitly
87 specified if an address is assigned to the interface; you can suppress this
88 behavior when using an alias interface by appending an
89 .B "-"
90 to the alias (e.g.
91 .BR "eth0:0-" ).
92 It is also suppressed when using the IPv4 0.0.0.0 address as the kernel will
93 use this to implicitly delete alias interfaces.
94 .TP
95 .B down
96 This flag causes the driver for this interface to be shut down.
97 .TP
98 .B "[\-]arp"
99 Enable or disable the use of the ARP protocol on this interface.
100 .TP
101 .B "[\-]promisc"
102 Enable or disable the
103 .B promiscuous
104 mode of the interface. If selected, all packets on the network will
105 be received by the interface.
106 .TP
107 .B "[\-]allmulti"
108 Enable or disable
109 .B all-multicast
110 mode. If selected, all multicast packets on the network will be
111 received by the interface.
112 .TP
113 \fBmtu\fP \fIM\fP
114 This parameter sets the Maximum Transfer Unit (MTU) of an interface
115 to \fIM\fP bytes.
116 .TP
117 \fBdstaddr\fP \fIaddr\fP
118 Set the remote IP address for a point-to-point link (such as
119 PPP). This keyword is now obsolete; use the
120 .B pointopoint
121 keyword instead.
122 .TP
123 \fBnetmask\fP \fIaddr\fP
124 Set the IP network mask for this interface. This value defaults to the
125 usual class A, B or C network mask (as derived from the interface IP
126 address), but it can be set to any value.
127 .TP
128 \fBadd\fP \fIaddr\fB/\fIprefixlen\fR
129 Add an address to an interface.
130 .TP
131 \fBdel\fP \fIaddr\fB/\fIprefixlen\fR
132 Remove an address from an interface.
133 .TP
134 \fBtunnel\fP \fI::aa.bb.cc.dd\fP
135 Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
136 .TP
137 \fBirq\fP \fII\fP
138 Set the interrupt line used by this device.
139 Not all devices can dynamically change their IRQ setting.
140 .TP
141 \fBio_addr\fP \fIMem\fP
142 Set the start address in I/O space for this device.
143 Only a few old devices need this.
144 .TP
145 \fBmem_start\fP \fIMem\fP
146 Set the start address for shared memory used by this device.
147 Only a few old devices need this.
148 .TP
149 \fBmedia\fP \fItype\fP
150 Set the physical port or medium type to be used by the device. Not
151 all devices can change this setting, and those that can vary in what
152 values they support. Typical values for
153 .I type
154 are
155 .B 10base2
156 (thin Ethernet),
157 .B 10baseT
158 (twisted-pair 10Mbps Ethernet),
159 .B AUI
160 (external transceiver) and so on. The special medium type of
161 .B auto
162 can be used to tell the driver to auto-sense the media. Again, not
163 all drivers can do this.
164 .TP
165 \fB[\-]broadcast\fP [\fIaddr\fP]
166 If the address argument is given, set the protocol broadcast
167 address for this interface. Otherwise, set (or clear) the
168 .B IFF_BROADCAST
169 flag for the interface.
170 .TP
171 \fB[\-]pointopoint\fP [\fIaddr\fP]
172 This keyword enables the
173 .B point-to-point
174 mode of an interface, meaning that it is a direct link between two
175 machines with nobody else listening on it.
176 .br
177 If the address argument is also given, set the protocol address of
178 the other side of the link, just like the obsolete
179 .B dstaddr
180 keyword does. Otherwise, set or clear the
181 .B IFF_POINTOPOINT
182 flag for the interface.
183 .TP
184 \fBhw\fP \fIhwclass\fP \fIhwaddr\fP
185 Set the hardware address of this interface, if the device driver
186 supports this operation. The keyword must be followed by the
187 name of the hardware class \fIhwclass\fP and the printable ASCII
188 equivalent of the hardware address.
189 .br
190 Hardware classes currently supported include
191 .B ether
192 (Ethernet),
193 .B ax25
194 (AMPR AX.25),
195 .B ARCnet
196 and
197 .B netrom
198 (AMPR NET/ROM).
199 .TP
200 .B multicast
201 Set the multicast flag on the interface. This should not normally be needed
202 as the drivers set the flag correctly themselves.
203 .TP
204 \fBtxqueuelen\fP \fIlength\fP
205 Set the length of the transmit queue of the device. It is useful to set this
206 to small values for slower devices with a high latency (modem links, ISDN)
207 to prevent fast bulk transfers from disturbing interactive traffic like
208 telnet too much.
209 .TP
210 \fBname\fP \fInewname\fP
211 Change the name of this interface to \fInewname\fR.
212 The interface must be shut down first.
213 .TP
214 .I address
215 The IP address to be assigned to this interface.
216
217 .SH OUTPUT
218
219 .SS Interface Statistics Table (-s)
220 The table lists active (default) or all known (\fB\-a\fP) kernel interfaces.
221 With the \fB-s\fP option it is the same output as \fBnetstat \-i\fP.
222 .P
223 .EX
224 > ifconfig -s enp2s0f0
225 Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
226 enp2s0f0 1500 18668761 0 1318 0 26038367 0 0 0 BMRU
227 .EE
228
229 .P
230 The result table shows the following columns:
231 .TP
232 .B Iface
233 Name and alias prefix of the network interface.
234 .TP
235 .B MTU
236 The maximum transfer unit in bytes of this interface.
237 .TP
238 .B RX-OK
239 Number of successfully received packets since interface statistic was reset.
240 .TP
241 .B RX-ERR
242 Total count of receive errors since statistic reset.
243 This includes:
244 \fIrx_errors\fP (general receive errors),
245 \fIrx_crc_errors\fP (packets received with a CRC checksum failure),
246 \fIrx_frame_errors\fP (frame alignment errors, corrupted).
247 .TP
248 .B RX-DRP
249 Number of incoming packets that were dropped before reaching the
250 protocol stack.
251 Common causes: no buffer space in the driver,
252 congestion, or resource limitations.
253 .TP
254 .B RX-OVR
255 Number of packets dropped due to FIFO buffer overflows in the NIC or driver.
256 Common causes: the hardware could not push frames fast enough to the system.
257
258 .TP
259 .B TX-OK
260 Number of packets successfully transmitted since interface statistic was reset.
261 .TP
262 .B TX-ERR
263 Number of transmit errors.
264 Includes collisions, carrier loss, and other transmission failures.
265 .TP
266 .B TX-DRP
267 Number of packets dropped by the driver before being sent
268 (e.g., due to congestion or lack of buffer space).
269 .TP
270 .B TX-OVR
271 Number of packets lost due to transmit FIFO overflows in the hardware.
272 .TP
273 .B Flg
274 The flags for this interface, as listed below.
275
276 .SS Interface Flags
277 The list of interface flags used in the short and detailed interface output.
278 The names of the bit flag constants of the \fBSIOCGIFFLAGS\fP control
279 are listed in
280 .BR netdevice (7).
281
282 .TP
283 .BR A ", " ALLMULTI
284 Accepts all multicast packets (\fIIFF_ALLMULTI\fP).
285 .TP
286 .BR B ", " BROADCAST
287 Interface supports broadcast communication (\fIIFF_BROADCAST\fP).
288 .TP
289 .BR D ", " DEBUG
290 Internal debugging for the interface enabled (\fIIFF_DEBUG\fP).
291 .TP
292 .BR L ", " LOOPBACK
293 Interface is a loopback device (\fIIFF_LOOPBACK\fP).
294 .TP
295 .BR M ", " MULTICAST
296 Interface supports multicast communication (\fIIFF_MULTICAST\fP).
297 .TP
298 .BR d ", " DYNAMIC
299 Address is dynamically set (e.g. by DHCP) (\fIIFF_DYNAMIC\fP).
300 .TP
301 .BR P ", " PROMISC
302 Interface is in promiscuous mode (captures all packets) (\fIIFF_PROMISC\fP).
303 This flag might not reliably show promisc mode.
304 .TP
305 .BR N ", " NOTRAILERS
306 Avoid use of trailers in packets (\fIIFF_NOTRAILERS\fP).
307 .TP
308 .BR O ", " NOARP
309 Interface does not use ARP (\fIIFF_NOARP\fP).
310 .TP
311 .BR p ", " POINTOPOINT
312 Interface is point-to-point
313 (has a peer instead of broadcast) (\fIIFF_POINTOPOINT\fP).
314 .TP
315 .BR s ", " SLAVE
316 Interface is part of a bonded device (\fIIFF_SLAVE\fP).
317 .TP
318 .BR m ", " MASTER
319 Interface controls a bonded device (\fIIFF_MASTER\fP).
320 .TP
321 .BR R ", " RUNNING
322 Interface is operational and resources are allocated (\fIIFF_RUNNING\fP).
323 .TP
324 .BR U ", " UP
325 Interface is administratively up (\fIIFF_UP\fP).
326 .TP
327 .BR "[NO FLAGS]" ", " <>
328 If the bitmask for the interface status is 0.
329
330 .SS Interface Details
331 Sample output for the details of a single interface:
332 .P
333 .EX
334 > ifconfig enp2s0f0
335 enp2s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
336 inet 203.0.113.9 netmask 255.255.255.0 broadcast 203.0.113.255
337 inet6 fe80::a8bb:ccff:fedd:eeff prefixlen 64 scopeid 0x20<link>
338 inet6 2001:db8::a8bb:ccff:fedd:eeff prefixlen 64 scopeid 0x0<global>
339 ether aa:bb:cc:dd:ee:ff txqueuelen 1000 (Ethernet)
340 RX packets 18668507 bytes 9459465501 (8.8 GiB)
341 RX compressed 0
342 RX errors 0 dropped 1318 overruns 0 frame 0
343 TX packets 26038199 bytes 16983080620 (15.8 GiB)
344 TX compressed 0
345 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
346 device interrupt 30
347 .EE
348 .P
349 The output of the interface list is the same as \fBnetstat \-i \-e\fP.
350 .P
351 For each interface there is a block starting with the interface name
352 the \fBflags\fP and the \fBmtu\fP, optional \fBoutfil\fP and \fBkeepalive\fP.
353
354 Then one line for each address, prefixed with
355 the address type and its type specifc details.
356
357 .RS
358 In the example is one IPv4 (\fBinet\fP) address.
359 it specifies \fBnetmask\fP, optional \fBbroadcast\fP.
360 If the point-to-point flag is set if will show \fBdestination\fP address.
361
362 The example follows with two IPv6 (\fBinet6\fP) addresses.
363 Such a line specifies addresss, \fBprefixlen\fP, and \fBscopeid\fP:
364 .TP
365 .B compat
366 IPv4 compatibility address.
367 .TP
368 .B global
369 A Global Unicast Address (UGA).
370 .TP
371 .B site
372 A site-unique address.
373 .TP
374 .B link
375 A link-local address.
376 .TP
377 .B host
378 A loopback address.
379 .RE
380
381 .P
382 This is followed with a line for the hardware address family
383 (\fBether\fP in this case).
384 This line contains \fBtxqueuelen\fP if available.
385
386 .P
387 If the device is configured for port selection, it has a \fBmedia\fP line.
388
389 .P
390 After that the \fBpackets\fP statistics for transmit (\fBTX\fP)
391 and receive (\fBRX\fP) are shown
392 (same as in the short format above, but the different
393 error counters are shown seperate).
394 Additionally the total number of \fBbytes\fP (frame sizes total)
395 are shown (with a human friendly formatting as comment).
396 The \fBcompressed\fP packet counter lines are optional.
397 .P
398 The final \fBdevice\fP line lists optional driver details,
399 with some of the following keywords:
400 .BR interrupt ", " base ", " memory ", and " dma .
401
402 .SH NOTES
403 Since kernel release 2.2 there are no explicit interface statistics for
404 alias interfaces anymore. The statistics printed for the original address
405 are shared with all alias addresses on the same device. If you want per-address
406 statistics you should add explicit accounting
407 rules for the address using the
408 .BR iptables (8)
409 command.
410
411 .P
412 Since net\-tools 1.60\-4 ifconfig is printing byte counters and human readable
413 counters with IEC 60027-2 units. So 1 KiB are 2^10 byte. Note, the numbers
414 are truncated to one decimal (which can by quite a large error if you
415 consider 0.1 PiB is 112.589.990.684.262 bytes :)
416
417 .P
418 Interrupt problems with Ethernet device drivers fail with EAGAIN
419 .I (SIOCSIIFLAGS: Resource temporarily unavailable)
420 it is most likely a interrupt conflict.
421
422 .SH FILES
423 .I /proc/net/dev
424 .I /proc/net/if_inet6
425
426 .SH BUGS
427 Ifconfig uses the ioctl access method to get the full address information,
428 which limits hardware addresses to 8 bytes.
429 Because Infiniband hardware address has 20 bytes,
430 only the first 8 bytes are displayed correctly.
431 Please use
432 .B ip link
433 command from
434 .B iproute2
435 package to display link layer informations including the hardware address.
436
437 .P
438 While appletalk DDP and IPX addresses will be displayed they cannot be
439 altered by this command.
440
441 .SH SEE ALSO
442 .na
443 Homepage of the \fInet\-tools\fP project:
444 .UR https://net-tools.sourceforge.io
445 .UE
446
447 Prefixes for binary multiples (NIST):
448 .UR https://physics.nist.gov/cuu/Units/binary.html
449 .UE
450
451 .P
452 .BR route (8),
453 .BR netstat (8),
454 .BR arp (8),
455 .BR ip-link (8),
456 .BR iptables (8)
457 .br
458 .BR interfaces (5),
459 .BR ip (7),
460 .BR netdevice (7)
461
462 .SH AUTHORS
463 Fred N. van Kempen <[email protected]>,
464 .br
465 Alan Cox <[email protected]>, Andi Kleen,
466 .br
467 Phil Blundell <[email protected]>,
468 .br
469 Bernd Eckenfels <net\[email protected]>.