ifconfig
Overview
ifconfig configures and displays network interfaces from the legacy net-tools package. On modern Linux, prefer ip from iproute2 (ip addr, ip link, ip route). This page exists for reading old docs, recovery shells that still ship net-tools, and muscle-memory translation to ip.
Many minimal images no longer install ifconfig by default.
Syntax
ifconfig [interface]
ifconfig interface [address_family] optionsCommon Options / forms
| Form | Description |
|---|---|
ifconfig |
List up interfaces (often only “up”) |
ifconfig -a |
All interfaces including down |
ifconfig eth0 |
Show one interface |
ifconfig eth0 up / down |
Bring interface up/down |
ifconfig eth0 192.0.2.10 netmask 255.255.255.0 |
Set IPv4 |
ifconfig eth0 add ... |
Additional addresses (implementation-dependent) |
ifconfig eth0 hw ether AA:BB:... |
Set MAC (may need down first) |
ifconfig eth0 mtu 1400 |
Set MTU |
ifconfig eth0:0 ... |
Alias interface style (legacy) |
Examples with Explanations
Display
ifconfig
ifconfig -a
ifconfig eth0Preferred modern equivalents
ip -br link
ip -br addr
ip addr show dev eth0
ip link set eth0 up
ip addr add 192.0.2.10/24 dev eth0
ip routeBring up/down
sudo ifconfig eth0 up
sudo ifconfig eth0 down
# modern:
sudo ip link set eth0 upSet address (legacy)
sudo ifconfig eth0 192.0.2.10 netmask 255.255.255.0
# modern CIDR:
sudo ip addr add 192.0.2.10/24 dev eth0MTU
sudo ifconfig eth0 mtu 1400
sudo ip link set eth0 mtu 1400Install on Debian/Ubuntu if missing
sudo apt install net-toolsStill prefer learning ip.
Notes / Pitfalls
- Output and available flags differ across Unixes; Linux net-tools is not identical to BSD.
- Changes are not persistent — use netplan/NetworkManager/systemd-networkd.
- Alias interfaces (
eth0:0) are obsolete vs multiple addresses on one device. - Scripts parsing
ifconfigare fragile — useip -jJSON when available. - Wireless details: use
iw/ NetworkManager, not only ifconfig.
2026-relevant notes
- Teaching and certification materials may still show ifconfig; translate on sight to
ip. - Containers:
ipis the standard; ifconfig often absent. - For persistent config, never rely on either ifconfig or ip alone — use the distro network stack.
Additional Resources
man ifconfig(if installed),man ip