IFCONFIG(8)

๐Ÿ’… IFCONFIG โ€” configure a network interface (section 8 of the Linux System Administrator's Manual, bestie) ๐ŸŽ€

okay so real talk, this is the ifconfig page from the Linux System Administrator's Manual, section 8, and honestly? it's a whole era. let's get into it โœจ


โœจ NAME โœจ

ifconfig โ€” configure a network interface ๐ŸŒธ


โœจ SYNOPSIS โœจ

ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...

like. two whole shapes. pick your fighter ๐Ÿซถ


โœจ DESCRIPTION โœจ

so ifconfig is the girl who configures the kernel-resident network interfaces. she's the one who shows up at boot time and sets up interfaces as needed โ€” that's her main character moment. after boot? she mostly only gets called when you're debugging or when the system needs some tuning. lowkey a "break glass in case of emergency" icon ๐Ÿ’…

here's the vibe check on how she decides what to do:

  • no arguments at all โ†’ she displays the status of the currently active interfaces ๐Ÿ‘‘
  • one single interface argument โ†’ she shows you the status of just that interface, no extras ๐Ÿ™ˆ
  • a single -a argument โ†’ she shows you all interfaces, even the ones that are down (yes, the sleeping ones, she sees them) ๐Ÿ’€
  • anything else โ†’ congrats, you're configuring an interface now, fr fr

๐Ÿฆ‹ Address Families ๐Ÿฆ‹

if the first argument after the interface name is recognized as the name of a supported address family, then that address family is used for decoding and displaying all protocol addresses. she commits to the bit โœจ

currently supported address families include:

  • inet (TCP/IP โ€” and this one is the default, no cap)
  • inet6 (IPv6)
  • ax25 (AMPR Packet Radio)
  • ddp (Appletalk Phase 2)
  • ipx (Novell IPX)
  • netrom (AMPR Packet radio)

and here's a chaotic little detail โ€” all numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard. so, like:

  • a leading 0x or 0X implies hexadecimal
  • otherwise, a leading '0' implies octal
  • otherwise, the number is interpreted as decimal
โš ๏ธ bestie, listen โ€” use of hexadecimal and octal numbers is not RFC-compliant and therefore its use is discouraged. i'm not saying don't, i'm saying don't ๐Ÿ˜ญ

โœจ OPTIONS โœจ

all the flags, all the lore, let's go ๐Ÿ“

  • -a โ€” display all interfaces which are currently available, even if down ๐Ÿ‘€ she sees all.
  • -s โ€” display a short list (like netstat -i). snack-sized output ๐Ÿงš
  • -v โ€” be more verbose for some error conditions. she'll tell you more when things go wrong ๐Ÿ’–
  • interface โ€” the name of the interface. this is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface. if your kernel supports alias interfaces, you can specify them with syntax like eth0:0 for the first alias of eth0 โ€” you can use them to assign more addresses. to delete an alias interface use ifconfig eth0:0 down. note: for every scope (i.e. same net with address/netmask combination) all aliases are deleted, if you delete the first (primary). yeah. the whole scope. gone. ๐Ÿ’€
  • up โ€” this flag causes the interface to be activated โญ it's implicitly specified if an address is assigned to the interface; you can suppress this behavior when using an alias interface by appending an - to the alias (e.g. eth0:0-). it's also suppressed when using the IPv4 0.0.0.0 address, because the kernel will use this to implicitly delete alias interfaces. sneaky ๐Ÿ˜ญ
  • down โ€” this flag causes the driver for this interface to be shut down. nap time bestie ๐Ÿ˜ด
  • [-]arp โ€” enable or disable the use of the ARP protocol on this interface ๐Ÿฆ‹
  • [-]promisc โ€” enable or disable the promiscuous mode of the interface. if selected, all packets on the network will be received by the interface. she's nosy and thriving ๐Ÿ’…
  • [-]allmulti โ€” enable or disable all-multicast mode. if selected, all multicast packets on the network will be received by the interface ๐ŸŒˆ
  • mtu N โ€” this parameter sets the Maximum Transfer Unit (MTU) of an interface ๐Ÿ”ฅ
  • dstaddr addr โ€” set the remote IP address for a point-to-point link (such as PPP). this keyword is now obsolete; use the pointopoint keyword instead ๐Ÿ™ˆ
  • netmask addr โ€” set the IP network mask for this interface. this value defaults to the usual class A, B or C network mask (as derived from the interface IP address), but it can be set to any value โœจ
  • add addr/prefixlen โ€” add an IPv6 address to an interface ๐Ÿซถ
  • del addr/prefixlen โ€” remove an IPv6 address from an interface ๐Ÿซถ
  • tunnel ::aa.bb.cc.dd โ€” create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination ๐Ÿงšโ€โ™€๏ธ
  • irq addr โ€” set the interrupt line used by this device. not all devices can dynamically change their IRQ setting โ€” so like, don't count on it ๐Ÿ’€
  • io_addr addr โ€” set the start address in I/O space for this device โšก
  • mem_start addr โ€” set the start address for shared memory used by this device. only a few devices need this ๐ŸŒธ
  • media type โ€” set the physical port or medium type to be used by the device. not all devices can change this setting, and those that can vary in what values they support. typical values for type are 10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and so on. the special medium type of auto can be used to tell the driver to auto-sense the media. again, not all drivers can do this ๐Ÿ™ˆ
  • [-]broadcast [addr] โ€” if the address argument is given, set the protocol broadcast address for this interface. otherwise, set (or clear) the IFF_BROADCAST flag for the interface ๐Ÿ‘‘
  • [-]pointopoint [addr] โ€” this keyword enables the point-to-point mode of an interface, meaning that it is a direct link between two machines with nobody else listening on it ๐Ÿ‘€ (just the two of them. iconic.) if the address argument is also given, set the protocol address of the other side of the link, just like the obsolete dstaddr keyword does. otherwise, set or clear the IFF_POINTOPOINT flag for the interface ๐Ÿ’œ
  • hw class address โ€” set the hardware address of this interface, if the device driver supports this operation. the keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM) ๐Ÿ”ฅ
  • multicast โ€” set the multicast flag on the interface. this should not normally be needed as the drivers set the flag correctly themselves ๐ŸŒˆ (girlboss drivers, honestly)
  • address โ€” the IP address to be assigned to this interface โœจ
  • txqueuelen length โ€” set the length of the transmit queue of the device. it's useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much ๐Ÿซถ (protect the telnet girlies)
  • name newname โ€” change the name of this interface to newname. the interface must be shut down first โš ๏ธ like, she has to be asleep for the rebrand, no cap.

