存档

文章标签 ‘openwrt’

On my router there are some interfaces in /etc/config/network. The wan interface is configured as a PPPOE netowrk to connect my ISP. There is also a pptp-vpn connected named zvpn. I found it is very slow to run “/etc/init.d/network reload”, taking about 2 miniutes. If I comment out the zvpn interface, it runs fast. Obviously, [...]

一 23rd, 2012 | Filed under linux
标签:

when editing some configration of openwrt , this error maybe occured: /sbin/ifup: eval: line 1: syntax error: bad substitution I found at least one reason of this error code, and fixed it. — /rom/lib/network/config.sh +++ config.sh @@ -15,7 +15,7 @@   local fam for fam in ipv4 ipv6; do – if [ -d /proc/sys/net/$fam ]; [...]

十一 13th, 2011 | Filed under linux
标签:

配置完openwrt之后,觉得实在是还不够。想装个tcpdump,结果发现没有空间了。看样子得想办法省出点空间。 仔细看了看openwrt的文件系统结构,发现openwrt是把编译出来的一份只读系统打包了,装载在/rom下,然后,修改新加的内容,单独放在另一个可读写的地方,装载在/overlay上。/rom和/overlay的文件都不是全部,两者结合,才真正形成了一个复合的文件系统,加载于/。对系统文件进行替换后,由于/rom不可写,不要的那个文件并没有真正删除,其空间也就浪费了。这在小小的路由器上,是不可接受的。因此对系统的修改,比如我重新弄了个改完BUG后的dropbear,就实在是大大的浪费。 而且/rom里的文件,实际存储是压缩了的,文件压缩自然可省空间。因此有必要编译一份openwrt。过程: 1. host安装必要的组件: apt-get install gawk flex unzip git subversion 2. 下载源代码。 svn co svn://svn.openwrt.org/openwrt 。从此trunk目录就成了build_root目录。 3. 更新feeds. ./scripts/feeds update -a 4. 安装必须的组件 ./scripts/feeds install tcpdump psmisc 5. make menuconfig,设置一些组件。使得Target System为Atheros AR71xx/AR7240/AR913x/AR934x。Target Profile为TP-LINK TL-WR841ND v7。 6. 继续设置menuconfig里的组件。完了后make defconfig检查,确保得到以下结果: diff y kmod-ipt-nathelper-extra y kmod-mppe y kmod-pptp y pptp y uhttpd y tcpdump y psmisc [...]

八 14th, 2011 | Filed under linux
标签:

#!/bin/bash export PATH=/ow/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/bin/:$PATH gcc_cmd=’mips-openwrt-linux-uclibc-gcc -I/ow/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.32/usr/include -I/ow/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.32/include -I/ow/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/usr/include -I/ow/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/include   -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float -ffunction-sections -fdata-sections   -L/ow/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.32/usr/lib -L/ow/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.32/lib -L/ow/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/usr/lib -L/ow/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/lib -Wl,–gc-sections ‘ alias mgcc=$(echo $gcc_cmd) usage: $ source ./rt_gcc.sh $ mgcc -o hello hello.c

八 13th, 2011 | Filed under linux
标签:

路由器: tp-link wr841n (v7) 优点:11n路由器,信号不错,价格便宜。 缺点:空间较小,只有4M。刷openwrt是没有图形配置界面了,只能手动ssh配置。 刷openwrt: http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin 配置记录: 1. 安装必要的工具diff,pstree,以方便改设置和检查。 # opkg update # rm -f /usr/bin/cmp # opkg install diffutils # opkg install psmisc 弄完后,把diff和pstree备份, # opkg remove psmisc diffutils 然后把备份还原。没有办法,路由器空间较少。 2. 安装拨vpn所需组件: # opkg install pptp mppe kmod-ipt-nathelper-extra 其中,前两个是保证路由器上能拔VPN(PPTP)。 最后一个是使接入的设备也能拨,这个说起来容易,但出事的时候很难知道是缺了哪个包。 仔细google来google去看了很多页面才偶然找到。 3. 配置网络 配置文件/etc/config/network 配置拔号: config interface wan option ifname eth1 option [...]

八 13th, 2011 | Filed under linux
标签:

root@OpenWrt:~# cat /etc/init.d/unbrick #!/bin/sh /etc/rc.common   START=20   bakcat() { for i in $* ; do echo "################file seperator for $i##################" cat $i echo done }   revert() { echo revert config… bakcat /etc/config/* >/root/cfgbak.all 2>&1 cp -R /root/cfgbak/* /etc/config/ }   start() { count=$(cat /root/count_file) if [ $count -eq 0 ] ; then revert [...]

八 12th, 2011 | Filed under linux
标签:

If someone creates a reverse tcp forwarding channel by ssh into an openwrt dropbear server, bad things are happening. the dropbear process will crash on connecting to the binded port. Even worse, a connection with reverse tcp reverse forwarding cannot be created if GatewayPorts is set to 1 in /etc/config/dropbear. Surely, there are bugs in [...]

八 10th, 2011 | Filed under linux
标签:

make shows: make[1] world make[2] target/compile make[3] -C target/linux compile make[2] package/cleanup make[2] package/compile make[3] -C package/opkg host-compile make[3] -C package/base-files compile make[3] -C package/busybox compile make[3] -C package/button-hotplug compile make[3] -C package/libnl-tiny compile make[3] -C package/iw compile make[3] -C package/wireless-tools compile make[3] -C package/mac80211 compile make[3] -C package/crda compile make[3] -C package/dnsmasq compile make[3] [...]

八 10th, 2011 | Filed under linux
标签: