Master Linux Network Management with the Powerful ip Command
This guide explains how to use the Linux ip command to view and configure network interfaces, manage IP addresses, routes, VLANs, ARP entries, and network aliases, providing practical examples and syntax for effective system networking tasks.
ip Command Basics
The ip command is part of the iproute2 suite and is used to display and manipulate routing tables, network interfaces, and tunnels. Its basic syntax is: ip [OPTIONS] OBJECT COMMAND Where OBJECT can be link, addr, route, etc., and COMMAND can be add, del, show, among others.
View Network Interface Information
Show all network interfaces and their status: ip link show Show a specific interface (e.g., eth0):
ip link show dev eth0Enable and Disable Network Interfaces
Enable an interface: ip link set dev eth0 up Disable an interface:
ip link set dev eth0 downConfigure IP Addresses
Add an IP address to an interface: ip addr add 192.168.1.10/24 dev eth0 Delete an IP address from an interface: ip addr del 192.168.1.10/24 dev eth0 Show all IP addresses: ip addr show Show IP addresses for a specific interface:
ip addr show dev eth0Manage Routes
Display the current routing table: ip route show Add a route to a specific network: ip route add 192.168.1.0/24 via 192.168.1.1 Delete a specific route: ip route del 192.168.1.0/24 Add a default route:
ip route add default via 192.168.1.1Configure Network Alias
Add an alias address to an interface (useful for multiple IP scenarios):
ip addr add 192.168.1.20/24 dev eth0 label eth0:1View the alias configuration:
ip addr show dev eth0Manage ARP Cache
Show the ARP cache table: ip neigh show Add a static ARP entry:
ip neigh add 192.168.1.10 lladdr 00:11:22:33:44:55 dev eth0Delete an ARP entry:
ip neigh del 192.168.1.10 dev eth0VLAN Configuration
Create a VLAN interface:
ip link add link eth0 name eth0.100 type vlan id 100Delete a VLAN interface:
ip link delete eth0.100Command Summary Table
View network interfaces : ip link show – displays all interfaces.
Enable interface : ip link set dev eth0 up – brings the interface up.
Disable interface : ip link set dev eth0 down – brings the interface down.
Configure IP address : ip addr add 192.168.1.10/24 dev eth0 – adds an address.
Delete IP address : ip addr del 192.168.1.10/24 dev eth0 – removes an address.
Show routing table : ip route show – lists routes.
Add route : ip route add 192.168.1.0/24 via 192.168.1.1 – adds a route.
Delete route : ip route del 192.168.1.0/24 – removes a route.
Configure network alias : ip addr add 192.168.1.20/24 dev eth0 label eth0:1 – adds an alias.
Show ARP cache : ip neigh show – displays ARP entries.
Add ARP entry : ip neigh add 192.168.1.10 lladdr 00:11:22:33:44:55 dev eth0 – adds a static entry.
Delete ARP entry : ip neigh del 192.168.1.10 dev eth0 – removes an entry.
Create VLAN : ip link add link eth0 name eth0.100 type vlan id 100 – creates VLAN interface.
Delete VLAN : ip link delete eth0.100 – deletes VLAN interface.
Conclusion
The Linux ip command is a powerful and flexible tool for network management, capable of handling everything from basic interface configuration to advanced routing and VLAN tasks. Mastering these common operations enables efficient administration and troubleshooting of Linux network environments.
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.
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.
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.
