Linux Terminal Command: ip
The ip command is an essential tool in Network Utilities. In this tutorial, we will explore what ip does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The ip command is the standard network administration utility in Linux, replacing ifconfig and route.
Common Options & Syntax
ip [options] [arguments]
Here are the most common flags used with ip:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
ip addr show
What it does: Lists all active network interfaces and their IP addresses.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
sudo ip link set dev eth0 up && sudo ip route add default via 192.168.1.1
What it does: Enables the ’eth0’ network card and defines a new default gateway route.
⚙️ Warning & Common Pitfalls
[!WARNING] Configuring settings using the
ipcommand changes connections immediately, but they are lost on system reboot unless saved in network configurations.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out:
- ifconfig : Configure a network interface.