Close Menu
DPC Virtual Tips
    Read More

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Slurm Node Is DRAINED: How to Find the Exact Reason

    August 10, 2026

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    August 9, 2026
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Tuesday, August 11
    DPC Virtual Tips
    • Home
    • Operating Systems
    • PowerFlex
    • HPC
    • Virtualization
    • About the Author
    • About Us
    • Contact
    DPC Virtual Tips
    Home » Configuring CentOS 7 Network
    Operating Systems

    Configuring CentOS 7 Network

    DaniloBy DaniloNovember 17, 2022Updated:July 29, 2026No Comments3 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Configuring CentOS 7 Network
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Configuring CentOS 7 Network is a practical guide that explains how to configure network interfaces in a CentOS 7 system. This article covers the process of obtaining IP settings automatically through DHCP and configuring a static IP address manually.

    CentOS 7 uses predictable network interface names instead of the traditional eth0 naming convention found in older Linux distributions. Understanding these interface names is essential when modifying network configuration files and troubleshooting connectivity issues.

    In this tutorial, we will configure the network interface on a CentOS 7 virtual machine, showing how to identify the correct interface, edit network configuration files, restart network services, and verify IP, routing, and DNS settings.

    We have an article that explains how to install CentOS 7. Click HERE to see this article.

    Understanding the Interface Name Convention

    RHEL7 and downstream distributions such as CentOS 7 use systemd predictable network interface names by default instead of the traditional interface naming scheme which existed in Linux distributions since the earliest days of Linux, i.e. eth0, wlan0, etc.

    A predictable way of determining a network interface’s name was introduced in CentOS 6. However, it wasn’t until CentOS 7 was released that the feature was enabled by default.

    The predictable naming convention assigns a name to an interface based on a number of factors. For an ethernet card, the following are used: device type, bus, and slot.

    Some examples of device type:

    en = Ethernet
    sl = Serial Line IP (slip)
    wl = WLAN
    ww = SWAN

    In our lab, we can use the command “ip address show” to see all interfaces. We have both interfaces:
    lo = Loopback interface
    ens192 = LAN Network Interface

    Acquiring IP settings from DHCP

    By default, after the system installation, the network interface acquires IP settings from DHCP.
    We can confirm it on the file /etc/sysconfig/network-scripts/ifcfg-ens192.

    Important: In our lab, as the interface is “ens192”, the configuration file has the name “ens192” in the final of the filename.

    The instruction “BOOTPROTO=”dhcp” represents that the IP settings will get by DHCP:

    Below is the file content for reference:

    [root@CentOS-7-VM ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
    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=”ens192″
    UUID=”f1e23fa7-a268-4089-88a5-3c55702a3bc0″
    DEVICE=”ens192″
    ONBOOT=”yes”

    The service (daemon) responsible to manage the network settings is “network”. With the command “systemctl status network” it’s possible to see the service status.
    If you need to change something in the network interface file, this service should restart to apply the new configurations:

    To restart the “network” service, the commando “systemctl restart network” can be used:

    Note: To see the IP, Network Mask, and Route Table, use the commands below:

    ip address show
    ip route show

    Defining IP settings as Static

    With your preferred text editor, edit the file /etc/sysconfig/network-scripts/ifcfg-ens192. Adjust this file as shown in the picture below:

    Below is the file content for reference:

    [root@CentOS-7-VM ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
    TYPE=”Ethernet”
    PROXY_METHOD=”none”
    BROWSER_ONLY=”no”
    BOOTPROTO=”none”
    IPADDR=”192.168.200.100″
    PREFIX=24
    GATEWAY=”192.168.200.1″
    DNS1=”192.168.200.3″
    DNS2=”8.8.8.8″
    DNS3=”8.8.4.4″
    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=”ens192″
    UUID=”f1e23fa7-a268-4089-88a5-3c55702a3bc0″
    DEVICE=”ens192″
    ONBOOT=”yes”

    Restart the network file to apply the new configurations:

    All settings were changed with success:

    Also, the DNS servers were changed too:

    Note: ifconfig and netstat commands are not available by default. But, if you would like to use these commands, it’s possible to install them on CentOS 7. Install the package “net-tools” – it’s necessary to have Internet Access to install this package:

    yum install net-tools

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to install vCenter 8 in Lab Environment
    Next Article Applying a patch on the vCenter Server
    Danilo

    Infrastructure Engineer with experience in Virtualization, Linux, Windows Server and learning automation using Python. DPC Virtual Tips was created to share practical tutorials, lab experiences and troubleshooting guides focused on enterprise infrastructure technologies.

    Related Posts

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Linux Process Resource Usage: How to Find Heavy Processes

    August 6, 2026

    Linux ss, lsof, and fuser Commands: A Practical Guide

    August 4, 2026

    Comments are closed.

    Search
    Categories
    • HPC (10)
    • Operating Systems (83)
    • PowerFlex (22)
    • Virtualization (129)
    Read More
    Operating Systems

    How to Investigate TCP Retransmissions on Linux

    By DaniloAugust 11, 20260
    HPC

    Slurm Node Is DRAINED: How to Find the Exact Reason

    By DaniloAugust 10, 20260
    HPC

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    By DaniloAugust 9, 20260
    Operating Systems

    Linux Process Resource Usage: How to Find Heavy Processes

    By DaniloAugust 6, 20260
    HPC

    Lustre Filesystem Commands: A Practical Admin Guide

    By DaniloAugust 5, 20260
    Latest Posts

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Slurm Node Is DRAINED: How to Find the Exact Reason

    August 10, 2026

    Why Is My Slurm Job Pending? How to Decode Every Common Reason

    August 9, 2026
    Images from Gallery
    hpc main commands
    linux commands
    install rock linux
    lustre fs
    shell scripting
    vSAN Trace Files
    Categories
    • HPC
    • Operating Systems
    • PowerFlex
    • Virtualization
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Copyright © 2026, DPC Virtual Tips. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies to ensure your best experience on our website. If you continue using our website, we'll assume you agree to our cookie policy