CentOS6.7 configuration static address can not find IP and can not connect to the Internet a series of problem solutions summary

As a junior, I learned how to build a hadoop environment last week.​​​​​ I feel that the most difficult to deal with is the first step in setting up the environment to change the dynamic IP to the static IP. Not only I encountered these problems, but my friends in the studio also encountered these similar problems. These are some methods that I have summarized based on the problem research, and I hope to help you.

My virtual machine is VMware and the system is CenOS6.7


Problem description: The IP address cannot be found after ifconfig is changed from dynamic to static

 

一般配置完静态ip可能会出现这种问题


Cause Analysis:

Initially, the virtual machine will dynamically assign an IP to you. After modification, the starting IP of the DHCP service may be higher than the static IP set.

In addition, the gateway and network card may be easily mismatched during modification.


solution:

Mainly self-verification

The configured static IP must be in the same network segment. For example, the DHCP subnet is 192.168.30.0. The static IP after the first three segments must be consistent with it.

The configured subnet masks should be consistent.

Can enter eth0 to modify

The gateway can be checked when the ip is dynamically allocated to the Internet

ip route show

 

And DNS

nslookup local dynamic allocation of ip address

Modify the network card and DNS according to the network distribution

The other is the problem that the virtual machine cannot connect to the Internet after cloning

After cloning the virtual machine, eth0 becomes eth1 and needs to be modified to eth0, because the content of eth0 remains unchanged, but the physical address has changed, so the physical address needs to be modified again.

Modify eth0 according to the corresponding MAC address

 

Guess you like

Origin blog.csdn.net/master_hunter/article/details/108606046