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.
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 installSetting 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 wlan0Remove the address by replacing add with del:
sudo ip addr del 192.168.0.193/24 dev wlan0Listing Routing Table Entries
Display the complete routing table:
ip route showShow the route that would be taken to reach a specific destination:
ip route get 10.42.0.47Changing 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.196Displaying 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 p2p1ARP (Neighbour) Table
List IP‑to‑MAC address mappings known to the kernel:
ip neighbourMonitoring Netlink Messages
Observe real‑time netlink events (e.g., interface state changes, neighbour updates):
ip monitor allActivating and Deactivating Interfaces
Bring an interface down or up, analogous to ifconfig:
sudo ip link set ppp0 down
sudo ip link set ppp0 upGetting Help
Display built‑in help for a specific ip object (e.g., route):
ip route helpSummary
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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
