Ubuntu不能上网的解决方案

xiaoxiao2021-02-28  40

当DHCP服务器出问题的时候,不能自动分配ip,就需要手动设置静态ip。 1、vim /etc/network/interfaces 2、修改文件内容举例如下:(我的不叫eth0,是enp2s0,输入ifconfig看第一个) auto eth0 iface eth0 inet static address 192.168.0.124 netmask 255.255.255.0 gateway 192.168.0.1 broadcast 192.168.0.255 3、配置DNS解析器,vim /etc/reslov.conf,输入 nameserver 8.8.8.8 (8.8.8.8谷歌的DNS解析器,可能比较慢) nameserver 114.114.114.114 4、重启网络sudo /etc/init.d/networking restart

转载请注明原文地址: https://www.6miu.com/read-2623893.html

最新回复(0)