IP configuration in CentOS7

Source: Internet
Author: User

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

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.