- 论坛徽章:
- 1
|
作者: yichfot 出自: http://www.linuxdiyf.com
在安装ubuntu 8.04安装时忽略网卡的配置,安装成功后再通过命令行下进行设置的
配置ip地址,网关等的文件为/etc/network/interfaces,通过vi或nano打开修改,没有便添加新项
配置dns的文件为 /etc/resolv.conf
Ubuntu 网卡设置,ip,mask,gateway,dns
sudo vi /etc/network/interfaces
//这个应该是决定是否启用这个端口
auto eth0
//静态设置IP
iface eth0 inet static
address 192.168.0.250
netmask 255.255.255.0
#broadcast 192.168.0.255
gateway 192.168.0.1
//通过dhcp动态设置
iface eth0 inet dhcp
//设置DNS服务器
sudo vi /etc/resolv.conf //如果文件名不存在就新建该文件名,增加dns项
nameserver 202.98.0.68
nameserver 202.98.5.68
//修改网络设置后,重启,启用新设置
sudo /etc/init.d/networking restart
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_652701.html |
|