今天刷了openwrt ,路由器可以上网,电脑却不行,这是为什么呢?

2013-06-18 18:40:25 +08:00
 ccbikai
使用pppoe 拨号,ssh登录路由器,ping baidu.com 8.8.8.8都可以ping通,但是电脑却不能上网(有线,无线都不行),大家觉得是什么问题呢?

电脑ping baidu.com 8.8.8.8 都不通,但是可以访问路由器管理界面
15789 次点击
所在节点    问与答
30 条回复
binux
2013-06-18 18:43:26 +08:00
防火墙
ccbikai
2013-06-18 18:51:12 +08:00
@binux 刚开始也觉得是他的问题,改了很多设置,还是不行。最后卸载防火墙了,也不行
binux
2013-06-18 18:57:17 +08:00
@ccbikai 我说的是openwrt里面的防火墙,还要靠它nat呢。。就这么给你卸载了。。
switch
2013-06-18 19:19:38 +08:00
在 openwrt 上 ping 外网的 IP 下,检查下 TTL 是否为 0,如果为 0,可以参考我写的备忘:

http://blog.mozcp.com/archives/551
ccbikai
2013-06-18 19:45:04 +08:00
@binux 看来我得恢复一下默认系统了,恢复完再检查下防火墙
cloverstd
2013-06-18 19:54:52 +08:00
重启下 OpenWrt 的防火墙就可以了吧
ccbikai
2013-06-18 22:25:57 +08:00
@binux 这是路由器ping的结果

这是电脑ping的


看来就是防火墙的问题了

这是防火墙的配置



麻烦帮我看看是哪里的问题


@switch 没有现在路由器,原来的系统可以正常用的
nanpuyue
2013-06-19 11:56:36 +08:00
这两张图片的信息量太少了,你把你的配置文件传上来看看吧,“系统”-“备份/升级”=“生成备份”,会得到一个压缩文件,不过这样里面会有你的上网帐号等信息,你可以修改压缩包里的文件,把帐号删除后再上传上来。
如果是pppoe认证的话,帐号信息在"/etc/config/network"这个文件里。
ccbikai
2013-06-19 12:29:08 +08:00
@nanpuyue http://pan.baidu.com/share/link?shareid=1834954497&uk=2617666054

管理密码是openwrt pppoe的密码有效期只有6个小时
momou
2013-06-19 12:31:29 +08:00
上次刚刷完也这样,直接重置,再设置比较容易解决问题
nanpuyue
2013-06-20 00:10:03 +08:00
@ccbikai 从你的配置文件来看貌似没有错误,不过我还是建议你重置一下路由器,点“系统”-“备份/升级”下的“执行复位”就可以了。
另外,好好检查下电脑的网络连接设置,你是不是给电脑设置了错误的ip,或者直接用其他设备测试网络。
当然,这些工作你可能都已经做过了,那么倒是有可能是上面@switch说的情况了。
总之我没有看出配置文件有什么问题,如果还是不行的话,可以考虑重新刷新一下固件。
这个问题还是有点匪夷所思啊,你再ping一下192.168.1.1看看?
nanpuyue
2013-06-20 00:15:52 +08:00
突然想到还有种情况,就是你的路由器也许还有上级路由,而且其ip也是192.168.1.1,也可能造成这种情况,所以呢,你可以尝试更改路由器的lan地址,比如改成192.168.2.1之类。
ccbikai
2013-06-20 07:31:12 +08:00
@nanpuyue 自己恢复过默认设置,然后设置还没好

在宿舍使用,楼道可能有路由器
ttl不等于0
ioiioi
2013-06-20 12:42:57 +08:00
openwrt的界面怎么变成这样了?我更新的12.01rc还是很阳春啊难道正式版好看了?
ccbikai
2013-06-20 18:06:10 +08:00
@nanpuyue 我把ip改为了192.168.2.1 还是不行
这是ping路由器的图


我用手机测试了,也不行。

我先从工厂包刷的,不能上网又刷了升级包

你方便把你的配置导出一份给我吗?

路由器是我才买的,sn码后边有个Ver 3.1 ,是不是他的硬件有了什么变化?
ccbikai
2013-06-20 19:05:09 +08:00
@nanpuyue 我恢复默认,然后设置联网 ping 百度

默认防火墙设置的是这样
tuteng
2013-06-20 20:43:00 +08:00
直接把路由器防火墙关了,
jasontse
2013-06-20 21:03:33 +08:00
@ccbikai iptables -t nat -nvL
ccbikai
2013-06-20 21:16:44 +08:00
@tuteng binux 说需要防火墙NAT转发
ccbikai
2013-06-20 21:36:54 +08:00
@jasontse

root@life:~# iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 1999 packets, 129K bytes)
pkts bytes target prot opt in out source destination
1999 129K prerouting_rule all -- * * 0.0.0.0/0 0.0.0.0/0
1936 123K zone_lan_prerouting all -- br-lan * 0.0.0.0/0 0.0.0.0/0

Chain INPUT (policy ACCEPT 995 packets, 63942 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 898 packets, 58649 bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 1655 packets, 88929 bytes)
pkts bytes target prot opt in out source destination
1655 88929 postrouting_rule all -- * * 0.0.0.0/0 0.0.0.0/0
758 30621 zone_lan_nat all -- * br-lan 0.0.0.0/0 0.0.0.0/0

Chain postrouting_rule (1 references)
pkts bytes target prot opt in out source destination

Chain prerouting_lan (1 references)
pkts bytes target prot opt in out source destination

Chain prerouting_rule (1 references)
pkts bytes target prot opt in out source destination

Chain prerouting_wan (1 references)
pkts bytes target prot opt in out source destination

Chain zone_lan_nat (1 references)
pkts bytes target prot opt in out source destination

Chain zone_lan_prerouting (1 references)
pkts bytes target prot opt in out source destination
1936 123K prerouting_lan all -- * * 0.0.0.0/0 0.0.0.0/0

Chain zone_wan_nat (0 references)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * * 0.0.0.0/0 0.0.0.0/0

Chain zone_wan_prerouting (0 references)
pkts bytes target prot opt in out source destination
0 0 prerouting_wan all -- * * 0.0.0.0/0 0.0.0.0/0
root@life:~#

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/72807

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX