Can't connect to the Internet after Linux fixes the IP address? The client cannot obtain DHCP?

Fixed IP

  • Temporary fix
ifconfig ens33 192.168.113.10 netmask 255.255.255.0
  • Permanently fixed

vim /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
BOOTPROTO=static //改为static静态IP
NAME=ens33
DEVICE=ens33
ONBOOT=yes

//添加以下字段:
IPADDR=192.168.113.10    //固定IP
NETMASK=255.255.255.0    //子网掩码
GATEWAY=192.168.113.2    //网关
DNS1=8.8.8.8             //DNS

VMware network card settings

Turn off the local DHCP service

Insert picture description here

Change the local network adapter

Set your own IP address, subnet mask, gateway, DNS
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_55259539/article/details/114266837