Configure Linux networking with nmcli commands before you’re left troubleshooting outdated methods! Learn how to configure IP addresses, DNS, gateways, and more—fast and efficiently. Take control of your network the way seasoned sysadmins do! #centlinux #linux #networking
Table of Contents
What is Linux Networking?
Linux Networking refers to the suite of tools, protocols, and services that facilitate the connection and communication between Linux systems and other devices within a network. It involves configuring and managing network interfaces, setting up routing, ensuring security, and handling network-related services. Here are the key components and aspects of Linux Networking:
Key Components
- Network Interfaces: Physical (Ethernet, Wi-Fi) and virtual interfaces (loopback, VLAN, bridge).
- IP Addressing: Assigning IP addresses to network interfaces, including static and dynamic IP configuration using DHCP.
- Routing: Directing data packets between different networks and subnets using routing tables.
- DNS (Domain Name System): Resolving domain names to IP addresses.
- Firewall: Implementing security rules to control incoming and outgoing network traffic (e.g., using iptables or firewalld).
- Network Services: Configuring services like DHCP, DNS, NFS, and Samba for sharing files and resources.

Tools and Commands
- ifconfig/ip: For configuring network interfaces.
- nmcli: A command-line tool for managing NetworkManager, which provides a high-level interface for network configuration.
- route/ip route: For managing routing tables.
- iptables/nftables: For setting up and managing firewall rules.
- netstat/ss: For displaying network connections, routing tables, and interface statistics.
- ping: For checking connectivity to other devices.
- traceroute: For tracing the path packets take to reach a destination.
- dhclient: For obtaining an IP address via DHCP.
Network Configuration Files
- /etc/network/interfaces: Configuration file for network interfaces (used by ifupdown).
- /etc/sysconfig/network-scripts/: Directory containing network scripts for interface configuration (used by network service).
- /etc/hostname: File for setting the system’s hostname.
- /etc/hosts: Static hostname to IP address mappings.
- /etc/resolv.conf: DNS resolver configuration.
Network Services
- SSH (Secure Shell): For remote login and command execution.
- DHCP (Dynamic Host Configuration Protocol): For dynamic IP address assignment.
- DNS (Domain Name System): For resolving domain names to IP addresses.
- NFS (Network File System): For file sharing between Unix/Linux systems.
- Samba: For file and print sharing with Windows systems.
- HTTP/HTTPS: For web services.
- FTP/SFTP: For file transfer.
Common Tasks
- Configuring Static and Dynamic IP Addresses: Setting up network interfaces with static IP addresses or using DHCP for dynamic IP address assignment.
- Managing Network Connections: Using tools like NetworkManager for managing wired and wireless connections.
- Setting Up Firewalls: Implementing security measures to protect the system from unauthorized access.
- Troubleshooting Network Issues: Using diagnostic tools like ping, traceroute, netstat, and ss to diagnose and resolve network problems.
- Securing Remote Access: Configuring SSH for secure remote administration.
Linux Networking is an essential skill for system administrators, allowing them to ensure connectivity, security, and efficient data exchange within and across networks.
Recommended Training: Introduction to Computer Networking – Beginner Crash Course from Rick Crisci

What is nmcli?
nmcli
(NetworkManager Command Line Interface) is a command-line utility used to manage network connections on Linux systems. It interacts with the NetworkManager service to create, modify, and delete network connections, and provides detailed information about the network status and configuration. This utility is particularly useful for scripting and remote management, offering a powerful alternative to graphical network management tools.
Key Features of nmcli
- Connection Management: Create, modify, delete, and activate/deactivate network connections.
- Device Management: View and manage network devices, such as Ethernet and Wi-Fi interfaces.
- Network Status: Display detailed information about the network status, including IP addresses, routes, and connectivity.
- Scripting: Automate network configuration tasks through scripts.
- VPN Management: Create and manage VPN connections.
Summary
nmcli
is a versatile tool for network management on Linux systems, offering extensive capabilities for handling both simple and complex network configurations. It is an essential utility for system administrators and anyone who needs to manage Linux networks from the command line.
Problem Statement
In RHEL/CentOS 7, by default network has been managed by the Network Manager. And we know that graphical mode is not available on the server, therefore, configuring network on a newly installed Linux machine can be a difficult task, if we are not familiar with the Network Manager command-line utilities i.e. nmtui and nmcli.
We prefer to work from CLI, therefore we will use nmcli. However, you may use nmtui as well.
In this article, we will configure dynamic and static Linux network with nmcli command.
Read Also: How to Configure Linux IPv6 Networking
Charger for Lenovo Laptop Computer 65W 45W Round Tip Power Supply AC Adapter for Lenovo IdeaPad 330-14, 330-15, 330-17, 510-15, 330s-14, 330s-15 Lenovo Flex 6-14 Laptop Charger
$9.90 (as of June 21, 2025 19:12 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Check Status of Linux Network Devices and Connections
To check status of current devices.
nmcli device status
Output:
DEVICE TYPE STATE CONNECTION
eno16777728 ethernet connected eno16777728
eno33554968 ethernet disconnected --
lo loopback unmanaged --
To check status of current connections.
nmcli connection show
Output:
NAME UUID TYPE DEVICE
eno16777728 a5c248f9-1118-443e-a2bc-7b2de73afe72 802-3-ethernet eno16777728
To check complete details about a connection.
nmcli connection show eno16777728 | grep ipv4
Output:
ipv4.method: manual
ipv4.dns: 192.168.116.2
ipv4.dns-search:
ipv4.addresses: { ip = 192.168.116.11/24, gw = 192.168.116.2 }
ipv4.routes:
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
Configure Linux Network
Dynamic Network Configurations
Currently, the IPv4 address of the above system is set statically. To change it to dynamically obtain an IP address from available DHCP Server.
nmcli connection modify eno16777728 ipv4.method auto ipv4.addresses "" ipv4.dns ""
Restart connection to apply settings.
nmcli connection down eno16777728 ; nmcli connection up eno16777728
Check the settings now.
nmcli connection show eno16777728 | grep ipv4
Output:
ipv4.method: auto
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:
ipv4.routes:
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
Static Network Configurations
To configure a network connection statically, we can use the same nmcli command with different parameters.
nmcli connection modify eno16777728 ipv4.method manual ipv4.addresses "192.168.116.11/24 192.168.116.2" ipv4.dns 192.168.116.2
Restart connection to apply settings.
nmcli connection down eno16777728 ; nmcli connection up eno16777728
Check the settings now.
nmcli connection show eno16777728 | grep ipv4
Output:
ipv4.method: manual
ipv4.dns: 192.168.116.2
ipv4.dns-search:
ipv4.addresses: { ip = 192.168.116.11/24, gw = 192.168.116.2 }
ipv4.routes:
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
CompTIA Linux+ Study Guide: Exam XK0-005 (Sybex Study Guide)
$35.00 (as of June 21, 2025 19:51 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Final Thoughts
By learning how to configure Linux network settings using nmcli
, you’ve gained a powerful, scriptable way to manage connections without relying on GUI tools or manual config files. Whether you’re setting static IPs, managing DNS, or activating interfaces, nmcli
puts full control at your fingertips. Don’t get stuck when network issues strike—be the one who solves them with speed and confidence. Thousands of Linux pros already depend on nmcli
—it’s time you joined them!
Need expert AWS and Linux system administration? From cloud architecture to server optimization, I provide reliable and efficient solutions tailored to your needs. Hire me on Fiverr today!
Thank you for reading, and happy networking!
Leave a Reply
You must be logged in to post a comment.