Operations 6 min read

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.

Open Source Linux
Open Source Linux
Open Source Linux
Master Linux Network Management with the Powerful ip Command

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 eth0

Enabling and Disabling Interfaces

Enable: ip link set dev eth0 up Disable:

ip link set dev eth0 down

Configuring 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 eth0

Managing 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.1

Configuring Network Aliases

Add an alias:

ip addr add 192.168.1.20/24 dev eth0 label eth0:1

Show aliases:

ip addr show dev eth0

Managing 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 eth0

Delete an ARP entry:

ip neigh del 192.168.1.10 dev eth0

VLAN Configuration

Create a VLAN interface:

ip link add link eth0 name eth0.100 type vlan id 100

Delete a VLAN interface:

ip link delete eth0.100

Summary

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.

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.

NetworkSystem AdministrationNetwork Configurationip command
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.