Study of ip Command
Experiment
Study of
ip Commandπ― Aim
To learn and use the ip command for configuring and managing network interfaces in Linux.
π Objective
By the end of this experiment, students will be able to:
- Display network interfaces and IP addresses
- Configure IP addresses
- Enable/disable interfaces
- View routing tables
-
Replace legacy commands like
ifconfig
π Theory
The ip command is a modern networking utility from the iproute2 package.
π It replaces older tools like:
-
ifconfig -
route -
arp
π It is used for:
- Interface configuration
- IP address management
- Routing
- Network diagnostics
π§Ύ Syntax
Common OBJECTS:
-
addr→ IP addresses -
link→ Network interfaces -
route→ Routing table -
neigh→ ARP table
π§° Prerequisites
- Linux system
- Root/sudo privileges (for configuration tasks)
π¬ Procedure & Commands
1️⃣ Display All Interfaces
π Shows all network interfaces (like eth0, wlan0)
2️⃣ Display IP Addresses
π Shows IP address details of all interfaces
3️⃣ Display Specific Interface
4️⃣ Enable a Network Interface
5️⃣ Disable a Network Interface
6️⃣ Assign IP Address
7️⃣ Remove IP Address
8️⃣ View Routing Table
9️⃣ Add a Route
π View ARP Table
π₯️ Sample Output
π Output Interpretation
| Field | Meaning |
|---|---|
| inet | IP address |
| /24 | Subnet mask (CIDR notation) |
| brd | Broadcast address |
| UP | Interface is active |
| LOWER_UP | Physical link is active |
π Exercises for Students
-
List all network interfaces using
ip link. -
Display IP addresses using
ip addr. - Bring an interface down and up again.
- Assign a temporary IP and verify it.
- View and interpret the routing table.
❓ Viva Questions
-
What is the
ipcommand? -
Difference between
ipandifconfig? - What is CIDR notation?
- What is a routing table?
-
What does
UPandLOWER_UPindicate?
⚠️ Precautions
- Requires root privileges for changes
- Incorrect IP configuration may disrupt connectivity
- Use temporary configurations for lab practice
✅ Result
The ip command is a powerful and modern utility for managing Linux networking, offering more flexibility and control compared to older tools.
Comments
Post a Comment