vi /etc/sysconfig/network-scripts/ifcfg-ens33
IPADDR="192.168.10.130" PREFIX="24" GATEWAY="192.168.10.2" DNS1="192.168.10.2" DOMAIN="localdomain" IPV6_PRIVACY="no"
网关IP可在虚拟机网络编辑器中查看:
vi /etc/resolv.conf
# Generated by NetworkManager search localdomain nameserver 192.168.10.2
原文:https://www.cnblogs.com/lkc9/p/13221845.html