Before modification, first query your own subnet IP in NAT connection mode
登录***root***账户
进入终端
输入 cd /etc/sysconfig/network-scripts/
输入vim ifcfg-ens33
Modify BOOTPROTO=static (it does
not matter if you add "" after the equal sign) ONBOOT must be equal to yes, then change it.
Add the following information at the end. The
blue box is consistent with the subnet ip. The
green box is 2 unchanged. The
black box can be customized (note the rules)
Then press esc and enter: wq to exit.
If you can't change this file, please change it with root privileges
Enter the systemctl restart network configuration file in the terminal to take effect.