Skip to content

Linux ip Command — Managing and Troubleshooting Network Configuration

The ip command is the modern Linux networking utility used to configure, manage, and troubleshoot network interfaces, IP addresses, routing tables, ARP/Neighbor tables, tunnels, Virtual Local Area Networks (VLANs), and network namespaces. It replaces legacy networking tools such as ifconfig, route, arp, and netstat for many networking tasks. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should master the ip command.


Learning Path

Networking Mastery → Module 9: Linux Networking → Lesson 1

Difficulty: Beginner

Reading Time: 140 Minutes

Course Progress

Course: Networking Mastery

Module: Linux Networking

Lesson: 1 of 10


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand the ip command
  • Manage network interfaces
  • Configure IP addresses
  • Manage routing tables
  • View neighbor tables
  • Troubleshoot Linux networking
  • Work with VLANs and network namespaces

Prerequisites

Complete:

  • Module 1–8

Basic understanding of:

  • IP Addressing
  • Routing
  • Linux Commands

Why Learn the ip Command?

Almost every networking problem on Linux starts with one question:

Does the machine have

Network Connectivity?

The first tool every Linux engineer uses is:

ip

Whether you're troubleshooting:

  • No Internet
  • Wrong IP Address
  • Routing Issues
  • Kubernetes Networking
  • Docker Networking
  • Cloud VM Connectivity

the ip command is one of the first diagnostic tools.


What is the ip Command?

The ip command belongs to the:

iproute2

package.

It manages:

  • Network Interfaces
  • IP Addresses
  • Routes
  • Neighbor Tables
  • Tunnels
  • VLANs
  • Network Namespaces

Why Replace ifconfig?

Older Linux systems used:

ifconfig
route
arp

Modern Linux uses:

ip

Advantages:

  • Unified Tool
  • IPv4 & IPv6 Support
  • More Features
  • Better Performance
  • Active Development

Basic Syntax

ip OBJECT COMMAND

Examples:

ip addr
ip route
ip link

Display Interfaces

Show all network interfaces.

ip link

Example output:

1: lo
2: eth0
3: ens5

Display IP Addresses

ip addr

Shortcut:

ip a

Example:

eth0

192.168.1.10/24

Display IPv4 Only

ip -4 addr

Display IPv6 Only

ip -6 addr

Show Specific Interface

ip addr show eth0

or

ip a show eth0

Bring Interface Up

sudo ip link set eth0 up

Bring Interface Down

sudo ip link set eth0 down

Assign IP Address

sudo ip addr add 192.168.1.100/24 dev eth0

Remove IP Address

sudo ip addr del 192.168.1.100/24 dev eth0

Display Routing Table

ip route

Shortcut:

ip r

Example:

default via 192.168.1.1

192.168.1.0/24 dev eth0

Add Default Route

sudo ip route add default via 192.168.1.1

Delete Default Route

sudo ip route del default

Add Static Route

sudo ip route add 10.10.10.0/24 via 192.168.1.1

Delete Static Route

sudo ip route del 10.10.10.0/24

Neighbor Table

Display ARP/Neighbor entries.

ip neigh

Example:

192.168.1.1

aa:bb:cc:dd:ee:ff

Flush Neighbor Cache

sudo ip neigh flush all

Interface Statistics

ip -s link

Displays:

  • RX Packets
  • TX Packets
  • Errors
  • Dropped Packets

Monitor Network Changes

ip monitor

Displays changes in real time.

Useful for:

  • Interface State Changes
  • Address Changes
  • Route Updates

Display Routing Rules

ip rule

Useful for:

  • Policy-Based Routing
  • Multiple Routing Tables

Display Routing Tables

ip route show table all

Create VLAN Interface

Example:

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

Bring it up.

sudo ip link set eth0.100 up

Assign an address.

sudo ip addr add 192.168.100.10/24 dev eth0.100

Network Namespaces

List namespaces.

ip netns list

Create namespace.

sudo ip netns add lab1

Delete namespace.

sudo ip netns del lab1

Run command inside namespace.

sudo ip netns exec lab1 ip addr

Network namespaces will be covered in detail later in this module.


Tunnel Interfaces

Display tunnel interfaces.

ip tunnel

Examples include:

  • GRE
  • SIT
  • IPIP

Enterprise Example

Production server:

Internet


Router


Linux Server

Troubleshooting steps:

ip addr


ip route


ip neigh


ping Gateway

Cloud Perspective

Cloud engineers frequently use:

ip addr

to verify:

  • Private IP
  • Secondary IPs
  • IPv6 Address

Use:

ip route

to troubleshoot:

  • Cloud Routing
  • VPN
  • Network Address Translation (NAT)
  • Load Balancer Issues

