Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Linux See Network Interfaces How-To

· 4 min read · Home Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Linux See Network Interfaces allows you to list and identify all active and inactive network devices on your system. This is useful for network diagnostics, configuration, and troubleshooting. You’ll learn how to use built-in Linux commands to view this information accurately and efficiently.

What You'll Need

  • A Linux-based operating system (e.g., Ubuntu, Debian, CentOS, etc.)
  • Access to a terminal or command-line interface
  • Basic familiarity with terminal commands
  • Internet access to install tools if needed

Step-by-Step

  1. Open your terminal by searching for it in your application menu or using a keyboard shortcut like Ctrl + Alt + T.
  2. Type the command ip link show and press Enter. This command lists all network interfaces along with their current status (UP or DOWN). For example, you might see lo (loopback), eth0 (Ethernet), wlan0 (Wi-Fi), and possibly virtual interfaces like docker0 or br- for container or bridge networks.
  3. Alternatively, run ip addr show to see detailed information, including IP addresses assigned to each interface. This helps when verifying if an interface is receiving or using a network address. For example, inet 192.168.1.5/24 means the interface has been assigned an IPv4 address.
  4. For a more concise list, try ls /sys/class/net, which shows only the names of available network interfaces. This is particularly useful in scripting or when you need just the names without extra details.
  5. To get driver and hardware information about each network interface, use lspci or lshw with sudo if needed. For example, lspci -v may reveal the manufacturer and driver in use for a network card.

Common Mistakes

  • Forgetting to run commands with sudo when hardware or system details are needed. Some commands like lspci or lshw may return incomplete or permission-denied errors without elevated privileges.
  • Mixing up commands like ip and ifconfig (the latter is deprecated in many distributions). While ifconfig is still available in some systems, it lacks the modern features of ip and iproute2.
  • Not checking both active and inactive interfaces, which can be missed when only using ip link without flags. For example, a newly added interface may not appear in the default output unless explicitly queried.

Tips

  • Use ip link set up or down to enable or disable an interface if needed. This is useful when testing connectivity or rebooting networking services.
  • Check /etc/network/interfaces or nmcli if you're using NetworkManager for network configuration. This helps when manually or automatically managing network settings across reboots.
  • Use man ip in the terminal to read the full manual of the ip command for advanced usage. The ip tool is highly flexible and supports many other operations like route management and tunneling.

Troubleshooting

If your commands don’t return expected results:

  • Verify that your system is up to date with apt update && apt upgrade (Debian/Ubuntu) or yum check-update (CentOS). Sometimes, outdated tools or kernel modules can cause unexpected behavior.
  • Ensure that the ip or ifconfig tool is installed. If not, install iproute2 or net-tools using your package manager. For example, sudo apt install net-tools on Debian-based systems.
  • Try running commands as root with sudo if permissions are an issue. Some network tools require elevated privileges to access hardware or system-level data.
  • Check for typos or incorrect interface names in commands. For example, using eth1 when the correct interface is enp0s3 can result in no output or errors.

Frequently Asked Questions

What is the difference between ip addr show and ip link show?

ip addr show displays IP addresses and interface details, while ip link show shows only interface names and status.

Can I use ifconfig instead?

Yes, but ifconfig is deprecated in many modern Linux distributions. Use ip commands instead for better compatibility and more features.

How do I see only active interfaces?

Add state UP to the command: ip link show state UP to display only interfaces currently active.

Why don’t I see any interfaces listed?

Check if your hardware is properly detected and not disabled in BIOS/UEFI or if the kernel module is loaded with lsmod | grep .

What if I see no IP address assigned to an interface?

Use ip addr add / dev to assign one manually for testing, or check your network manager or config files.

Can I filter by interface type?

Yes, by using ip link show or filtering output with grep or awk in scripts.