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.
This guide applies to most modern Linux distributions, including:
Applies to systems using:
This guide helps you identify:
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.
ip addr
The output is divided into sections, one per network interface.
Each block in the output represents one network interface.
Common interface names on Linux include:
eth0, eth1
Ethernet interfaces (common on servers and Raspberry Pi)
enpXsY
Ethernet interfaces (predictable naming on modern systems)
wlan0
Wi-Fi interface (older naming)
wlpXsY
Wi-Fi interface (modern naming)
tun0, tunX
VPN interfaces (TUN-based VPNs)
wg0
WireGuard VPN interface
lo
Loopback interface (ignore)
Most systems show multiple interfaces. This is normal.
In most cases, use:
eth0, enpXsY) → if connected by cablewlan0, wlpXsY) → if connected via Wi-FiIgnore interfaces that:
loinet addressIf a VPN is connected, an additional VPN interface (tunX, wg0) will
appear separately.
The local IP address identifies the computer inside the local network.
To find it:
inetExample:
inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic
Meaning:
/24 → subnet mask (255.255.255.0)Typical local IP ranges:
The router IP address is obtained using:
ip route
Example output:
default via 192.168.1.1 dev enp3s0
Meaning:
A VPN IP address exists only when a VPN connection is active.
To find it:
tun0, tun1, or wg0inet value under that interfaceExample:
wg0: inet 100.96.12.34/32 scope global
Notes:
The MAC address uniquely identifies a network interface.
To find it:
link/etherExample:
link/ether 3c:52:82:9a:b4:1f brd ff:ff:ff:ff:ff:ff
Important notes: