[搜索无果,不懂就问] 刷了 openwrt 之后连不上网

2016-08-03 22:14:33 +08:00
 hhp
手里有个闲置的路由,刚刷了 openwrt ,想在公司随便用用
但是配置后有线接公司内网插口,电脑连 wifi ,根本上不了网,查了半天也一头雾水,只能来求教了。。。

根据官网和网上各种教程,配置如下
到底是哪里不对啊。。。。。。

/etc/config/dhcp

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option localservice '1'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'server'
option ra 'server'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'



/etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix ''

config interface 'lan'
option type 'bridge'
# option ifname 'eth0'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'




/etc/config/wireless

config wifi-device radio0
option type mac80211
option channel 11
option hwmode 11g
option path 'platform/ar933x_wmac'
option htmode HT20
# REMOVE THIS LINE TO ENABLE WIFI:

config wifi-iface
option device radio0
option network lan
option mode ap
option ssid OpenWrt
option encryption psk2
option key ''
6149 次点击
所在节点    问与答
12 条回复
Arnie97
2016-08-03 22:43:57 +08:00
试一下路由器自身能否访问外网? wget -O- http://ip.cn
nealwx
2016-08-03 23:22:49 +08:00
Iptable 没配好吧
hhp
2016-08-03 23:29:03 +08:00
@Arnie97 好我明天看看

@nealwx 不是只要配 network 和 wireless 吗? iptables 我没动过
codingadog
2016-08-03 23:30:10 +08:00
我觉得弄个 luci 配置起来简单许多。。。
hhp
2016-08-03 23:32:13 +08:00
@codingadog 路由器配置低,不知道 ram 够不够
而且现在连不上外网只能离线装,要单独下载好多 ipk 也很麻烦
msg7086
2016-08-03 23:34:36 +08:00
@hhp 这就是为什么需要搞个稍微好点的路由。
不过我 941ND 都可以用 luci 了,你这配置要低成啥样啊。
hhp
2016-08-04 05:21:21 +08:00
@msg7086 4M flash , 32M ram
OGC
2016-08-04 08:18:25 +08:00
为什么把 lan 的 ifname 注释掉?
kokutou
2016-08-04 09:48:00 +08:00
先重置一下。。。
然后只配 wan 为 dhcp , lan 的 ip 改为和你公司所有内网都不一样的网段, 192.168.xxx.1 就行了吧。


lan 改 dhcp 想桥接?好像应该也不是这样改吧。。
桥接的话,公司网线应该插在 lan 口上, wan 口作废。
kokutou
2016-08-04 09:48:40 +08:00
不过我也没用过桥接,不知道咋改。。。
hhp
2016-08-04 10:06:52 +08:00
@OGC 一些教程上写的

@kokutou bridge 那个是默认的我没改,这 3g 路由器只有一个口, wan/lan
kokutou
2016-08-04 16:26:54 +08:00
@hhp
wifi 连上进去 ifconfig 一下看看 wan 口得到的 ip 是啥,能不能 ping 通内网啊。
公司要是比较大。。。我感觉你用 192.168.2.1 也会冲突。。。
然后就是,本机可以设一个 DNS ,有时候这样搞个路由器会遇到域名没发解析的问题。。。

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

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

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

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

© 2021 V2EX