Kubernetes Perspective

On Kubernetes nodes:

ip addr

shows:

  • Pod Interfaces
  • Container Network Interface (CNI) Interfaces
  • Bridge Interfaces

Example:

cni0

flannel.1

vxlan.calico

Routes can be inspected using:

ip route

Linux Networking Workflow

Application


Socket


Network Interface


Routing


Gateway


Internet

The ip command helps inspect each stage of this path.


Common ip Commands

Command Purpose
ip addr Show IP addresses
ip link Show interfaces
ip route Show routing table
ip neigh Show ARP/Neighbor table
ip -s link Show interface statistics
ip monitor Monitor network changes
ip rule Show routing rules
ip netns list List network namespaces

Hands-on Lab

Task 1

Display interfaces.

ip link

Task 2

Display IP addresses.

ip addr

Task 3

Display routing table.

ip route

Task 4

Display neighbor table.

ip neigh

Task 5

Display interface statistics.

ip -s link

Task 6

Create a temporary IP address.

sudo ip addr add 192.168.10.100/24 dev eth0

Verify:

ip addr

Remove it:

sudo ip addr del 192.168.10.100/24 dev eth0

Task 7

Create a network namespace.

sudo ip netns add demo

Verify:

ip netns list

Delete it:

sudo ip netns del demo

Task 8

Create a troubleshooting checklist using:

  • ip addr
  • ip link
  • ip route
  • ip neigh
  • ping
  • traceroute

Common Troubleshooting Workflow

When a Linux server has no network connectivity:

Step 1

ip link

Interface up?

Step 2

ip addr

IP assigned?

Step 3

ip route

Default gateway exists?

Step 4

ip neigh

Gateway reachable?

Step 5

ping Gateway

Step 6

ping 8.8.8.8

Step 7

ping google.com

This systematic approach quickly identifies Layer 2, Layer 3, or Domain Name System (DNS) issues.


Common Mistakes

❌ Forgetting sudo for configuration changes.

✅ Use elevated privileges when modifying network settings.


❌ Bringing down the wrong interface.

✅ Verify interface names before making changes.


❌ Adding duplicate IP addresses.

✅ Check existing configuration first.


❌ Removing the default route accidentally.

✅ Verify routing before deleting entries.


❌ Assuming ip changes are persistent.

✅ Use your distribution's network configuration tools to make permanent changes.


Best Practices

  • Use ip instead of legacy networking commands.
  • Verify interface status before troubleshooting applications.
  • Always check routing after IP configuration changes.
  • Monitor interface statistics for packet drops and errors.
  • Document production network changes.
  • Use network namespaces for testing isolated network configurations.
  • Avoid modifying production routes without a rollback plan.

Interview Questions

Beginner

  1. What is the ip command?
  2. How do you display IP addresses?
  3. How do you display the routing table?
  4. How do you bring an interface up?

Intermediate

  1. Explain the difference between ip addr and ip link.
  2. How do you add a static route?
  3. What is the Neighbor table?
  4. What are Network Namespaces?

Architect Level

  1. Explain how you would troubleshoot a Linux server with no network connectivity using the ip command.
  2. Design a Linux networking troubleshooting workflow.
  3. Explain how the ip command is used in Kubernetes and cloud networking.

Summary

In this lesson, you learned:

  • The ip command
  • Network Interfaces
  • IP Address Management
  • Routing Tables
  • Neighbor Tables
  • Interface Statistics
  • VLAN Configuration
  • Network Namespaces
  • Linux Network Troubleshooting

The ip command is the most important networking utility on modern Linux systems. It provides a unified interface for managing network interfaces, IP addresses, routing, neighbor discovery, VLANs, tunnels, and namespaces. Mastering this command is essential for troubleshooting Linux servers, cloud infrastructure, Kubernetes nodes, and enterprise networks.


Key Takeaways

  • ip is the modern replacement for ifconfig, route, and arp.
  • Use ip addr to view and manage IP addresses.
  • Use ip link to manage network interfaces.
  • Use ip route to inspect and configure routing.
  • Use ip neigh to view ARP and Neighbor Discovery information.
  • Network namespaces provide isolated networking environments.
  • The ip command is one of the first tools used for Linux network troubleshooting.

What's Next?

ss

In the next lesson, you'll learn about ss (Socket Statistics).

You'll explore:

  • What ss is
  • Viewing TCP and UDP Connections
  • Listening Ports
  • Socket States
  • Process Information
  • Network Troubleshooting
  • Performance Analysis

By the end of the lesson, you'll understand how to inspect sockets, active connections, listening services, and network activity using one of the fastest and most powerful networking diagnostic tools available on Linux.