Network Information on Linux

This guide explains how to identify all relevant network information on Linux using standard command-line tools.
It is designed to work correctly even when multiple network interfaces are present (Ethernet, Wi-Fi, VPN, virtual interfaces).

All information in this guide is obtained using standard Linux networking commands available on most distributions.


Supported systems

This guide applies to most modern Linux distributions, including:

Applies to systems using:


What information you will find

This guide helps you identify:


Commands used

Network information on Linux is obtained using the following commands:

ip addr
ip route

These commands display all network interfaces and routing information on the system.


How to run the commands

  1. Open Terminal
  2. Run:

ip addr

The output is divided into sections, one per network interface.


Understanding network interfaces

Each block in the output represents one network interface.

Common interface names on Linux include:

Most systems show multiple interfaces. This is normal.


Which interface should you use?

In most cases, use:

Ignore interfaces that:

If a VPN is connected, an additional VPN interface (tunX, wg0) will appear separately.


Local IP address (LAN)

The local IP address identifies the computer inside the local network.

To find it:

Example:

inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic

Meaning:

Typical local IP ranges:


Router (gateway) IP address

The router IP address is obtained using:

ip route

Example output:

default via 192.168.1.1 dev enp3s0

Meaning:


VPN IP address

A VPN IP address exists only when a VPN connection is active.

To find it:

Example:

wg0: inet 100.96.12.34/32 scope global

Notes:


MAC address (hardware address)

The MAC address uniquely identifies a network interface.

To find it:

Example:

link/ether 3c:52:82:9a:b4:1f brd ff:ff:ff:ff:ff:ff

Important notes: