免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 9750 | 回复: 14
打印 上一主题 下一主题

route命令添加路由出现错误(急) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-17 07:33 |只看该作者 |倒序浏览
[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:04:61:AC:1E:9E
          inet addr:192.168.1.38  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::204:61ff:feac:1e9e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 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:524 (524.0 b)  TX bytes:0 (0.0 b)
          Interrupt:18 Base address:0x2000

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:71 errors:0 dropped:0 overruns:0 frame:0
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5099 (4.9 KiB)  TX bytes:5099 (4.9 KiB)

[root@localhost ~]#
________________________________________________________________________________
[root@localhost ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0

[root@localhost ~]#
(这个是我用ctrl+c强行结束的 ,等了半天没有反应)





找了点资料,还有和我已安装的虚拟机下的route返回结果相比较,看到route少了一条"default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0",
____________________________________

可是我尝试添加路由,用命令"route add default gw 192.168.1.1"时,不能成功,出现错误"SIOCADDRT 文件已存在",baidu,google了半天也没有找到解决的办法.. 望各位高手帮我解决,谢谢了..
PS:这个 问题搞了我好几天了..

论坛徽章:
0
2 [报告]
发表于 2006-06-17 10:18 |只看该作者

回复 1楼 heroooooo 的帖子

出现这个siocaddrt file exists, 表示你添加了一个已经存在的路有选项
SIOADDRT is an error message ADDing a RouTe.
SIODELRT is an error message DELeting a RouTe
SIOCADDRT: File exists
means:
You are adding a route that exists already.

论坛徽章:
0
3 [报告]
发表于 2006-06-17 11:49 |只看该作者
可是我现在上不了网啊..你说的这个问题该怎么解决呢??我在线等..

论坛徽章:
0
4 [报告]
发表于 2006-06-17 13:05 |只看该作者
route -n 貼一下 routing table 資訊。

==

论坛徽章:
0
5 [报告]
发表于 2006-06-17 13:25 |只看该作者
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
[root@localhost ~]#

论坛徽章:
0
6 [报告]
发表于 2006-06-17 15:59 |只看该作者
原帖由 heroooooo 于 2006-6-17 13:25 发表
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0


这不已经是默认路由了..

论坛徽章:
0
7 [报告]
发表于 2006-06-17 16:21 |只看该作者
那怎么还上不了网呢??

论坛徽章:
0
8 [报告]
发表于 2006-06-17 16:56 |只看该作者
原帖由 heroooooo 于 2006-6-17 16:21 发表
那怎么还上不了网呢??


1. arping 192.168.1.1 有回應嗎 ?

2. iptables-save 執行結果為何 ?

==

论坛徽章:
0
9 [报告]
发表于 2006-06-17 16:59 |只看该作者
service iptables stop (不知道你装的什么版本)

ping 一下网关,看通不通

随便ping一个网站,看地址能不能解析

linux dns设置, /etc/resolv.conf

[ 本帖最后由 skyy23 于 2006-6-17 17:02 编辑 ]

论坛徽章:
0
10 [报告]
发表于 2006-06-17 17:33 |只看该作者
原帖由 kenduest 于 2006-6-17 16:56 发表


1. arping 192.168.1.1 有回應嗎 ?

2. iptables-save 執行結果為何 ?

==


arping 192.168.1.1也没有会应.

iptables-save 没有结果显示出来.我用了service iptables stop
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP