Operations 7 min read

Master Linux Networking: Using the ip Command to Manage Interfaces, Routes, and Stats

This guide explains how to install the ip utility, configure and delete IP addresses, view and modify routing tables, display interface statistics, monitor netlink messages, manage ARP entries, and obtain help, providing practical command examples for Linux system administrators.

ITPUB
ITPUB
ITPUB
Master Linux Networking: Using the ip Command to Manage Interfaces, Routes, and Stats

Installing iproute2

The ip command belongs to the iproute2 suite and supersedes the deprecated ifconfig utility. Most Linux distributions ship iproute2 by default; if it is missing, you can build it from source:

git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/shemminger/iproute2.git
cd iproute2
make
sudo make install

Setting and Deleting IP Addresses

Assign an IPv4 address to an interface (e.g., wlan0) with the add verb. The suffix /24 represents the subnet mask 255.255.255.0. sudo ip addr add 192.168.0.193/24 dev wlan0 Verify the assignment:

ip addr show wlan0

Remove the address by replacing add with del:

sudo ip addr del 192.168.0.193/24 dev wlan0

Listing Routing Table Entries

Display the complete routing table:

ip route show

Show the route that would be taken to reach a specific destination:

ip route get 10.42.0.47

Changing the Default Route

Set a new default gateway (replace 192.168.0.196 with the desired gateway address):

sudo ip route add default via 192.168.0.196

Displaying Network Statistics

Show per‑interface statistics with the -s -s flags for detailed output. Replace p2p1 with the actual interface name.

ip -s -s link ls p2p1

ARP (Neighbour) Table

List IP‑to‑MAC address mappings known to the kernel:

ip neighbour

Monitoring Netlink Messages

Observe real‑time netlink events (e.g., interface state changes, neighbour updates):

ip monitor all

Activating and Deactivating Interfaces

Bring an interface down or up, analogous to ifconfig:

sudo ip link set ppp0 down
sudo ip link set ppp0 up

Getting Help

Display built‑in help for a specific ip object (e.g., route):

ip route help

Summary

The ip command is the modern, script‑friendly tool for configuring, querying, and troubleshooting network interfaces, routes, ARP entries, and netlink events on Linux. Mastering its syntax replaces the legacy ifconfig workflow and enables precise, automated network management.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

shellNetworkingip command
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.