您的位置:首页 > 其它

Ubuntu配置静态ip

2016-01-03 21:31 375 查看
longhtml@ubuntu:~sudonano/etc/network/interfacesautoloifaceloinetloopbackautoeth0ifaceeth0inetstaticaddress192.168.1.251netmask255.255.255.0gateway192.168.1.254接下来添加DNSlonghtml@ubuntu: cat /etc/resolv.conf

longhtml@ubuntu:~sudonano/etc/resolv.confnameserver202.96.128.188//深圳电信nameserver202.96.134.133nameserver192.168.1.254(dns重启后会失效,需要改其它文件保证永久改变)longhtml@ubuntu: sudo /etc/init.d/networking restart

或者

longhtml@ubuntu:~sudoservicenetworkingrestart如果配置失败,可以使用手工配置方法:longhtml@ubuntu: sudo ifconfig eth0 192.168.1.251 netmask 255.255.255.0 up

longhtml@ubuntu:~$ sudo route add default gw 192.168.1.254 eth0

我的Ubuntu15.10通过修改interfaces配置静态ip不起作用(原因未知)。只能通过手工配置方法生效。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: