Solve the problem centos 7 can not configure a static IP Internet
Internet has recently been used in learning Linux NAT mode, but after each restart ens33 in the IP will disappear or directly changed, so would like to configure a static IP.
The Internet to find a lot of information after configuring IP network still can not ping, only recently found out that the difference between virtual machines in bridge mode and NAT mode caused, so the next time I recorded a learning experience.
This article seniors to say the difference between the two modes in great detail, I will direct recording method to solve it.
Change the network link in the virtual machine settings to bridge mode, check the physical network connection state replication
Virtual Network Editor to restore the default settings, do not restore normal settings, like auto bridge
Host run → cmd → ipconfig / all, view the IP address, subnet mask, gateway
Enter linux vim / etc / sysconfig / network- scripts / ifcfg-ens33 ( this last document as the case may be, may ls to look at on a folder)
change = BOOTPROTO "static"
ONBOOT = "yes" if you net mode can be networked, this should already be a yes
to add the IP subnet mask, gateway
IP and host of the top three same
subnet mask and gateway same as host
Upon completion: wq save and exit, restart the network input systemctl retart network.service
Enter ifconfig or ip ip addr confirm successful configuration
Baidu attempt at ping, success!