Study of nmcli Command
Experiment
Study of
nmcli Command๐ฏ Aim
To configure and manage network connections using the nmcli command in Linux.
๐ Objective
By the end of this experiment, students will be able to:
- View network devices and connections
- Connect to wired and wireless networks
- Configure IP settings
- Manage network profiles using CLI
๐ Theory
The nmcli (Network Manager Command Line Interface) is used to:
- Control the NetworkManager service from the terminal
- Manage network connections (wired, Wi-Fi, VPN)
- Configure IP addresses, DNS, and gateways
๐ It is a modern and powerful alternative to manual configuration using ifconfig or ip.
๐ It works with:
- Devices (hardware interfaces)
- Connections (saved network profiles)
๐งพ Syntax
Common OBJECTS:
-
device→ Network interfaces -
connection→ Network profiles -
general→ NetworkManager status
๐งฐ Prerequisites
- Linux system with NetworkManager
- Root/sudo privileges for configuration
๐ฌ Procedure & Commands
1️⃣ Check NetworkManager Status
2️⃣ List Network Devices
3️⃣ Show All Connections
4️⃣ Display Device Details
5️⃣ Connect to a Wi-Fi Network
6️⃣ List Available Wi-Fi Networks
7️⃣ Bring Up a Connection
8️⃣ Bring Down a Connection
9️⃣ Add a New Connection (Static IP)
๐ Modify Connection Settings
๐ฅ️ Sample Output
๐ Output Interpretation
| Field | Meaning |
|---|---|
| DEVICE | Interface name |
| TYPE | Network type (ethernet/wifi) |
| STATE | Current status |
| CONNECTION | Active connection profile |
๐ Exercises for Students
- List all network devices and identify their status.
- Display saved network connections.
-
Connect to a Wi-Fi network using
nmcli. - Create a new connection with static IP.
- Bring a connection down and up again.
❓ Viva Questions
-
What is
nmcli? - Difference between device and connection?
- What is NetworkManager?
-
How does
nmclidiffer fromipcommand? -
Why is
nmcliuseful in servers?
⚠️ Precautions
- Requires root privileges for configuration
- Incorrect settings may disconnect network
- Ensure correct interface and connection names
✅ Result
The nmcli command is a powerful CLI tool for managing network configurations efficiently, especially in systems without a graphical interface.
Comments
Post a Comment