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

ip [OPTIONS] OBJECT COMMAND

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

ip link show

πŸ‘‰ Shows all network interfaces (like eth0, wlan0)


2️⃣ Display IP Addresses

ip addr show

πŸ‘‰ Shows IP address details of all interfaces


3️⃣ Display Specific Interface

ip addr show eth0

4️⃣ Enable a Network Interface

sudo ip link set eth0 up

5️⃣ Disable a Network Interface

sudo ip link set eth0 down

6️⃣ Assign IP Address

sudo ip addr add 192.168.1.10/24 dev eth0

7️⃣ Remove IP Address

sudo ip addr del 192.168.1.10/24 dev eth0

8️⃣ View Routing Table

ip route show

9️⃣ Add a Route

sudo ip route add default via 192.168.1.1

πŸ”Ÿ View ARP Table

ip neigh

πŸ–₯️ Sample Output

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> inet 192.168.1.5/24 brd 192.168.1.255 scope global eth0

πŸ” Output Interpretation

FieldMeaning
inet        IP address
/24        Subnet mask (CIDR notation)
brd        Broadcast address
UP        Interface is active
LOWER_UP        Physical link is active

πŸ“ Exercises for Students

  1. List all network interfaces using ip link.
  2. Display IP addresses using ip addr.
  3. Bring an interface down and up again.
  4. Assign a temporary IP and verify it.
  5. View and interpret the routing table.

❓ Viva Questions

  • What is the ip command?
  • Difference between ip and ifconfig?
  • What is CIDR notation?
  • What is a routing table?
  • What does UP and LOWER_UP indicate?

⚠️ 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

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Analysis of HTTP Protocol using Wireshark

Study and Use of ifconfig Command