作者:张华 发表于:2015-10-02
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明
( http://blog.csdn.net/quqi99)
买回哦耶路由器之后,自带的openwrt无法安装ipset没法科学上网(说内核不满足大于3.10的要求),折腾了一下后就闲置了好几个月,今天有空打算接着继续玩的时候发现了一些莫名其妙的问题,运行vi报ELF相关的错误,运行uhttpd报sock相关的错误,图形化界面无法登录,不知怎么弄了一下ssh也无法登录了。长按多功能按钮6秒以上重置后总算可以telnet 192.168.1.1 (注意IP已经不是哦耶自带的192.168.8.1了),我们继续。
a, 重置
mount_root
mtd -r erase rootfs_data
reboot -f
telnet 192.168.1.1
passwd root
firstboot
reboot -f
b, 安装luci图形化界面
telnet 192.168.1.1
opkg update && opkg install luci luci-i18n-chinese uhttpd
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
c, 从trunk版本编译openwrt
sudo apt-get install git build-essential libncurses5-dev gawk libssl-dev subversion
git clone git://git.openwrt.org/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
哦耶路由器采用的芯片是MT7620A,故选项如下:
- Target System (Atheros AR7xxx/AR9xxx) -> Ralink RT288x/RT3xxx
- Subtarget (RT3x5x/RT5350 based boards) -> MT7620 based boards
- LuCI -> Collections -> luci(new)
make V=s
d, 从luci图形化界面刷新编译的固件,bin/ramips/openwrt-ramips-mt7620-miwifi-mini-squashfs-sysupgrade.bin
e, 刷了之后,telnet和luci图形化界面是进不去了,但可以通过ssh root@192.168.1.1进去。
f, 再像上面的方法安装luci, http://192.168.1.1 root/admin, OK, 成功升级到3.18内核。
root@OpenWrt:~# opkg info kernel
Package: kernel
Version: 3.18.21-1-1f97c10ea8aa04767734a7d078331b28
Depends: libc
Status: install hold installed
Architecture: ramips_24kec
Installed-Time: 1443679359
g, "opkg install ipset"仍然无法安装ipset,这是为什么为什么?
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for ipset:
* kernel (= 3.18.21-1-fcc7ce90f04c481d0d82d4f30471437c) * kernel (= 3.18.21-1-fcc7ce90f04c481d0d82d4f30471437c) *
* opkg_install_cmd: Cannot install package ipset.
加--force-depends参数强制安装成功kmod-ipt-ipset无法配置。
opkg install ipset --force-depends
网上搜索了一下,很多人在此处卡壳了,我在WNDR4300上的openwrt没此问题。估计是cpu架构不同导致的bug吧,看来此路暂时不通。
h, 配置dnsmasq防dns污染, 没法使用ipset就不用吧
修改 /etc/dnsmasq.conf 在最后加入conf-dir=/etc/dnsmasq.d
新建/etc/dnsmasq.d/gfw.conf加入下列内容后重启dnsmasq (/etc/init.d/dnsmasq restart)
server=/google.com/208.67.220.220#443
server=/googlehosted.com/208.67.220.220#443
server=/co.jp/208.67.220.220#443
server=/google.com.hk/208.67.220.220#443
server=/google.com.tw/208.67.220.220#443
server=/google.com.jp/208.67.220.220#443
server=/gstatic.com/208.67.220.220#443
server=/googleusercontent.com/208.67.220.220#443
server=/appspot.com/208.67.220.220#443
server=/googlecode.com/208.67.220.220#443
server=/googleapis.com/208.67.220.220#443
server=/gmail.com/208.67.220.220#443
server=/google-analytics.com/208.67.220.220#443
server=/youtube.com/208.67.220.220#443
server=/blogspot.com/208.67.220.220#443
server=/blogger.com/208.67.220.220#443
server=/ggpht.com/208.67.220.220#443
server=/useso.com/208.67.220.220#443
server=/googlevideo.com/208.67.220.220#443
server=/youtube-nocookie.com/208.67.220.220#443
i, 安装不带spec的shadowsocks (shadowsocks-libev_2.4.0-1_ramips_24kec.ipk)
http://sourceforge.net/projects/openwrt-dist/files/shadowsocks-libev/2.4.0-bd77b7b/ramips/
opkg install libpolarssl resolveip
scp /tmp/shadowsocks-libev_2.4.0-1_ramips_24kec.ipk root@192.168.1.1:/tmp/
opkg install /tmp/shadowsocks-libev_2.4.0-1_ramips_24kec.ipk
j, OpenWrt uses busybox's ash as default, 这样会造成如下问题:
root@OpenWrt:~# ss-redir
-ash: ss-redir: not found
改成bash吧,但在/etc/passwd里将root用户从ash改成bash之后使用ssh登录时说密码不对了,telnet又无法登录。
还好,此时还有之前弄好的图形化界面,反正ipset都是不能用,在图形化界面时恢复成下列哦耶openwrt吧,不再折腾了。
http://downloads.openwrt.org.cn/PandoraBox/OYE-0001/firmware/stable/PandoraBox-ralink-mt7620-oye-0001-squashfs-sysupgrade-r1024-20150608.bin