Ubuntu 联网 eht0没有问题

查了好多文章终于ubuntu联网了。总结如下

对于Ubuntu无法连接互联网问题总结:

首先 察看网卡:sudo ifconfig -a

如果显示的网卡不是eth0, 是其他的ethx。

sudo nano /etc/network/interfaces

auto ethx

iface ethx inet dhcp

auto ethy

iface ethy inet static

address 172.18.216.112
netmask 255.255.255.0
gateway 172.18.216.1

这样就配置了两个网卡, 一个自动获取ip地址(dhcp),一个是静态ip

之后

sudo /etc/init.d/networking restart


打开,关闭网卡

sudo ifconfig ethx up

sudo ifconfig ethx down


补充:如果在虚拟机下使用, 需要在vitualbox 或者vmware 中配置两个网卡, 一个自动ip上网 ,一个和host 连接登陆传文件。


猜你喜欢

转载自blog.csdn.net/shenyeaxu/article/details/78090060