Ubuntu配置静态ip

来源:互联网 发布:linux nfsnobody 编辑:程序博客网 时间:2024/04/29 20:04

longhtml@ubuntu:~sudonano/etc/network/interfacesautoloifaceloinetloopbackautoeth0ifaceeth0inetstaticaddress192.168.1.251netmask255.255.255.0gateway192.168.1.254DNSlonghtml@ubuntu:  cat /etc/resolv.conf
longhtml@ubuntu:~sudonano/etc/resolv.confnameserver202.96.128.188//nameserver202.96.134.133nameserver192.168.1.254dnslonghtml@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不起作用(原因未知)。只能通过手工配置方法生效。

0 0
原创粉丝点击