The Linux environment of vmware15.5+centos8 cannot ping the external network, what should I do?

Step 1: Set static fixed ip: first change the bridge mode, then cd /etc/sysconfig/network-scripts/, use vi to edit: the object file name is: ifcfh-ens33
as follows: (If there is Chinese, it needs to be modified or the original is not would add)
the TYPE = Ethernet
PROXY_METHOD = none
BROWSER_ONLY = NO
BOOTPROTO = static # static IP enabled
DEFROUTE = yes
IPV4_FAILURE_FATAL = NO
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_FAILURE_FATAL = NO
IPV6_ADDR_GEN_MODE = stable-Privacy
NAME = ens33
ONBOOT = yes # Activate the network card when the system starts
IPADDR=192.168.31.50
#Your IP address DNS1=114.114.114.114 #Set DNS1
DNS2=8.8.8.8 #Set DNS2
NETMASK=255.255.255.0 #Set subnet mask
GATEWAY=192.168.31.1 #Set gateway
DEVICE=ens33 #Network card name

After that, save and exit.
Step 2:
There are two network card devices in centos8: ens33 and virbr0.
As you can see from your screenshot, you manually configured ens33, and the added content is correct, but there is actually no reason for activation (As for the firewall is turned off, the bridge mode has been completed. ) The
activation command is as follows:
nmcli d connect ens33 Enter (use root operation)
[root@localhost network-scripts]# nmcli d connect ens33
successfully used "ens3390a43bd6-1381-4348-b977-b5e7a12a44f8" to activate the device"".

Check: 1. ping w ww.iruance.com can be spelled through or, yum install lrzsz -y check is also OK

Guess you like

Origin blog.51cto.com/14404887/2604369