博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

linux 添加静态ip dns

Posted on 2016-10-28 14:26  红与黑hyh  阅读(154)  评论(0编辑  收藏  举报
/etc/network 下:interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.111
netmask 255.255.255.0
gateway 192.168.1.1

 

/etc/ 下:resolv.conf
nameserver 8.8.8.8

配置好后,/etc/init.d/networking restart 网卡重启即可!