ThisCalculator

Everyday

Find Linux Interface Link State and IP Address

Updated · Standard formula, shown below

Find Linux Interface Link State and IP Address

To find a Linux network interface’s link state and IP address, run ip -br link for a concise link summary and ip -br addr for its addresses. For full details on one interface, use ip link show dev enp3s0 and ip addr show dev enp3s0, replacing enp3s0 with the name shown on your system.

What link state and IP address mean

A network interface is a device or virtual endpoint through which Linux can send and receive network traffic. Examples include a wired Ethernet port, a Wi-Fi adapter, a loopback interface, a VPN tunnel, and a virtual machine bridge. Each has a name such as eth0, wlan0, lo, or a newer predictable name such as enp3s0.

“Link state” can refer to two related but different things. The administrative state describes whether the interface has been enabled in software; the physical carrier state says whether a wired connection has detected a link. An IP address is a separate network-layer setting. An interface may be enabled and have an IP address even when no physical link is detected, or have a live link but no usable IP address.

Quick commands with ip

The ip command is part of the widely used iproute2 networking tools. These commands are read-only and normally do not require administrator privileges:

  • ip -br link lists interfaces in brief form, including their names and link-related flags.
  • ip -br addr lists interfaces with assigned IPv4 and IPv6 addresses.
  • ip link show prints detailed link information for all interfaces.
  • ip addr show prints addresses for all interfaces.
  • ip addr show dev enp3s0 narrows the address output to one interface.

The -br option means brief output. It is useful on servers with many virtual interfaces, but the full output contains more clues, including interface flags, address scope, and whether an address is temporary or dynamically assigned.

How to read the output

A brief link listing might look like this:

lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
enp3s0           UP             3c:52:82:11:22:33 <BROADCAST,MULTICAST,UP,LOWER_UP>
wlp2s0           DOWN           58:ef:68:44:55:66 <BROADCAST,MULTICAST>

Names and addresses vary by machine. In detailed output, flags such as UP indicate the interface is administratively enabled, while LOWER_UP usually indicates that the lower layer reports a working link. A state such as DOWN or NO-CARRIER can indicate that the interface is disabled or lacks a detected carrier. Interpret the flags together rather than treating one word as a complete diagnosis. Loopback commonly shows UNKNOWN; that does not mean the local loopback interface is broken.

Address output may contain lines like inet 192.0.2.24/24 and inet6 2001:db8::24/64. inet identifies an IPv4 address; inet6 identifies IPv6. The slash suffix is the prefix length, which describes the network portion of the address. An interface can have multiple addresses, including both IPv4 and IPv6, and an address may be marked dynamic, temporary, or with a scope such as global or link.

Check physical carrier and interface details

For a wired Ethernet device, Linux often exposes a carrier indicator through sysfs. First identify the interface, then read its carrier value:

cat /sys/class/net/enp3s0/carrier

A value of 1 means carrier is detected; 0 means it is not. This check may not be meaningful for every virtual, wireless, or loopback interface, and the file may be unavailable for some devices. Another option for supported Ethernet hardware is ethtool enp3s0, which can show whether a link is detected along with speed and duplex information. Availability and reported details depend on the driver and device.

For Wi-Fi, link status is not the whole story: the adapter may be enabled but disconnected from an access point, or connected without having a working route to the internet. The command iw dev can show wireless devices and interfaces, while iw dev wlp2s0 link reports connection details when supported. Network management tools may provide further connection status, but the exact commands depend on the distribution and setup.

When there is no address or the link is down

If an interface appears but has no expected address, work through the layers rather than immediately changing network settings:

  1. Confirm the interface name with ip -br link. Names can differ from examples and may change across hardware or configuration changes.
  2. Check the interface flags and, for wired Ethernet, carrier. For a cable connection, inspect the cable and switch or router port if carrier is absent.
  3. Check whether the interface has any addresses with ip addr show dev enp3s0. A link can be up without an IPv4 address, particularly if address assignment has not completed or the network uses IPv6.
  4. Check the active network manager or connection configuration. A desktop may use a graphical network manager; a server may use a distribution-specific service or configuration system.
  5. Inspect routes with ip route for IPv4 or ip -6 route for IPv6 if the address exists but traffic cannot reach its destination.

Do not assume that an address beginning with 169.254 is a normal router-assigned IPv4 address; it is commonly a link-local address used when ordinary configuration is unavailable. Likewise, 127.0.0.1 belongs to loopback and is not the machine’s LAN address. Avoid using ip link set ... down or changing addresses as a first diagnostic step: those commands alter networking and can disconnect a remote session.

Other commands and useful distinctions

Older guides often recommend ifconfig, but it may not be installed by default and is generally superseded for routine inspection by ip. If ip is missing, install or use the appropriate networking tools for the distribution rather than assuming a particular package manager.

To see the address that a particular internet connection uses publicly, a local ip addr listing is not enough. It shows addresses assigned to local interfaces, often private LAN addresses; a router may translate them to a public address. The public address is observed outside the machine and can differ by connection, VPN, or network design. Similarly, “interface is up” does not prove that DNS works or that the internet is reachable. Those are separate checks.

Frequently Asked Questions

How do I show all IP addresses on Linux?
Run ip addr or its concise version, ip -br addr. The output can include several IPv4 and IPv6 addresses per interface.

How can I check whether an Ethernet cable is connected?
Check the interface with ip link show dev INTERFACE and, where supported, read /sys/class/net/INTERFACE/carrier. Carrier value 1 indicates detection; also inspect the cable and network port if it is 0.

What does LOWER_UP mean in Linux?
It is a link-layer flag indicating that the lower layer reports the interface as operational. For physical Ethernet, it commonly accompanies a detected link, but it is not a guarantee of a working IP route or internet connection.

Why does my interface show UP but have no IP address?
UP means the interface is enabled, not that it has received an address. Check address assignment, connection configuration, DHCP service where applicable, and whether another protocol such as IPv6 is in use.

Is 127.0.0.1 my Linux computer’s network IP?
It is the IPv4 loopback address, used by the computer to communicate with itself. Use ip -br addr to find addresses assigned to other interfaces.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.