Network Configuration of CentOS 7 and host name and IP binding Problems
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
Vi ifcfg-eno16777736 # edit the configuration file and add to modify the following content
HWADDR = 00: 0C: 29: 8D: 24: 73
TYPE = Ethernet
BOOTPROTO = static # enable static IP addresses
DEFROUTE = yes
PEERDNS = yes
PEERROUTES = yes
20174_failure_fatal = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
Required 6_defroute = yes
IPV6_PEERDNS = yes
20176_peerroutes = yes
20176_failure_fatal = no
NAME = eno16777736
UUID = ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
ONBOOT = yes # enable network connection automatically
IPADDR0 = 192.168.21.128 # Set the IP address
PREFIXO0 = 24 # Set the subnet mask
GATEWAY0 = 192.168.21.2 # Set the Gateway
DNS1 = 8.8.8.8 # Set the primary DNS
DNS2 = 8.8.4.4 # Set backup DNS
: Wq! # Save and exit
Service network restart # restart the network
Ping www.bkjia.com # test whether the network is normal
Ip addr # view ip addresses
Set the host name to www
Hostname www # 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.1 localhost www # modify localhost. localdomain TO www
: Wq! # Save and exit
Shutdown-r now # restart the system