网卡显示eth0但是无法上网

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/bolvtin/article/details/52237877
sudo vim /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.16
netmask 255.255.255.0
#网关也可以没有
#gateway 192.168.0.254
sudo /etc/init.d/networking restart
或者
sudo service networking restart

如果配置失败,可以使用手工配置方法:
sudo ifconfig eth0 192.168.0.16 netmask 255.255.255.0 up
或者
sudo ifconfig eth0 192.168.0.16 up
#下面网关可以不用
sudo route add default gw 192.168.0.254 eth0


// 确认网卡驱动是否安装好
lspci | grep -i eth

//查看网卡网络信息
ifconfig -a


猜你喜欢

转载自blog.csdn.net/bolvtin/article/details/52237877