โœจ NOTES โœจ

  • since kernel release 2.2 there are no explicit interface statistics for alias interfaces anymore. the statistics printed for the original address are shared with all alias addresses on the same device ๐Ÿ˜ญ if you want per-address statistics you should add explicit accounting rules for the address using the iptables(8) command.
  • since net-tools 1.60-4 ifconfig is printing byte counters and human readable counters with IEC 60027-2 units. so 1 KiB = 2^10 byte. note, the numbers are truncated to one decimal (which can be quite a large error if you consider 0.1 PiB is 112.589.990.684.262 bytes :) โ€” she said :) and meant it ๐Ÿ’€
  • interrupt problems with Ethernet device drivers fail with EAGAIN (SIOCSIIFLAGS: Resource temporarily unavailable) โ€” it is most likely a interrupt conflict. see http://www.scyld.com/expert/irq-conflict.html for more information โšก

โœจ FILES โœจ

  • /proc/net/dev
  • /proc/net/if_inet6

โœจ BUGS โœจ

  • ifconfig uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes ๐Ÿ’€ because Infiniband hardware address has 20 bytes, only the first 8 bytes are displayed correctly. please use the ip link command from the iproute2 package to display link layer informations including the hardware address ๐Ÿ™
  • while appletalk DDP and IPX addresses will be displayed they cannot be altered by this command ๐Ÿ˜ค showing โ‰  touching, apparently.

โœจ SEE ALSO โœจ

route(8), netstat(8), arp(8), rarp(8), iptables(8), ifup(8), interfaces(5)

http://physics.nist.gov/cuu/Units/binary.html โ€” Prefixes for binary multiples ๐Ÿฆ‹


โœจ AUTHORS โœจ

the legends themselves ๐Ÿ‘‘๐Ÿ’–

  • Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  • Alan Cox, <Alan.Cox@linux.org>
  • Phil Blundell, <Philip.Blundell@pobox.com>
  • Andi Kleen
  • Bernd Eckenfels, <net-tools@lina.inka.de>

okay that's the whole page!! this one's from net-tools, dated 2008-10-03, and it's IFCONFIG(8) all day ๐ŸŽ€ and the manual is titled IFCONFIG(8) with the Linux System Administrator's Manual energy, just so we're clear ๐Ÿ’… slay, go configure something, periodt โœจ๐Ÿ’œ