After installing the centos 6.5 system with a CentOS-6.5-i386-LiveDVD.iso image (has written the system to the hard disk), it is found that the IP address will be restored after each restart, you can use ifconfig to view the eth0 NIC (or you may only have loopback Nic LO), so you can view the eth0 Nic configuration file, we found that there was no ifcfg-eth0 for this Nic configuration file in the/etc/sysconfig/network-scripts/directory.
Cause
Check the description in the official wiki:
The upstream Configuration Group has switched to NetworkManager, and the interface configuration will not be used (I understand the network ). The permission is calculated after the security program asks your website, website administrator, basic server guard, or other website administrators during the security process, please name this TV station and click "Search and configure ......」 . This page contains a set of network operators. Click here to change the NetworkManager. Please select the configuration of the website named system eth0 and modify it. If you select the "auto-Dynamic Route" option, the website administrator will be moved when the server is set up in the next day. You can also go through the NetworkManager (system, selection, and network bandwidth) after the security check is completed, or right-click the web page in the notification area for small display, select "invalid parameters ......」) To make this change.
If you do not need to use NetworkManager, you can view the configurations of the webpage interface (normally/Etc/sysconfig/network-scripts/ifcfg-eth0) AndOnboot = NoToOnboot = YesTo get the same response.
That is to say, centos6 uses the NetworkManager method to manage the network. You can run the following command to confirm:
chkconfig --list | grep -i netw
Result:
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:offnetwork 0:off 1:off 2:off 3:off 4:off 5:off 6:off
As you can see, NetworkManager is in the startup and network status.
The solution is to disable NetworkManager, manage the network in the traditional network mode, and add the ifcfg-eth0 file.
Repair procedure
1. Disable the NetworkManager service.
$ service NetworkManager stop
2. Disable NetworkManager startup
chkconfig NetworkManager off
3. Add the/etc/sysconfig/network-scriipts/ifcfg-eth0 File
DEVICE=eth0BOOTPROTO=staticIPADDR=146.175.139.13NETMASK=255.255.255.0GATEWAY=146.175.139.255HWADDR=00:25:90:81:5e:64NM_COnTROLLED=no ONBOOT=yesTYPE=EthernetIPV6INIT=no
Note: Modify the file content value based on actual conditions.
4. Start the network
chkconfig network on
5. enable the network service
service network start
To take effect.
Solution to the absence of ifcfg-eth0 profiles in centos