温故知新,ubuntu 11.10 server IP,mask,gateway,dns配置

来源:互联网 发布:unity3d怎么模拟场景 编辑:程序博客网 时间:2024/04/28 10:24

配置文件为: /etc/network/interfaces

默认为dhcp配置

auto eth0 iface eth0 inet dhcp 


手动设置ip,mask,gw

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

dns在 /etc/resolv.conf中,
添加 nameserver xxx.xxx.xxx.xxx

重启服务生效

/etc/init.d/networking restart