vi /etc/network/interfaces文件为如下内容
wq保存
重启网卡:sudo /etc/init.d/networking restart
ubuntu下自动获取ip设置
原文:http://www.cnblogs.com/hwd-cnblogs/p/4003579.html