A network interface is the point where your system connects to a network. It may be a physical card, a Wi-Fi radio or a virtual device made in software.
Interface names
Older systems used names such as eth0 and wlan0. Many current distributions use predictable names based on hardware location, such as enp3s0 (wired) or wlp2s0 (wireless). The lo interface is the loopback: it lets the machine talk to itself at 127.0.0.1.
Listing interfaces
The ip command, from the iproute2 package, is the current tool:
$ ip -br link show
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
enp3s0 UP 52:54:00:12:34:56 <BROADCAST,MULTICAST,UP,LOWER_UP>-br means brief output. UP in the flags means the interface is enabled. LOWER_UP means the link below it is working, for example a cable is connected.
To see addresses, use:
$ ip -br addr show
lo UNKNOWN 127.0.0.1/8 ::1/128
enp3s0 UP 192.168.1.25/24The /24 is the prefix length. The subnetting guide explains it.
Changing settings
Changes need root. Replace enp3s0 with your interface name:
$ sudo ip link set dev enp3s0 down
$ sudo ip link set dev enp3s0 up
$ sudo ip addr add 192.168.1.60/24 dev enp3s0
$ sudo ip addr del 192.168.1.60/24 dev enp3s0Taking down the interface you are logged in through will cut your SSH session.
Changes made with ip are temporary. They are lost at reboot. Permanent settings belong to the tool that manages your network: NetworkManager, systemd-networkd (often through Netplan on Ubuntu Server) or /etc/network/interfaces on some Debian installs.
Counters and ifconfig
$ ip -s link show dev enp3s0-s adds statistics such as received and transmitted packets, errors and drops. Rising error counts can point to a bad cable or port.
You may still see ifconfig. It belongs to the older net-tools package, which many distributions no longer install by default. Learn ip first.
Try it
- Run
ip -br link showand name each interface. - Run
ip -br addr showand find your IPv4 address and prefix. - Run
ip -s link showand check for errors or drops.
Check your understanding
Network Interfaces
All 5 sections ยท no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.