问题

[root@web-1 yum.repos.d]# ping baidu.com
ping: unknown host baidu.com
[root@web-1 yum.repos.d]# ping 119.29.29.29
connect: Network is unreachable

看一下路由,发现没有网关

[root@web-1 yum.repos.d]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0

添加网关

[root@web-1 yum.repos.d]# route add default gw 172.16.0.1

好了

[root@web-1 yum.repos.d]# ping baidu.com
PING baidu.com (123.125.114.144) 56(84) bytes of data.
64 bytes from 123.125.114.144: icmp_seq=1 ttl=51 time=27.0 ms
[root@web-1 yum.repos.d]# ping 119.29.29.29
PING 119.29.29.29 (119.29.29.29) 56(84) bytes of data.
64 bytes from 119.29.29.29: icmp_seq=1 ttl=39 time=5.67 ms

然后发现,真正的原因在这里

DEVICE="eth0"
BOOTPROTO=static
HWADDR="00:0C:29:BB:0C:52"
IPADDR=172.16.0.114
NETMASK=255.255.254.0
GATEAY=172.16.0.1 #少写了一个字母W
IPV6INIT="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="f749f4ce-2496-4b43-8596-22144ee4a996"

参考链接:

http://blog.csdn.net/qingtingchen1987/article/details/7045068

http://happy-xp.blog.163.com/blog/static/23241702010622114140935/

ping: Network is unreachable的更多相关文章

  1. ping: sendto: Network is unreachable

    在我的板子上ping路由上的IP的时候可以ping通,但是ping外网的IP的时候提示"ping: sendto: Network is unreachable" 后来使用rout ...

  2. linux下ping命令出现ping: sendto: Network is unreachable

    问题:ping外网出现: sendto: Network is unreachable 查看: #route Route命令 : 在数据包没有有效传递的情况下,可以利用route命令查看路由表 [ro ...

  3. NAT 模式下虚拟机安装的centos7 ping主机显示connect: Network is unreachable

    在虚拟机下安装的centos7使用的网络是NAT模式,安装成功后ping主机地址显示 Network is unreachable 解决方案: 1)使用ifconfig命令查看网卡信息 2)进入/et ...

  4. linux 出现ping,错误提示:connect :network is unreachable

    今天克隆Centos7后  修改IP地址 修改前: IP:172.16.0.198   默认网关:172.16.0.254 修改后: IP:172.16.1.100  默认网关:172.16.0.25 ...

  5. ping: sendto: Network is unreachable【转】

    本文转载自:http://blog.sina.com.cn/s/blog_640531380102wmzb.html 在我的板子上ping路由上的IP的时候可以ping通,但是ping外网的IP的时候 ...

  6. linux上如何设置网络,出现connect: network is unreachable 的问题。

    发现有网友问有关ping命令出现connect: network is unreachable 的问题. 这通常是因为没正确设置ip地址. 解决方法: 在确保完善网卡驱动,以及确保将网卡驱动编译进内核 ...

  7. centos下问题:connect:network is unreachable

    问题描述 弄了三台机器准备搭建一个集群,按照centos7系统,一台主节点安装桌面环境,两台计算节点.配置计算节点的时候,发现ping不通,出现connect:network is unreachab ...

  8. ssh: connect to host gitlab.alpha.com port 22: Network is unreachable

    在这里只说明我遇到的问题和解决方法,可能并不能解决你遇到的问题: git clone git@gitlab.alpha.com:ipcam/ambarella.gitCloning into 'amb ...

  9. ubuntu下xx-net可用IP为0, ping6显示 Network is unreachable

    不知和xx-net有没有关系. 全新安装系统 sudo apt-get install miredo 这时, ping6 ipv6.google.com 是能ping通的 按github上依次安装py ...

随机推荐

  1. Visiual Studio之c++项目瘦身(删除中间项)

    欢迎指正 本文主要涉及 Visiual Studio(简称VS) 创建的c++项目 和 windows下批处理相关点. 1.中间项 A.VS创建的c++项目,生成后,会有许多中间项,包括项目生成的中间 ...

  2. 比赛难度(HDU4546)

    比赛难度 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submis ...

  3. Codeforces 872B:Maximum of Maximums of Minimums(思维)

    B. Maximum of Maximums of Minimums You are given an array a1, a2, ..., an consisting of n integers, ...

  4. Nginx 简单配置反向代理

    nginx 配置反向代理,转发请求到另一个域名 在server中加入 location /${alias} { proxy_buffer_size 128k; proxy_buffers 32 32k ...

  5. Chapter 6 Graphical Representation of Causal Effects

    目录 6.1 Causal diagrams 6.2 Causal diagrams and marginal independence 6.3 Causal diagrams and conditi ...

  6. oracle函数listagg使用

    作用 可以实现将多列记录聚合为一列记录,实现数据的压缩 语法结构 listagg(measure_expr,delimiter) within group ( order by order_by_cl ...

  7. RTD2171U替代方案|CS5266Typec转HDMI 4K60HZ转换芯片方案|CS5266芯片

    RTD2171U 是一款USB Type-C到HDMI转换器结合了USB Type-C输入接口和数字高清多媒体接口(HDMI)输出转换芯片.嵌入式微控制器基于工业标准8051内核.接收器端口将信道配置 ...

  8. Hive安装Version2.1.0

    Hive安装,基于版本2.1.0, 使用apache-hive-2.1.0-bin.tar.gz安装包. 1.安装规划 角色规划 IP/机器名 安装软件 运行进程 hive zdh-9 hive Ru ...

  9. Jenkins_创建任务以及定时启动(2)

    一.创建任务 1.点击New Item 2.输入用户,单击Freestyle project,点击OK 3.填写构建步骤,因为是安装在linux上的,所以我们选择Execute shell,随意输入一 ...

  10. AI系统——梯度累积算法

    明天博士论文要答辩了,只有一张12G二手卡,今晚通宵要搞定10个模型实验 挖槽,突然想出一个T9开天霹雳模型,加载不进去我那张12G的二手卡,感觉要错过今年上台Best Paper领奖   上面出现的 ...