ubuntu 网卡设置,ip,mask,gateway,dns
sudo gedit /etc/network/interfaces
这个应该是决定是否启用这个端口
auto eth0
静态设置IP
iface eth0 inet static
address 172.16.146.200 netmask 255.255.255.0 broadcast 172.16.146.255
gateway 172.16.146.254
通过dhcp动态设置
iface eth0 inet dhcp
设置DNS服务器
sudo vi /etc/resolv.conf
nameserver 202.96.128.68 nameserver 61.144.56.101 nameserver
192.168.8.220
重新设置网络,以启用新设置
sudo /etc/init.d/networking restart
修改网络配置:
sudo gedit /etc/network/interfaces
加上
auto eth0
iface eth0 inet static
address 172.18.128.28
gateway 172.18.128.25
netmask 255.255.255.192
重启网络设备:
sudo /etc/init.d/network-manager restart