本文共 435 字,大约阅读时间需要 1 分钟。
ubuntu固定IP地址编辑/etc/network/interfaces文件将:auto eth0iface eth0 inet dhcp改为:auto eth0iface eth0 inet staticaddress 你要设定的ip地址netmask 网关通过命令ifconfig可以查看到
gateway 掩码通过命令route -n可以查看到重新连线:$sudo /etc/init.d/networking restart上面的netmask和gateway用下面命令可以察知:查看掩码:$ifconfig查看网关:$route -n(destination Genmask都是0.0.0.0的那行当Gateway) 如果过一段时间的ip地址又变了,可能是interfaces被改变了你需要用下面的命令锁定/etc/network/interfaces$chattr +i /etc/network/interfaces转载地址:http://dhntb.baihongyu.com/