After centos is installed in Enterprise Linux, the network connection service is disabled by default. You must manually start centos before using the network service. After centos 7.0 is installed, the network configuration file is in the/etc/sysconfig/network-scripts/directory. Enter the Directory and find the network configuration file: ifcfg-enp0s3 (the specific file name varies by hardware, in line with the ifcfg-en * Format), the configuration file default content is as follows:
| 12345678910111213141516 |
HWADDR=00:1C:22:AD:74:43TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noNAME=enp0s3UUID=ae0718e7-25s9-43ra-8hp9-9d4g20a88ib1ONBOOT=no |
Last ModificationONBOOT=noIsONBOOT=yesEnable the network service, save and quit.
Run the following command to restart the network service:
| 1 |
service network restart |
The network service is enabled and can be used properly. The ifconfig command is usually used to view network connection information. You may find that the newly installed centos 7.0 does not support the ifconfig command and the prompt "ifconfig command not found" is displayed ", in this case, an additional network toolkit needs to be installed. The command is as follows:
| 12 |
#yum upgrade#yum install net-tools |
After the installation is complete, you can use the ifconfig command to view IP addresses and other information.
From http://www.arcguin.com/archives/centos-7.0-start-network-service.html
Enable the network connection service in centos 7.0 (reprinted)