ip
Overview
The ip
command shows and manipulates routing, devices, policy routing, and tunnels. It’s a powerful tool for configuring network interfaces and routing.
Syntax
ip [options] OBJECT {COMMAND | help}
Common Objects
Object | Description |
---|---|
link |
Network devices |
address |
Protocol addresses |
route |
Routing table entries |
neigh |
ARP or NDISC cache |
tunnel |
Tunnel over IP |
maddr |
Multicast addresses |
rule |
Routing policy |
netns |
Network namespaces |
Common Options
Option | Description |
---|---|
-4 |
IPv4 only |
-6 |
IPv6 only |
-s |
Statistics |
-d |
Details |
-h |
Human readable |
-br |
Brief output |
-c |
Color output |
-o |
Output format |
Key Use Cases
- Network configuration
- Interface management
- Routing setup
- Address assignment
- Network troubleshooting
Examples with Explanations
Example 1: Show Interfaces
ip link show
Display network interfaces
Example 2: IP Addresses
ip addr show
Show IP addresses
Example 3: Routing Table
ip route show
Display routing table
Common Commands
Link operations:
ip link set dev eth0 up ip link set dev eth0 down
Address management:
ip addr add 192.168.1.10/24 dev eth0 ip addr del 192.168.1.10/24 dev eth0
Route management:
ip route add default via 192.168.1.1 ip route del default
Performance Analysis
- Interface statistics
- Routing efficiency
- Address configuration
- Network namespace impact
- Protocol overhead
Additional Resources
Best Practices
- Document changes
- Backup configurations
- Test changes
- Monitor impact
- Security awareness
Troubleshooting
- Interface status
- Address conflicts
- Routing issues
- DNS problems
- Network connectivity
Advanced Features
- Network namespaces
- Policy routing
- Tunneling
- VLANs
- Multicast