IP configuration in CentOS7
CentOS 7.0 is a very new version. Many friends do not know how to install and configure CentOS 7.0, because CentOS has greatly improved with previous versions.
Note: up to now, the latest version of CentOS 7.x is CentOS 7.0. The following describes the specific installation and configuration process of CentOS 7.0.
After the installation is completed today, I realized that centos does not have a visual interface.
Enter the logon page
Enter the root account and press Enter.
Enter the root password set above and press Enter.
System logon successful
Set IP address and gateway DNS
Note: After CentOS 7.0 is installed by default, network connections are not automatically enabled!
Cd/etc/sysconfig/network-scripts/# enter the network configuration file directory
Viifcfg-eno16777736 # edit the configuration file and add to modify the following content
HWADDR = 00: 0C: 29: 8D: 24: 73 TYPE = EthernetBOOTPROTO = static # enable static IP address DEFROUTE = yesPEERDNS = yesPEERROUTES = route = notes6init = yesIPV6_AUTOCONF = route = bandwidth = noNAME = eno16777736UUID = ae0965e7-22b9-45aa-8ec9-3f0a20a85d11ONBOOT = yes enable network connection IPADDR0 = 192.168.21.128 # set IP address PREFIXO0 = 24 # Set subnet mask GATEWAY0 = 192.168.21.2 # Set gateway DNS1 = 8.8.8.8 # Set primary dnsdns2. 4.4 # Set backup DNS: wq! # Save and exit servicenetworkrestart # restart the network pingwww.baidu.com # test whether the network is normal
Ip addr # view ip addresses
Set the host name to www
Hostnamewww # Set the host name to www
Vi/etc/hostname # edit the configuration file
Www # modify localhost. localdomain TO www
: Wq! # Save and exit
Vi/etc/hosts # edit the configuration file
127.0.0.1localhostwww # modify localhost. localdomain TO www
: Wq! # Save and exit
Shutdown-rnow # restart the system