Operations 7 min read

Master Linux ip Command: Essential Network Management Techniques

This guide explains the powerful Linux ip command, covering its basic syntax, how to view and configure network interfaces, manage IP addresses, routes, VLANs, and ARP entries, and provides practical examples for everyday system administration tasks.

Raymond Ops
Raymond Ops
Raymond Ops
Master Linux ip Command: Essential Network Management Techniques

Linux ip command common operations

In Linux, the ip command is a powerful tool for managing network interfaces and routing, offering more features and finer control than the older ifconfig command. This article details the most frequently used ip operations to help users efficiently manage and configure networks.

ip command basics

The ip command is part of the iproute2 package and is primarily 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 specifies the action such as add, del, show, etc.

Viewing network interface information

Show all interfaces: ip link show Show a specific interface (e.g., eth0):

ip link show dev eth0

Enabling and disabling interfaces

Enable an interface: ip link set dev eth0 up Disable an interface:

ip link set dev eth0 down

Configuring IP addresses

Add an IP address to an interface: ip addr add 192.168.1.10/24 dev eth0 Delete an IP address: 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 eth0

Managing routes

Display the current routing table: ip route show Add a route to a 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.1

Configuring network aliases

Add an alias IP address to an interface:

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

View the alias configuration:

ip addr show dev eth0

Managing ARP cache

Show the ARP table: 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 versatile network management tool that can handle everything from basic interface configuration to advanced routing and VLAN management. Mastering these common operations enables users to manage and troubleshoot Linux network environments more efficiently.

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.

System Administrationnetwork managementiproute2ip command
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

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.