Master CentOS 7 Network Configuration: nmcli, nmtui, and Custom Interface Names
This guide walks through CentOS 7 network setup, explaining interface naming conventions, using NetworkManager tools like nmcli and nmtui, editing configuration files, renaming interfaces, adjusting kernel parameters, and applying changes to achieve reliable connectivity.
1 Network Configuration
CentOS 7 network interface names follow these patterns: Ethernet interfaces start with en, WLAN with wl, WWAN with ww. The next character indicates adapter type (o = on‑board, s = hot‑plug slot, p = PCI). An optional x can merge MAC addresses, and a trailing number serves as the index or port. If the naming scheme is unclear, the traditional ethN format may be used.
NetworkManager
NetworkManager is a dynamic network controller that keeps devices and connections active when hardware is available. Multiple connections can be attached to a device, but only one can be active at a time. It is installed and enabled by default on CentOS/RHEL 7.
Key commands:
# systemctl status NetworkManager # check NetworkManager status
# systemctl status network # check legacy network service statusnmcli basics
List all devices:
# nmcli device
DEVICE TYPE STATE CONNECTION
virbr0 bridge unmanaged --
ens33 ethernet unmanaged --
lo loopback unmanaged --
virbr0-nic tun unmanaged --Show detailed device information: # nmcli device show List all connections:
# nmcli connection
NAME UUID TYPE DEVICE
ens33 5ae89fd0-897c-40cc-bdfa-fd716dd6fcc5 ethernet --Add a new connection (replace parameters as needed):
# nmcli connection add con-name ens33-siso autoconnect yes ifname ens33 type ethernetActivate a connection: # nmcli connection up ens33-siso Delete a connection:
# nmcli connection delete ens33-sisoEditing configuration files
Modify the interface file directly (example for ens33):
# vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="5ae89fd0-897c-40cc-bdfa-fd716dd6fcc5"
DEVICE="ens33"
ONBOOT="yes"
# (static example) IPADDR="192.168.30.101"
# NETMASK="255.255.255.0"
# GATEWAY="192.168.30.2"
# DNS1="114.144.144.144"Reload connections and restart the network service to apply changes:
# nmcli connection reload
# nmcli connection down ens33
# systemctl restart networkText and graphical tools
Use the text UI: # nmtui Or the graphical editor:
# nm-connection-editorHostname configuration
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=master
# hostname master # apply new hostname9.2 Rename Interface to eth0
Rename the interface configuration file:
# cd /etc/sysconfig/network-scripts
# mv ifcfg-ens33 ifcfg-eth0
# vi ifcfg-eth0
TYPE="Ethernet"
... (same parameters as above) ...
NAME="eth0"
DEVICE="eth0"Add kernel parameter for predictable naming
# vi /etc/sysconfig/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
net.ifname="0" # add this line
GRUB_DISABLE_RECOVERY="true"Rebuild the GRUB configuration and reboot for the changes to take effect.
9.3 Chapter Summary
This chapter covered Linux network configuration on CentOS, showing the location of key interface files, how to view and modify network settings with both command‑line and GUI tools, and how to rename network interfaces.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
