CentOS Linux release 7.3.1611 (Core) how to configure static IP addresses for CentOS 7, 7.3.1611centos

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.