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