Operations 7 min read

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

This guide explains how to use the powerful Linux ip command—replacing ifconfig—to configure IP addresses, manage routing tables, view network statistics, monitor netlink messages, handle ARP entries, and control interfaces, with practical examples and code snippets for system administrators and developers.

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

Linux's ip command is a more powerful replacement for ifconfig , part of the iproute2 suite, and is intended to supersede the deprecated ifconfig from net-tools.

Most Linux distributions already include iproute2; you can also download it or compile the latest source with:

git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/shemminger/iproute2.git

Setting and Deleting IP Addresses

Assign an IP address to an interface: sudo ip addr add 192.168.0.193/24 dev wlan0 Note the CIDR suffix (e.g., /24) indicating the subnet mask (255.255.255.0). Verify the address with: ip addr show wlan0 Delete the address by replacing add with del:

sudo ip addr del 192.168.0.193/24 dev wlan0

Listing Routing Table Entries

Show the current routing table: ip route show Query the route a specific destination would take:

ip route get 10.42.0.47

Changing the Default Route

Set a new default gateway:

sudo ip route add default via 192.168.0.196

Displaying Network Statistics

Show detailed statistics for an interface (e.g., p2p1) using the -s -s options:

ip -s -s link ls p2p1

ARP Entries

View the ARP table (IP to MAC address mappings) with:

ip neighbour

Monitoring Netlink Messages

Monitor netlink events to see interface state changes (e.g., REACHABLE, STALE):

ip monitor all

Activating and Deactivating Network Interfaces

Bring an interface down or up, similar to ifconfig:

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

Getting Help

If you are unsure about an option, use the help subcommand (the man page often lacks details):

ip route help

Conclusion

For network administrators and all Linux users, the ip command is an essential tool that should replace ifconfig , especially when writing scripts.

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.

NetworkingSystem AdministrationNetwork Configurationip command
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

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.