Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9
ifconfig belongs to the old net-tools package, which minimal installations of Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 no longer include. Use the ip command instead:
ip addr # IP addresses (short: ip a) ip link # interfaces and their state ip route # routing table and default gateway ip -s link # traffic counters
If you still need ifconfig
dnf install net-tools # AlmaLinux / Rocky apt install net-tools # Ubuntu / Debian
net-tools also brings back netstat, route and arp. See "Deprecated Linux Networking Commands and Their Replacements" for the modern equivalents.
Reading the ip addr output
- Each interface starts with a number and its name, for example
2: eth0or2: ens3.lois the local loopback interface. state UPmeans the interface is connected.- The
inetline shows the IPv4 address with its prefix (for example192.0.2.10/24);inet6shows IPv6 addresses.
Show only the public IPv4 addresses with ip -4 addr show scope global, or all addresses in one line with hostname -I.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
