Linux ip Command — Managing and Troubleshooting Network Configuration¶
The
ipcommand 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 theipcommand.
Learning Path¶
Course Progress
What You'll Learn¶
After completing this lesson, you'll be able to:
- Understand the
ipcommand - 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:
The first tool every Linux engineer uses is:
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:
package.
It manages:
- Network Interfaces
- IP Addresses
- Routes
- Neighbor Tables
- Tunnels
- VLANs
- Network Namespaces
Why Replace ifconfig?¶
Older Linux systems used:
Modern Linux uses:
Advantages:
- Unified Tool
- IPv4 & IPv6 Support
- More Features
- Better Performance
- Active Development
Basic Syntax¶
Examples:
Display Interfaces¶
Show all network interfaces.
Example output:
Display IP Addresses¶
Shortcut:
Example:
Display IPv4 Only¶
Display IPv6 Only¶
Show Specific Interface¶
or
Bring Interface Up¶
Bring Interface Down¶
Assign IP Address¶
Remove IP Address¶
Display Routing Table¶
Shortcut:
Example:
Add Default Route¶
Delete Default Route¶
Add Static Route¶
Delete Static Route¶
Neighbor Table¶
Display ARP/Neighbor entries.
Example:
Flush Neighbor Cache¶
Interface Statistics¶
Displays:
- RX Packets
- TX Packets
- Errors
- Dropped Packets
Monitor Network Changes¶
Displays changes in real time.
Useful for:
- Interface State Changes
- Address Changes
- Route Updates
Display Routing Rules¶
Useful for:
- Policy-Based Routing
- Multiple Routing Tables
Display Routing Tables¶
Create VLAN Interface¶
Example:
Bring it up.
Assign an address.
Network Namespaces¶
List namespaces.
Create namespace.
Delete namespace.
Run command inside namespace.
Network namespaces will be covered in detail later in this module.
Tunnel Interfaces¶
Display tunnel interfaces.
Examples include:
- GRE
- SIT
- IPIP
Enterprise Example¶
Production server:
Troubleshooting steps:
Cloud Perspective¶
Cloud engineers frequently use:
to verify:
- Private IP
- Secondary IPs
- IPv6 Address
Use:
to troubleshoot:
- Cloud Routing
- VPN
- Network Address Translation (NAT)
- Load Balancer Issues
Kubernetes Perspective¶
On Kubernetes nodes:
shows:
- Pod Interfaces
- Container Network Interface (CNI) Interfaces
- Bridge Interfaces
Example:
Routes can be inspected using:
Linux Networking Workflow¶
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.
Task 2¶
Display IP addresses.
Task 3¶
Display routing table.
Task 4¶
Display neighbor table.
Task 5¶
Display interface statistics.
Task 6¶
Create a temporary IP address.
Verify:
Remove it:
Task 7¶
Create a network namespace.
Verify:
Delete it:
Task 8¶
Create a troubleshooting checklist using:
ip addrip linkip routeip neighpingtraceroute
Common Troubleshooting Workflow¶
When a Linux server has no network connectivity:
Step 1
Interface up?
↓
Step 2
IP assigned?
↓
Step 3
Default gateway exists?
↓
Step 4
Gateway reachable?
↓
Step 5
↓
Step 6
↓
Step 7
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
ipinstead 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¶
- What is the
ipcommand? - How do you display IP addresses?
- How do you display the routing table?
- How do you bring an interface up?
Intermediate¶
- Explain the difference between
ip addrandip link. - How do you add a static route?
- What is the Neighbor table?
- What are Network Namespaces?
Architect Level¶
- Explain how you would troubleshoot a Linux server with no network connectivity using the
ipcommand. - Design a Linux networking troubleshooting workflow.
- Explain how the
ipcommand is used in Kubernetes and cloud networking.
Summary¶
In this lesson, you learned:
- The
ipcommand - 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¶
ipis the modern replacement forifconfig,route, andarp.- Use
ip addrto view and manage IP addresses. - Use
ip linkto manage network interfaces. - Use
ip routeto inspect and configure routing. - Use
ip neighto view ARP and Neighbor Discovery information. - Network namespaces provide isolated networking environments.
- The
ipcommand is one of the first tools used for Linux network troubleshooting.
What's Next?¶
In the next lesson, you'll learn about ss (Socket Statistics).
You'll explore:
- What
ssis - 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.