ip Command Examples in Linux¶
Introduction¶
These examples show practical ways to use ip on a Linux terminal. Each example is written so you can adapt it for administration or troubleshooting.
Example 1: Basic Usage¶
ip addr show
This is the simplest form of the command and is a good starting point before adding options.
Example 2: Common Admin Task¶
ip link show
This example reflects a common task on RHEL, Rocky Linux, AlmaLinux, or similar systems.
Example 3: Useful Option¶
ip route show
This option helps narrow the result, change behavior, or handle a more realistic target.
Example 4: Real-World Scenario¶
sudo ip addr add 192.0.2.10/24 dev eth0
Use this pattern when the task moves beyond a single basic command.
Example 5: Verification¶
ip -br addr
Example output:
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.0.2.10/24 fe80::1/64
Common Mistakes¶
- Expecting temporary
ipchanges to survive reboot. - Changing a remote interface without console or out-of-band access.
- Mixing up addresses, links, and routes when troubleshooting.
Quick Reference¶
ip addr show
ip link show
ip route show
sudo ip addr add 192.0.2.10/24 dev eth0
ip -br addr
Related Guides¶
Summary¶
Good ip usage means choosing the right option, keeping the target clear, and verifying the result with output you can explain.