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