hhp
V2EX  ›  问与答

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

  •  
  •   hhp · Aug 3, 2016 · 7207 views
    This topic created in 3758 days ago, the information mentioned may be changed or developed.
    手里有个闲置的路由,刚刷了 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 ''
    12 replies  •  2016-08-04 16:26:54 +08:00
    Arnie97
    Arnie97
    Aug 3, 2016 via Android
    1
    试一下路由器自身能否访问外网? wget -O- http://ip.cn
    nealwx
    nealwx
    Aug 3, 2016 via Android
    2
    Iptable 没配好吧
    hhp
    hhp
    OP
    Aug 3, 2016 via iPhone
    3
    @Arnie97 好我明天看看

    @nealwx 不是只要配 network 和 wireless 吗? iptables 我没动过
    Duolingo
    Duolingo
    Aug 3, 2016 via iPhone
    4
    我觉得弄个 luci 配置起来简单许多。。。
    hhp
    hhp
    OP
    Aug 3, 2016 via iPhone
    5
    @codingadog 路由器配置低,不知道 ram 够不够
    而且现在连不上外网只能离线装,要单独下载好多 ipk 也很麻烦
    msg7086
    msg7086
    Aug 3, 2016
    6
    @hhp 这就是为什么需要搞个稍微好点的路由。
    不过我 941ND 都可以用 luci 了,你这配置要低成啥样啊。
    hhp
    hhp
    OP
    Aug 4, 2016 via iPhone
    7
    @msg7086 4M flash , 32M ram
    OGC
    OGC
    Aug 4, 2016
    8
    为什么把 lan 的 ifname 注释掉?
    kokutou
    kokutou
    Aug 4, 2016 via Android
    9
    先重置一下。。。
    然后只配 wan 为 dhcp , lan 的 ip 改为和你公司所有内网都不一样的网段, 192.168.xxx.1 就行了吧。


    lan 改 dhcp 想桥接?好像应该也不是这样改吧。。
    桥接的话,公司网线应该插在 lan 口上, wan 口作废。
    kokutou
    kokutou
    Aug 4, 2016 via Android
    10
    不过我也没用过桥接,不知道咋改。。。
    hhp
    hhp
    OP
    Aug 4, 2016 via iPhone
    11
    @OGC 一些教程上写的

    @kokutou bridge 那个是默认的我没改,这 3g 路由器只有一个口, wan/lan
    kokutou
    kokutou
    Aug 4, 2016
    12
    @hhp
    wifi 连上进去 ifconfig 一下看看 wan 口得到的 ip 是啥,能不能 ping 通内网啊。
    公司要是比较大。。。我感觉你用 192.168.2.1 也会冲突。。。
    然后就是,本机可以设一个 DNS ,有时候这样搞个路由器会遇到域名没发解析的问题。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2446 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 11:12 · PVG 19:12 · LAX 03:12 · JFK 06:12
    ♥ Do have faith in what you're doing.