Network Configuration of CentOS 7 and host name and IP binding Problems

Source: Internet
Author: User

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

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.