CentOS Linux release 7.3.1611 (Core) how to configure static IP addresses for CentOS 7, 7.3.1611centos
Problem:
On CentOS 7, I want to change one of my network interfaces from DHCP to static IP Address Configuration. How can I assign a static IP address to the network interfaces on CentOS or RHEL 7 permanently?
The following describes how to configure static IP addresses for network interfaces on CentOS 7. In this example, we will configure the network interfaces named enp0s3.
Do not use network management to configure static IP addresses
Go to the/etc/sysconfig/network-scripts directory and find the configuration file (ifcfg-enp0s3) for this interface ). If not, create one.
Open the configuration file and edit the following variables:
In, "NM_CONTROLLED = no" indicates that this interface will be set through this configuration file, instead of being managed through the network manager. "ONBOOT = yes" tells us that the interface will be enabled at startup.
Save the changes and run the following command to restart the network service:
This is OK !!
Verify that the interface is correctly configured:
Use Network Manager to configure static IP addresses
For details, refer to: how to configure static IP addresses for CentOS 7