CentOS How to set IP address, LINUX How to modify IP address __linux

Source: Internet
Author: User

Today came into contact with a new task to modify the Linux IP address. Using the wave of the server, operating system for CentOS7.

(a) In order to enable the IP address to be permanently effective. First enter the edit vi/etc/sysconfig/network-scripts/ifcfg-enp4s0f0 file.

(ii) A description of the following document:

DEVICE=ENP4S0F0 network card corresponding to the device alias, such as IFCFG-ENP4S0F0 first network card

Bootproto's Chinese translation is the boot source, representing the way that the network card obtains the IP address, the DHCP (dynamic Host Configuration Protocol) represents the dynamically generated IP address by the DHCP server, static indicates that the IP address is static IP.

BROADCAST=192.168.0.255 Subnet Broadcast Address

Hwaddr=00:50:56:8e:47:ee Network card Physical Address

ipaddr=12.168.1.117 Network card IP address

Ipv6init=no whether to enable Ipv6ipv6_autoconf=no

netmask=255.255.255.0 NIC corresponding to the network mask

The network address of the NETWORK=192.168.1.0 network card

Onboot=yes This network interface is set when the system is started, and when set to Yes, the device is activated when the system is started. The default setting is yes.

As for the following type and UUID this is not necessary, this type of network card.

(iii) using the VI editor, insert by inserting key, enter edit mode.

(d) 3. Move the cursor to the IPADDR Settings section and change to the IP address you want to set, as in this case, to 1.118. Press the ESC key. Enter Colon: Wq save exit will prompt "/etc/sysconfig/network-scripts/ifcfg-enp4s0f0" 14L, 302C Writte

(five) After setting up, restart the network services, the following Figure 2 commands can service network restart

(vi) In the second view of your IP address, you will find that has changed.

PS: On many older servers, the device name is generally eth0, and now many new machines are no longer named in this way, for example, the device name for this article is enp4s0f0.

Related Article

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.