赞
踩
银河麒麟服务器 linux 设置 固定IP地址
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto ens33
iface ens33 inet static
address 192.168.99.39
netmask 255.255.255.0
gateway 192.168.99.1
ifconfig
2、配置 DNS
root@Kylin:~# vi /etc/resolv.conf
添加如下几行:
nameserver 192.168.154.2
nameserver 218.85.152.99
nameserver 218.85.157.99
3、重启网络
root@Kylin:~# service networking restart
最好是 restart 整个系统,
service networking restart 之后,
ifconfig 得到的 还是 原来的ip,实际上已经 修改过来了。
所以,还是 reboot 比较保险。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。