centOS7设置静态ip
编辑网络配置文件: vim /etc/sysconfig/network-scripts/ifcfg-ens33 ifcfg-ens33中配置如下: TYPE = "Ethernet" PROXY_METHOD = "none" BROWSER_ONLY = "no" BOOTPROTO = "static" #dhcp改为static 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" UUID = "6b518898-bea2-4d1a-ad9e-b5f82f17f73a" DEVICE = "ens33" ONBOOT = "yes" #开机启用本配置 IPV6_PRIVACY = "no" IPADDR = 192.168.1.7 #静态IP GATEWAY = 192.168.1.1 #默认网关 NETMASK = 255.255.255.0 #子网掩码 DNS1 = 192.168.1.1 #DNS 配置 修改完成后重启网络服务: service network