Solution to failure to access the Internet when Centos is installed on the machine to be installed

Source: Internet
Author: User
Tags nameserver

Solution to failure to access the Internet when Centos is installed on the machine to be installed

Centos is installed on a VMware Workstation Virtual Machine. When the system cannot access the Internet, we can use the following common configuration methods:

TYPE = Ethernet

DEVICE = eth0 # Virtual Network Interface Name
HWADDR = 00: 0C: 29: 60: FF: 8B # Nic mac address
ONBOOT = yes # activated when the system is started

NM_CONTROLLED = yes # takes effect immediately after modification.
BOOTPROTO = dhcp # Use the automatically assigned IP Address

Note: Select NAT for Virtual Machine network connection.

When we install Centos on the server, the production environment configuration is as follows:

Configure static IP addresses:

[Root @ sky9896 ~] # Cat/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0
BOOTPROTO = static
IPADDR = 117.40.239.12

NETMASK = 255.255.240.0
GAEWAY = 117.40.239.1
HWADDR = 00: 21: 97: 68: F2: 70
TYPE = Ethernet
UUID = 480c82ca-d673-466d-902a-9f31eaeb897c
ONBOOT = yes
NM_CONTROLLED = no

Set Gateway:

[Root @ sky9896 ~] # Cat/etc/sysconfig/network

NETWORKING = yes
HOSTNAME = sky9896
GATEWAY = 117.40.239.1

Set DNS

[Root @ sky9896 ~] # Cat/etc/resolv. conf

Nameserver 202.101.224.68
Nameserver 8.8.8.8

Related Article

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.