【问题描述】
修改成静态ip地址之后,重启ip又变成dhcp分配,执行 service network restart 又变成了静态的地址
【解决办法】
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
TYPE=Ethernet
NAME="System etho0"
BROADCAST=192.168.1.255
HWADDR=00:0C:29:3B:0C7
IPADDR=192.168.1.230
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
GATEWAY=192.168.1.1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
TYPE=Ethernet
NAME="System etho1"
BROADCAST=192.168.1.255
HWADDR=00:0C:29:3B:0C:E1
IPADDR=192.168.1.240
IPV6INIT=yes
IPV6_AUTOCONF=yes
NETMASK=255.255.255.0
NETWORK=192.168.1.1
ONBOOT=yes
vi /etc/resolv.conf
search localdomain
nameserver 202.98.96.68
nameserver 61.139.2.69
/etc/resolv.conf
配置重启后会变回来,又要再次添加
把NetworkManage服务彻底停止
/etc/rc.d/init.d/NetworkManager stop
chkconfig --level 35 NetworkManager off
chkconfig NetworkManage off
然后再改,重启
网友评论