linux ping 127.0.0.1不通

大海方舟 2013-01-17 03:55:21
我想用2440板子上网,但是ping 127.0.0.1不通,ifconfig -a得到的信息如下:
[root@ACONBIO /]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:60:6E:00:F1:7D
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

[root@ACONBIO /]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
ping: sendto: Network is unreachable
板子上网卡和驱动都已安装,tcp/ip协议都应该是正常的,不知道这是为什么?
...全文
1212 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
baidu_20324365 2014-09-02
  • 打赏
  • 举报
回复
帅啊:


root@mysql:~# ifconfig lo 127.0.0.1 up
root@mysql:~#  ifconfig -a
eth0      Link encap:Ethernet  HWaddr ce:89:f4:b7:7f:31
          inet addr:192.168.168.153  Bcast:192.168.168.255  Mask:255.255.255.0
          inet6 addr: fe80::cc89:f4ff:feb7:7f31/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3019056 errors:0 dropped:0 overruns:0 frame:0
          TX packets:580162 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1946153890 (1.8 GiB)  TX bytes:26477802 (25.2 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:336 (336.0 B)  TX bytes:336 (336.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          BROADCAST POINTOPOINT NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@mysql:~# mysql -uroot -pf1zzb4ck -h127.0.0.1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.5.33-31.1 Percona Server (GPL), Release 31.1

Copyright (c) 2009-2013 Percona LLC and/or its affiliates
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye
root@mysql:~#


jiam157 2014-07-08
  • 打赏
  • 举报
回复
[root@ACONBIO /]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 Gateeay是0.0.0.0 那要加# route add default gw 192.168.4.1 (默认你的为4.1)
afei8856 2014-06-04
  • 打赏
  • 举报
回复
楼主解决了么?怎么解决的?
大海方舟 2013-01-18
  • 打赏
  • 举报
回复
现在设置好后能Ping通自己,但ping不通网关 [root@ACONBIO /etc]# ifconfig eth0 Link encap:Ethernet HWaddr 00:60:6E:00:F1:7D inet addr:192.168.4.11 Bcast:192.168.4.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:214 errors:0 dropped:0 overruns:0 frame:0 TX packets:214 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:21712 (21.2 KiB) TX bytes:21712 (21.2 KiB) [root@ACONBIO /etc]# ping 192.168.4.11 PING 192.168.4.11 (192.168.4.11): 56 data bytes 64 bytes from 192.168.4.11: seq=0 ttl=64 time=2.237 ms 64 bytes from 192.168.4.11: seq=1 ttl=64 time=1.296 ms ^C --- 192.168.4.11 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 1.296/1.766/2.237 ms [root@ACONBIO /etc]# ping 192.168.4.1 PING 192.168.4.1 (192.168.4.1): 56 data bytes ^C --- 192.168.4.1 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss [root@ACONBIO /etc]#
幽饮烛 2013-01-18
  • 打赏
  • 举报
回复
lo 的设备的 IP 不是 127.0.0.1,所以 ping 不通 ifconfig lo 127.0.0.1 up
大海方舟 2013-01-18
  • 打赏
  • 举报
回复
不存在127.0.0.1是什么意思?能不能说的清楚一点
RedWolf1999 2013-01-17
  • 打赏
  • 举报
回复
你的板子上不存在127.0.0.1这个IP当然不通。 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1063 errors:0 dropped:0 overruns:0 frame:0 TX packets:1063 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:105154 (105.1 KB) TX bytes:105154 (105.1 KB)
疯疯癫癫 2013-01-17
  • 打赏
  • 举报
回复
修改 /etc/network/interfaces 文件,加入 auto eth0 iface eth0 inet dhcp 修改后保存,这种方法是用DHCP自动分配IP 然后sudo /etc/init.d/networking restart 重启网络服务 感觉楼主的问题用我说的方法似乎不行,先试试
大海方舟 2013-01-17
  • 打赏
  • 举报
回复
设置ip后也是没有回应 [root@ACONBIO /]# ifconfig eth0 192.168.4.11 eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 [root@ACONBIO /]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 [root@ACONBIO /]# route: SIOCADDRT: File exists [root@ACONBIO /]# ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