Linux 【连不上网】有线标识显示问号,可以访问内网,不能访问百度等外网

在内核升级后,Linux上不了网

##在上一篇blog里面解决了上网【内网】问题,后期发现仍然访问不了外网。

###首先查看网卡版本,系统安装的是8195显卡,然而电脑适配的是8168显卡,首先安装了8168网卡,重启电脑,仍然上不了网。

###在网上搜索教程,基本上就是配置网络参数,网络重启的操作。

ping 内网网关是可以的
ping www.baidu.com 不通
ping 8.8.8.8 不通
首先:

sudo vi /etc/resolv.conf

在里面添加:

nameserver 8.8.8.8

然后打开:

sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback

auto enp3s0
iface enp3s0 inet static
        address 114.212.225.177
        netmask 255.255.252.0
        gateway 114.212.224.1
#自动获得IP地址
#
auto enp3s0
iface enp3s0 inet dhcp

写完之后,重启一下

sudo /etc/init.d/networking restart

就这这步,报错了

Restarting network (via systemctl): Job for network.service failed because the control process exit

提示命令:systemctl status networking.service查看

 networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since 四 2019-08-29 15:42:17 CST; 1min 15s ago
     Docs: man:interfaces(5)
  Process: 13333 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCES
  Process: 13498 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 13494 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-
 Main PID: 13498 (code=exited, status=1/FAILURE)

: Starting Raise network interfaces...
: RTNETLINK answers: File exists
: Failed to bring up enp3s0.
: networking.service: Main process exited, code=exited, status=1/FAILUR
: Failed to start Raise network interfaces.
: networking.service: Unit entered failed state.
: networking.service: Failed with result 'exit-code'.

能看出来是网卡不对应。
直接命令:

ip addr flush dev enp3s0 && /etc/init.d/networking restart

ip addr flush dev ens33单独命令会断开远程连接

enp3s0是网卡名,根据自己的网卡更改名字。

参考的几个大佬的链接会附在下面:

1
2
3
4
5

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值