1. 程式人生 > >Centos 7 ip地址

Centos 7 ip地址

開機 add netmask gate 1=1 autoconf name uid 5.0

vim /etc/sysconfig/network-scripts/ifcfg-ens33
HWADDR="00:15:5D:07:F1:02"
TYPE="Ethernet"
BOOTPROTO="static" #dhcp改為static
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="bb3a302d-dc46-461a-881e-d46cafd0eb71"
ONBOOT="yes" #開機啟用本配置
IPADDR=192.168.7.106 #靜態IP
GATEWAY=192.168.7.1 #默認網關
NETMASK=255.255.255.0 #子網掩碼
DNS1=192.168.7.1 #DNS 配置

重新啟動網絡:service network restart

Centos 7 ip地址