美文网首页
Ubuntu系统初始状态网络不通解决办法

Ubuntu系统初始状态网络不通解决办法

作者: 苏为 | 来源:发表于2017-10-26 19:59 被阅读26次

1.在虚拟机下面设置网络适配器为桥接模式(自动)

在编辑--->虚拟网络编辑器--->桥接模式.

2.在终端配置ip地址.

手动配置ip,gateway和dns

longhtml@ubuntu:~$sudo nano /etc/network/interfaces

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address 192.168.1.251

netmask 255.255.255.0

gateway 192.168.1.254

接下来添加DNS

longhtml@ubuntu:~$cat /etc/resolv.conf

longhtml@ubuntu:~$sudo nano /etc/resolv.conf

nameserver 202.96.128.188    //深圳电信

nameserver 202.96.134.133

nameserver 192.168.1.254

longhtml@ubuntu:~$sudo /etc/init.d/networking restart

或者

longhtml@ubuntu:~$sudo service networking restart

如果配置失败,可以使用手工配置方法:

longhtml@ubuntu:~$sudo ifconfig eth0 192.168.1.251 netmask 255.255.255.0 up

longhtml@ubuntu:~$sudo route add default gw 192.168.1.254 eth0

相关文章

网友评论

      本文标题:Ubuntu系统初始状态网络不通解决办法

      本文链接:https://www.haomeiwen.com/subject/wcttuxtx.html