Ubuntu 静态IP

linux 用了好多年了,每次设置静态ip都上网查,就是记不住。唉~

cat /etc/network/interfaces

auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
    address 10.39.249.201
    netmask 255.255.255.0
    gateway 10.39.249.254

设置 DNS

cat /etc/resolvconf/resolv.conf.d/base 
nameserver 223.5.5.5
nameserver 223.6.6.6

sudo resolvconf -u # 生效
posted @ 2016-08-26 16:00  sammei  阅读(231)  评论(0编辑  收藏  举报