LINUX安装好后无法访问网络

在虚拟机安装好新的LINUX系统后,ping www.baidu.com ,发现无法ping通。

键入ifconfig查询配置:

eno16777728: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  ether 00:0c:29:3e:ad:2d txqueuelen 1000 (Ethernet)

  RX packets 0 bytes 0 (0.0 B)

  RX errors 0 dropped 0 overruns 0 frame 0

  TX packets 0 bytes 0 (0.0 B)

  TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

  inet 127.0.0.1 netmask 255.0.0.0

   inet6 ::1 prefixlen 128 scopeid 0x10<host>

   loop txqueuelen 0 (Local Loopback)

   RX packets 942 bytes 79580 (77.7 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 942 bytes 79580 (77.7 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

得到本机的网卡是eno16777728

然后,重启网卡服务:service network restart

再次查询:ifconfig,发现依旧如上所示,并且无法访问网络。

修改网卡配置: root模式下vim /etc/sysconfig/network-scripts/ifcfg-eno16777728(最后的数字不一定一致,不要照搬,根据查询出来的配置信息灵活替换),然后将文件里最后一项的ONBOOT=no在插入模式中修改为yes并保存退出,以后计算机自动启动网卡。

现在手动启动网卡服务ifup eno16777736

重新键入ifconfig:

eno16777728: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  inet 192.168.81.134 netmask 255.255.255.0 broadcast 192.168.81.255

   inet6 fe80::20c:29ff:fe3e:ad2d prefixlen 64 scopeid 0x20<link>

   ether 00:0c:29:3e:ad:2d txqueuelen 1000 (Ethernet)

   RX packets 125 bytes 14963 (14.6 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 147 bytes 15265 (14.9 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

   inet 127.0.0.1 netmask 255.0.0.0

   inet6 ::1 prefixlen 128 scopeid 0x10<host>

   loop txqueuelen 0 (Local Loopback)

   RX packets 946 bytes 80000 (78.1 KiB)

   RX errors 0 dropped 0 overruns 0 frame 0

   TX packets 946 bytes 80000 (78.1 KiB)

   TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

问题解决,网卡服务成功启动,并且后续不需要每次都手动启动网卡服务

本文参照:http://114193107.blog.51cto.com/3025337/1676433

LINUX安装好后无法访问网络的更多相关文章

  1. Linux安装Tomcat外部不能访问

    Linux安装Tomcat后本地可以正常访问,可是这时Tomcat还不能被外界访问需要在Linux默认防护墙上打开8080端口 打开 /etc/sysconfig/iptables [root@loc ...

  2. linux安装mysql后root无法登录 sql 无法登录

    linux安装mysql后root无法登录 问题:[root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): ...

  3. linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

    我是小白,大佬勿喷 *** linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through ...

  4. linux安装tomcat后启动报错Cannot find ./catalina.sh的解决方法

    linux安装tomcat后启动报错: Cannot find ./catalina.shThe file is absent or does not have execute permissionT ...

  5. widows10 安装1803 版本后不能访问网络上的机器解决方法

    安装Windows10 1803 版本后,发现网络上的机器好多不见了. 使用 ping  可以ping 通,但是访问网络共享提示下面错误. 这个原因是1803 中没有安装 SMB1.0 协议.因为 S ...

  6. linux tomcat启动后无法访问

    先是按网上资料先下载安装包,然后上传到linux,启动后发现8080端口并未被占用.查了很多资料,不知道神马原因了.最后用yum安装后就可以访问了. 教程如下: 本教程介绍在CentOS 7服务器上使 ...

  7. linux安装vsftpd后无法登陆

    安装完成后在主机上登陆时,不管是输入用户,还是匿名都无法登陆 经过检查,发现是因为/etc/hosts.deny禁止了所有ip访问 将hosts.deny中的all:all删除,或者在/etc/hos ...

  8. 关于阿里云服务器Linux安装Tomcat后,外网不能访问解决方案

    这里需要提及三个方面的问题   第一个方面:Linux上启动防火墙的问题 当下比较流行的Linux镜像是CentOS,所以防火墙也随之变成了firewall,那么怎么操作这个防火墙呢?   #停止fi ...

  9. 安装docker后,VMware网络无法访问了,VMware重置网络设置

    1.vmware虚拟机处于关闭状态 2.vmware程序->edit(编辑)-->左下角 "Restore Default"恢复默认设置         [恢复]完成后 ...

随机推荐

  1. node Error: Could not locate the bindings file. Tried:解决

    问题描述: Error: Could not locate the bindings file. Tried: → C:\code\xxx\node_modules\deasync\build\dea ...

  2. [Environment Build] Win10下配置Apach Tomcat

    Download URL http://tomcat.apache.org/download-80.cgi Get Binary Distributions according to you PC c ...

  3. Spring-cloud微服务 Eureka学习教程-单服务器配置之快速搭建EurekaServer、EurekaClient(基础)

    以下实例代码下载地址:https://github.com/wades2/EurekaDemo Eureka是Spring Cloud Netflix的一个子模块,也是核心模块之一.用于云端服务发现, ...

  4. Thinkphp 出现 “_CACHE_WRITE_ERROR” 错误的可能解决办法

    有可能是老毛病: Cache文件夹和里面的文件,php没有权限 解决办法: chmod -R 777 /.............../www/Cache

  5. 刚刚写的一个lua下解释csv的工具。

    csvtool = {} function csvtool:csv2table(filename) if type(filename) ~= "string" or filenam ...

  6. python 不同目录间的模块调用

    有时候调用的模块不再同一个目录.直接import 是加载不进来的.默认的加载路径是sys.path中指定的路径.如果要指定加载的目录得需要把这个目录加到sys.path里面. 比如要加载父目录的同级目 ...

  7. 责任链模式(ChainOfResponsibiliby、Filter)

    Request 类: package com.demo; public class Request { private String requestStr; public String getRequ ...

  8. 1.jdk的安装

    1.下载jdk放到某(E)盘底下的(java)某文件夹里 2.配置环境变量 (1)配置JAVA_HOME,CLASSPATH,PATH三个变量 其中JAVA_HOME必须的 JAVA_HOME=E:\ ...

  9. session登录超时跳出iframe页至登录窗口

    //当我们用权限框架控制登录超时跳至某一个页面时主页面都没什么问题:iframe会在当前窗口下再开一个会话很显然这不是我们想要达到的效果 在登录页中加入此判断即可 $(function(){ //if ...

  10. 笨办法学Python(十四)

    习题 14:提示和传递 让我们使用 argv 和 raw_input 一起来向用户提一些特别的问题.下一节习题你会学习如何读写文件,这节练习是下节的基础.在这道习题里我们将用略微不同的方法使用 raw ...