Doesn't ifconfig show IPv4 address? (IPv6 related)

Abstract: Resolve missing IPv4 addresses in ifconfig by using ip addr show on modern Linux systems.

Created: 2026-10-23 by

Yes, the ifconfig command does show IPv4 addresses, but modern Linux distributions often disable it by default or replace it with ip addr. If you do not see an IPv4 address, check if the interface is up, verify that DHCP has assigned an address, and ensure you are using a compatible tool like ip addr show which provides more comprehensive network configuration details than legacy utilities.

Why ifconfig Might Not Show IPv4 Addresses

The primary reason users encounter this issue is that many contemporary Linux distributions have deprecated the net-tools package, which contains ifconfig, in favor of iproute2. While ifconfig remains available on older systems or those where net-tools is still installed, it may not display all active interfaces or address families depending on how the system is configured. Additionally, ifconfig only displays interfaces that are currently "up" and have been initialized. If your network interface is down or in a dormant state, ifconfig will simply omit it from its output entirely. Another common cause is that the user might be looking at the wrong interface name. Modern systems often use dynamic naming schemes (like enp3s0 or eth0) rather than the generic lo or eth0 found in older tutorials. If you run ifconfig without arguments, it lists all active interfaces. If you see no IPv4 addresses, it is possible that the interface is either inactive or configured exclusively for IPv6, although dual-stack configurations are standard in most environments. It is also worth noting that some minimal installations strip out net-tools to save space, leaving only iproute2 commands available. In such cases, attempting to run ifconfig will result in a "command not found" error, leading users to believe the command exists but returns empty data.

Verifying Interface Status and Configuration

To diagnose why an IPv4 address is missing, you must first determine the status of your network interfaces. The most reliable way to do this on modern Linux systems is by using the ip command suite. Specifically, running ip addr show will list all network interfaces along with their associated IP addresses, regardless of whether they are IPv4 or IPv6. This command provides a detailed view of the link layer and network layer configurations. Look for the state UP indicator next to your primary interface name. If the state is DOWN, the interface is not actively transmitting or receiving data, and thus no IP address will be assigned until the link is established. If the interface is up but lacks an IPv4 address, check the output for scope global under the inet field. This indicates a globally routable IPv4 address. If you only see inet6 entries, your system might be operating in an IPv6-only environment, or DHCPv4 may have failed to assign an address. You can also use ip link show to verify the physical state of the interface. If the carrier is detected but no IP is present, the issue likely lies with the DHCP client or the network configuration files rather than the visibility of the address itself. For users who prefer a graphical interface, network manager applets often provide a clearer summary of connection statuses, including whether an IPv4 lease has been successfully obtained.

Using ip addr Instead of ifconfig

Since ifconfig is largely obsolete, transitioning to ip addr is highly recommended for accurate network diagnostics. The syntax is straightforward: ip addr show mirrors the functionality of ifconfig but includes both IPv4 and IPv6 addresses by default. You can filter the output for a specific interface by appending the interface name, such as ip addr show eth0. This command outputs the interface index, state, MAC address, and all assigned IP addresses in a structured format. It also clearly distinguishes between temporary, permanent, and scoped addresses, which ifconfig does not do. For example, when you run ip addr show, you will see lines starting with inet followed by the IPv4 address and CIDR notation (e.g., 192.168.1.10/24). Below that, you will see inet6 entries for IPv6 addresses. This dual visibility helps confirm that your system is correctly configured for dual-stack networking. If you find that ifconfig is still installed but not showing IPv4, while ip addr does, it confirms that the interface is active and configured correctly, but the legacy tool is failing to parse or display the data due to its age and limited feature set. Installing iproute2 ensures you have access to these modern diagnostic tools.

Troubleshooting Missing IPv4 Leases

If ip addr show confirms that the interface is up but no IPv4 address is assigned, the problem is likely with the DHCP process. Check your system logs using journalctl -u NetworkManager or journalctl -u dhcpcd to see if there were any errors during the lease acquisition process. Common issues include incorrect DNS settings, firewall rules blocking DHCP traffic, or physical layer problems such as disconnected cables or switch port misconfigurations. Ensure that your network configuration file (such as /etc/netplan/*.yaml on Ubuntu or /etc/network/interfaces on Debian) is correctly set to request an IPv4 address via DHCP. In some cases, static IP configurations might override DHCP, leading to confusion if the static address is incorrectly defined. Review your network configuration files to ensure that the method is set to dhcp or that the static address matches your subnet requirements. If you are managing multiple interfaces, ensure that routing tables are correctly populated so that traffic is directed to the appropriate gateway. For persistent issues, restarting the network service or rebooting the machine can sometimes resolve transient DHCP lease failures. Additionally, checking for conflicts with other articles on similar topics, such as those discussing IPv6 address discrepancies, can provide broader context for network stack behavior. See Why is my public IPv6 address different from the one listed in Linux? for related insights on address management.

Ensuring Compatibility with Legacy Tools

If you absolutely must use ifconfig for compatibility reasons, you can install the net-tools package. On Debian-based systems, use sudo apt install net-tools, and on Red Hat-based systems, use sudo yum install net-tools. However, be aware that this package is no longer maintained and may not support newer kernel features or network namespaces effectively. After installation, ifconfig should function as expected, displaying IPv4 addresses if they are present. Nevertheless, relying on legacy tools is discouraged for new deployments. Always prefer iproute2 for scripting and automation, as it offers more robust parsing options and better integration with modern Linux networking stacks.

Frequently Asked Questions

Is ifconfig still supported in modern Linux kernels?

No, ifconfig is part of the deprecated net-tools package and is not included in many modern minimal Linux installations. It is considered legacy software, and developers recommend using ip addr from the iproute2 suite instead. While it may still work if manually installed, it lacks support for advanced networking features.

How do I see only IPv4 addresses using the ip command?

You can filter the output of ip addr show by piping it through grep to isolate IPv4 entries. Use the command ip addr show | grep inet to display only lines containing IPv4 addresses. Note that this will also show IPv6 loopback addresses if you do not specify -4 or filter further, but typically inet refers to IPv4.

What should I do if my interface shows no IP address at all?

If neither ifconfig nor ip addr shows an IP address, check if the interface is administratively enabled using ip link set dev eth0 up. Then, verify that your DHCP client is running and attempting to acquire an address. Check system logs for any errors related to network initialization or hardware detection.

Can ifconfig display IPv6 addresses?

Yes, ifconfig can display IPv6 addresses if they are assigned to the interface, but it may not show all IPv6 address types (such as link-local or temporary addresses) as comprehensively as ip addr. The output format for IPv6 in ifconfig is less detailed, making ip addr the preferred choice for IPv6 troubleshooting.

Why does my system have an IPv6 address but no IPv4 address?

This can happen if your network is configured for IPv6-only connectivity, or if DHCPv4 fails to assign an address while DHCPv6 succeeds. It may also occur in virtualized environments where the guest OS is configured with IPv6 but lacks proper IPv4 networking drivers or configuration. Verify your network provider's capabilities and your OS network configuration files.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More