bianbian

Ubuntu static ip address setting

2013.04.28

环境:Ubuntu 12.04.2 LTS

ip地址设置:

sudo vi /etc/network/interfaces

iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1

sudo service networking restart

dns设置

sudo vi /etc/resolvconf/resolv.conf.d/base

nameserver 10.12.5.2
nameserver 221.228.255.1

resolvconf -u

对下面两个文件的修改都会被覆盖,所以不要在这两个文件里面做修改。

/etc/resolv.conf
/etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

参考:

-EOF-
comments powered by Disqus