Legacy network notes still tell admins to run the ifconfig command in Linux, especially on older servers, embedded images, and scripts written before iproute2 became standard. ifconfig reads interface addresses, MAC addresses, MTU values, status flags, and packet counters, and it can still make temporary interface changes such as bringing a link up or down. Modern systems usually prefer the ip command for new work, but ifconfig remains useful when you need to understand or maintain older network workflows.
Understand the ifconfig Command
ifconfig vs ip Command
ifconfig comes from the net-tools package, while ip comes from iproute2. Most current desktop and server distributions install iproute2 by default and leave net-tools optional, so you may need to install net-tools before older ifconfig examples work. Both commands inspect interfaces, but they use different syntax and fit different maintenance eras:
| Feature | ifconfig (net-tools) | ip (iproute2) |
|---|---|---|
| Default on mainstream desktop/server distros | Usually no (install net-tools) | Usually yes |
| IPv6 support | Limited | Full |
| Multiple IPs per interface | Via aliases (eth0:0) | Native (ip addr add) |
| Active development | Maintenance only | Actively developed |
| Script portability | Wide legacy support | Modern standard |
| Output format | Verbose, familiar | Terse, structured |
ifconfigis legacy tooling on modern Linux systems. For new scripts and configurations, prefer theipcommand fromiproute2, which is the normal replacement. Keepifconfighandy for reading legacy scripts, working with BusyBox-style environments, and managing older systems whereipis unavailable.
ifconfig Command Syntax
The ifconfig manual page separates display mode from configuration mode:
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
In the second form, aftype means an address family such as inet or inet6.
The three common display flags control what you see before you start changing an interface:
-a: Show all interfaces, including inactive ones.-v: Verbose mode; prints additional error detail.-s: Short statistics table showing packet counts per interface.
Linux does not use ifconfig all, ifconfig /all, or the Windows ipconfig /all form. Use ifconfig -a for the legacy Linux all-interfaces view, or ip addr show with modern tooling.
Changes made with
ifconfigare not persistent across reboots. To make permanent changes, edit your distribution’s network configuration files:/etc/netplan/on Ubuntu,/etc/network/interfaceson Debian, or/etc/NetworkManager/system-connections/on Fedora and RHEL-based systems.
ifconfig Quick Reference
Common ifconfig operations at a glance:
| Task | Command | Notes |
|---|---|---|
| Show active interfaces | ifconfig | No flags needed |
| Show all interfaces | ifconfig -a | Includes inactive ones |
| Show one interface | ifconfig eth0 | Replace eth0 with your interface name |
| Short stats table | ifconfig -s | Packet and error counts per interface |
| Assign IP address | sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0 | Requires root |
| Bring interface up | sudo ifconfig eth0 up | Requires root |
| Bring interface down | sudo ifconfig eth0 down | Requires root |
| Add secondary IP | sudo ifconfig eth0:0 192.168.1.11 netmask 255.255.255.0 | Interface aliasing |
| Change MTU | sudo ifconfig eth0 mtu 9000 | Standard Ethernet default: 1500 |
| Enable promiscuous mode | sudo ifconfig eth0 promisc | For packet capture tools |
| Disable promiscuous mode | sudo ifconfig eth0 -promisc | Prefix flag with - to disable |
| Change MAC address | sudo ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF | Bring interface down first |
Install the ifconfig Command
ifconfig is not installed by default on many modern Linux distributions. The package name is net-tools, not ifconfig, so commands such as dnf install ifconfig or pacman -S ifconfig fail even though the binary name is correct.
Install net-tools with your distribution’s package manager:
Debian and Ubuntu:
sudo apt install net-tools
Fedora, RHEL, AlmaLinux, and Rocky Linux:
sudo dnf install net-tools
Arch Linux:
sudo pacman -S net-tools
Verify the installation:
command -v ifconfig
A common path on Debian, Ubuntu, Fedora, and RHEL-family systems is:
/usr/sbin/ifconfig
Arch and some other layouts may return a different path such as /usr/bin/ifconfig. The important result is that command -v prints a path instead of returning nothing.
Alpine Linux ships BusyBox, which includes its own minimal
ifconfigapplet without needingnet-tools. The BusyBox command reference documents a smaller option surface, so expect older labels such asLink encap:andHWaddrinstead of theflags=andetherlabels shown bynet-tools.
Practical ifconfig Command Examples
Display Active Network Interfaces
Running ifconfig without arguments shows all currently active interfaces and their configuration:
ifconfig
Example output from a host with one Ethernet adapter looks like this:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 1e:2c:03:9e:46:bb txqueuelen 1000 (Ethernet)
RX packets 52981 bytes 71678727 (71.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47722 bytes 3440294 (3.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
Each interface entry shows its flags, MTU, assigned IPv4 address (inet), IPv6 address (inet6), MAC address (ether), and packet transmission statistics. The lo interface is the loopback adapter used for internal system communication at 127.0.0.1.
Addresses such as 192.168.1.100, 10.x.x.x, and 172.16.x.x through 172.31.x.x are private LAN addresses. If your computer sits behind a router or NAT gateway, ifconfig shows the local interface address, not necessarily the public internet address seen by websites. External IP lookup services answer that different public-WAN question; they are not the Linux ifconfig command.
The flags between angle brackets describe the current interface state:
| Flag | Meaning |
|---|---|
UP | Interface is enabled and can send or receive traffic |
BROADCAST | Interface supports sending packets to all hosts on the subnet |
RUNNING | Network driver has allocated resources; hardware is ready |
MULTICAST | Interface supports multicast traffic |
LOOPBACK | Loopback interface, present on lo only |
PROMISC | Promiscuous mode is active; interface captures all packets |
ALLMULTI | All-multicast mode is active; receives all multicast packets |
On modern systems, interfaces use predictable names like
ens3,enp2s0, orwlp3s0rather than the oldereth0andwlan0convention. The examples in this guide useeth0for brevity; substitute your actual interface name throughout.
Display All Interfaces Including Inactive
The -a flag shows every interface, including those that are down or have no address assigned:
ifconfig -a
This is useful when troubleshooting a missing interface. If an interface exists but is down, it will not appear in plain ifconfig output; -a reveals it.
Display a Specific Interface
Pass an interface name to limit output to that single interface:
ifconfig eth0
Example output:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 1e:2c:03:9e:46:bb txqueuelen 1000 (Ethernet)
RX packets 52981 bytes 71678727 (71.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47722 bytes 3440294 (3.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Once you know the interface subnet (192.168.1.0/24 in this example), the nmap command can scan for active hosts and open ports on networks you administer or have permission to test.
View a Short Statistics Summary
The -s flag produces a compact table of packet statistics for all interfaces at once, useful for a quick health check:
ifconfig -s
Example output:
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0 1500 52981 0 0 0 47722 0 0 0 BMRU lo 65536 0 0 0 0 0 0 0 0 LRU
Each column represents packet counts per interface since the last boot or counter reset. RX-OK and TX-OK are successfully received and transmitted packets. Non-zero values in RX-ERR, RX-DRP, TX-ERR, or TX-DRP indicate receive errors, dropped frames, transmit errors, or dropped outbound packets; any of these warrant further investigation. The Flg column abbreviates the interface flags: B=BROADCAST, M=MULTICAST, R=RUNNING, U=UP, L=LOOPBACK.
Assign an IP Address and Netmask
To configure an IP address on an interface, pass the interface name, the IP address, the netmask keyword, and the subnet mask. This requires root access:
This creates a temporary static assignment. ifconfig does not request a DHCP lease; use your network manager or DHCP client when the interface should receive an address automatically.
Changing the address on an active interface can break current connections. Avoid running address-change examples on a production or remote interface unless you have console access or another way back into the system.
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
Verify the assignment:
ifconfig eth0
Relevant output includes the new inet and netmask values:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 1e:2c:03:9e:46:bb txqueuelen 1000 (Ethernet)
Bring a Network Interface Up or Down
The up and down arguments enable or disable an interface. Taking an interface down stops all traffic on it without requiring a reboot, which is useful when testing new configuration or recovering from a misconfiguration:
Running
sudo ifconfig eth0 downon your primary interface disconnects you from the network immediately, including active SSH sessions. Ensure you have local console access or an out-of-band connection before running this on a remote system.
sudo ifconfig eth0 down
Check the interface state:
ifconfig eth0
When down, the UP and RUNNING flags are absent from the relevant output line:
eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500
Bring it back up:
sudo ifconfig eth0 up
Check the interface again:
ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Add a Secondary IP with Interface Aliasing
Interface aliasing assigns multiple IP addresses to a single physical adapter using the interface:N naming convention. A server can then respond to multiple IPs on the same NIC, which is useful for virtual hosting or testing:
sudo ifconfig eth0:0 192.168.1.101 netmask 255.255.255.0
Confirm the alias was created:
ifconfig eth0:0
eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255
ether 1e:2c:03:9e:46:bb txqueuelen 0 (Ethernet)
To remove the secondary IP, bring the alias down. Querying that alias afterward should no longer return an interface entry:
sudo ifconfig eth0:0 down
Check the alias name afterward:
ifconfig eth0:0
eth0:0: error fetching interface information: Device not found
Advanced ifconfig Techniques
Change the MTU Size
The Maximum Transmission Unit (MTU) controls the largest packet size an interface sends in a single frame. Standard Ethernet uses 1500 bytes. Jumbo frames extend this to 9000 bytes, reducing per-packet overhead on high-throughput networks such as storage or data center links:
sudo ifconfig eth0 mtu 9000
Verify the change by piping output through grep to filter the MTU field:
ifconfig eth0 | grep mtu
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000
Jumbo frames require end-to-end support: the NIC, every switch, and any router on the path must all be configured for the same MTU. A mismatch causes packet fragmentation, dropped frames, and connection failures. Test with a small subset of traffic before applying jumbo frames to production links.
Enable and Disable Promiscuous Mode
Under normal operation, a NIC drops frames that are not addressed to it. Promiscuous mode asks the interface to pass every frame it receives up the stack, including frames for other destinations. On switched networks, this does not guarantee visibility into every host’s traffic; the switch still controls which frames reach the port. Packet analysis tools like Wireshark and tcpdump rely on this mode to monitor traffic.
Enable promiscuous mode:
sudo ifconfig eth0 promisc
Check the interface flags:
ifconfig eth0
When enabled, PROMISC appears in the relevant output line:
eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500
Disable it by prepending - to the flag name:
sudo ifconfig eth0 -promisc
Check the flags again:
ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Enable and Disable All-Multicast Mode
The allmulti flag puts the interface into all-multicast mode, making it receive all multicast packets on the network rather than only those for subscribed groups. This is used by multicast-aware services such as video streaming servers and cluster heartbeat daemons.
Enable all-multicast mode:
sudo ifconfig eth0 allmulti
Check the interface flags:
ifconfig eth0
eth0: flags=4675<UP,BROADCAST,RUNNING,ALLMULTI,MULTICAST> mtu 1500
Disable it:
sudo ifconfig eth0 -allmulti
Check the flags again:
ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Change the MAC Address
Each NIC has a hardware MAC address. ifconfig can override it at the OS level for the duration of the session. Use this only on networks you administer or have permission to test, such as lab policy checks, temporary privacy testing, or matching a known test fixture. The interface must be down before the change:
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF
sudo ifconfig eth0 up
Confirm the new address is active by filtering with grep:
ifconfig eth0 | grep ether
ether aa:bb:cc:dd:ee:ff txqueuelen 1000 (Ethernet)
The MAC change lasts only until the next reboot. On some systems, NetworkManager or the kernel may reset it sooner. For a persistent override, configure the MAC address in your distribution’s network management tool (
nmclior a Netplan YAML on Ubuntu).
ifconfig and ip Command Equivalents
For new scripts and modern networking tasks, ip from iproute2 is the preferred interface tool on most Linux systems. On older images where ip is unavailable, ifconfig is still useful for basic interface status and simple runtime changes.
Map ifconfig Commands to ip Equivalents
| ifconfig action | ip command equivalent | What changes |
|---|---|---|
ifconfig | ip addr show | List interface addresses and state |
ifconfig eth0 | ip addr show dev eth0 | Show one interface only |
ifconfig -a | ip addr show | Show all interfaces, including down interfaces |
ifconfig eth0 up | ip link set eth0 up | Enable interface |
ifconfig eth0 down | ip link set eth0 down | Disable interface |
ifconfig -s | ip -s link show | Show interface traffic counters |
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 | ip addr replace 192.168.1.100/24 dev eth0 | Assign or replace an IPv4 address with CIDR prefix |
ifconfig all or ifconfig /all | ifconfig -a or ip addr show | Use Linux flags rather than Windows-style syntax |
Most ip forms are script-friendly and safer for modern multi-address layouts, predictable names such as enp0s3, virtual devices, and hardware address reporting on newer link types.
ifconfig does not show routing paths, ARP neighbor tables, or traceroute hops. Use ip route for gateways and routes, ip neigh for neighbor entries, and traceroute or tracepath when you need the Linux equivalent of Windows tracert.
Use ifconfig with Wireless Interfaces
For basic bring-up tasks, ifconfig can show a wireless interface state and set basic up or down flags, but it does not manage Wi-Fi channel, SSID, or security settings. Use iw, iwconfig, or nmcli for modern wireless configuration.
Compare ifconfig and ifcfg
ifcfg refers to legacy network configuration files or helper tooling on some RHEL-family systems. It is not a drop-in replacement for live runtime commands with ifconfig, and modern NetworkManager systems usually store persistent connection profiles as keyfiles instead.
Check ifconfig Deprecation Status
ifconfig is not removed from Linux systems, but it is legacy tooling. Prefer ip addr for address inspection and ip link for link state in modern scripts unless you are maintaining older notes.
Troubleshoot Common ifconfig Errors
ifconfig: command not found
If ifconfig is not installed, the shell returns:
bash: ifconfig: command not found
Some Ubuntu and Debian shells also print a package hint like this:
Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools
Install net-tools with your distro’s package manager, then verify the binary with command -v ifconfig.
ip: command not found
If your system is very minimal, a legacy workflow can fail with this error when you try the equivalent examples:
bash: ip: command not found
Install the package that provides ip for your distro:
- Debian and Ubuntu:
sudo apt install iproute2 - Fedora, RHEL, AlmaLinux, and Rocky Linux:
sudo dnf install iproute - Arch Linux:
sudo pacman -S iproute2
Verify with a short query like:
ip -brief a
Example output includes interface names, state, and addresses:
lo UNKNOWN 127.0.0.1/8 ::1/128 eth0 UP 192.168.1.100/24
Device Not Found Error
Specifying an interface name that does not exist produces an error similar to one of these forms:
eth0: error fetching interface information: Device not found SIOCGIFFLAGS: No such device
Run ifconfig -a to list all interfaces and find the correct name. On modern systems with predictable interface naming, the adapter may be ens3, enp2s0, or wlp3s0 instead of eth0. If the interface is absent entirely, check whether the kernel recognizes the adapter with ip link show.
SIOCSIFFLAGS: Operation Not Permitted
Running a configuration command without root access produces:
SIOCSIFFLAGS: Operation not permitted
SIOCSIFFLAGS is the kernel’s internal name for the socket ioctl call that sets interface flags; the message simply means the operation requires root access. Interface configuration operations (assigning IPs, changing MTU, toggling interfaces up or down) require root privileges. Prefix the command with sudo:
sudo ifconfig eth0 up
Configuration Does Not Persist After Reboot
All changes applied with ifconfig reset at reboot. For a permanent assignment, configure the interface through the network manager that controls the connection:
- Ubuntu (Netplan): Edit the YAML file in
/etc/netplan/and runsudo netplan apply. - Debian (ifupdown systems): Edit
/etc/network/interfacesand restart networking withsudo systemctl restart networking. - Fedora / RHEL / Rocky / AlmaLinux: Use
nmclior edit the connection file in/etc/NetworkManager/system-connections/and runsudo nmcli connection reload.
Conclusion
ifconfig is still useful for reading legacy network output, checking interface flags, and making short-lived interface changes from net-tools. Use ifconfig -a when an adapter is hidden, keep sudo for configuration changes, and move new scripts toward ip addr and ip link so they match current Linux networking tools.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><a href="https://example.com">link</a><blockquote>quote</blockquote>