问题

[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. C语言获取字符年月日时分秒毫秒

    概述 本文演示环境: Windows10 使用C语言获取年月日时分秒毫秒, 代码 #include <iostream> #include <string> #include ...

  2. C++代码优化之nim_duilib控件关联

    前言 使用nim_duilib关联控件,优化后.的确减少了代码量,那么,执行效率呢? 时间执行的长短与硬件.软件有关,以下内容仅为参考. 测试代码 下面的代码,分为两部分, 循环使用for,非循环则直 ...

  3. 【LeetCode】1413. 逐步求和得到正数的最小值 Minimum Value to Get Positive Step by Step Sum

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 求和 日期 题目地址:https://leetcode ...

  4. 【LeetCode】616. Add Bold Tag in String 解题报告(C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcode ...

  5. 【LeetCode】143. Reorder List 解题报告(Python)

    [LeetCode]143. Reorder List 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://f ...

  6. Description has only two Sentences(hdu3307)

    Description has only two Sentences Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/327 ...

  7. FAT

    目录 概 主要内容 代码 Zhang J., Xu X., Han B., Niu G., Cui L., Sugiyama M., Kankanhalli M. Attacks which do n ...

  8. Augmentation For GAN

    目录 概 主要内容 Differentiable Augmentation Adaptive Augmentation 代码 Zhao S., Liu Z., Lin J., Zhu J. and H ...

  9. 生成器执行函数co 源码解读

    本文所选内容均来自[co模块源码] /** * slice() reference. */ var slice = Array.prototype.slice; module.exports = co ...

  10. MySQL基础操作指南

    启动停止MySQL服务 1.Windows服务窗口启动:开始 → 运行 → services.msc → 找到MySQL 56服务 2.MySQL命令启动:开始 → 运行 → 管理员权限运行cmd → ...