Linux sets static ip and windows can ping each other, after setting static ip, it cannot be connected to the Internet and the network service restart fails

1. The virtual machine linux sets a static ip and windows to ping each other and the problem of not being able to connect to the Internet after setting a static ip is a one-stop solution:

Reprint: https://www.codenong.com/cs105332412/

2. Encountered the problem of network service restart failure

insert image description here
Follow the prompts to check the status of the network service.
insert image description here
See this blog post https://www.cyberithub.com/failed-to-start-lsb-bring-up-down-networking/
. First of all, it may be because of your MAC address. In / Providing the correct MAC address in etc/sysconfig/network-scripts/ifcfg-ens33 and restarting network services should resolve this error.
Use the ip addr command to check your MAC address.
insert image description here
Add HWADDR=MAC address.
insert image description here
Restart the network service, but it still fails.
insert image description here
It says it may be a problem with NetworkManager.
Check the service status.
insert image description here
Temporarily stop the service.
insert image description here
You can see that it has stopped.
insert image description here
Restart the network service, but it still fails.
Check the configuration file
insert image description here
and add the other two Delete all
rm -f /etc/sysconfig/network-scripts/ifcfg-ens33.bak
insert image description here
to restart the service, success!
insert image description here

Guess you like

Origin blog.csdn.net/qq_45637894/article/details/130777731