Master Linux Network Management with the Powerful ip Command
This article provides a comprehensive guide to the Linux ip command, covering its syntax, how to view and configure network interfaces, manage IP addresses, routes, VLANs, and ARP entries, enabling users to efficiently administer and troubleshoot network settings.
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 general syntax is ip [OPTIONS] OBJECT COMMAND where OBJECT can be link, addr, route, etc., and COMMAND includes actions such as add, del, show.
Viewing Network Interfaces
Show all interfaces: ip link show Show a specific interface (e.g., eth0):
ip link show dev eth0Enabling and Disabling Interfaces
Enable: ip link set dev eth0 up Disable:
ip link set dev eth0 downConfiguring IP Addresses
Add an address: ip addr add 192.168.1.10/24 dev eth0 Delete an address: ip addr del 192.168.1.10/24 dev eth0 Show all addresses: ip addr show Show addresses on a specific device:
ip addr show dev eth0Managing Routes
Show routing table: ip route show Add a route: ip route add 192.168.1.0/24 via 192.168.1.1 Delete a route: ip route del 192.168.1.0/24 Add default route:
ip route add default via 192.168.1.1Configuring Network Aliases
Add an alias:
ip addr add 192.168.1.20/24 dev eth0 label eth0:1Show aliases:
ip addr show dev eth0Managing ARP Cache
Show ARP entries: 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.100Summary
The Linux ip command is a powerful and flexible tool for network management, covering everything from basic interface configuration to advanced routing and VLAN handling. 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.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
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.
