先分割三個區域 : (ubuntu Live CD. 'Gparted')
1.ext3 filesystem, size 1G
2. swap , size 256MB
3. ext3 filesystem, size 剩下
官方下載網址 dd-wrt.v24_usb_generic.bin
這各版本DDWRT比較新 可以用usb (3/17那各版本怪怪 無法開啟ssh login)
可以用tftp load 到WL-520GU.
1. 先拔開device 電源
2. 按下reset 鍵, 插上電源 (等約5 sec)
3. 接上LAN 某一孔, PC設定IP/mask : 192.168.1.15/255.255.255.0
4. tftp 開啟, 傳給192.168.1.1
5. 等5 min 以上再重開.
web login 到device
1. Services > Secure Shell > SSHd <Enable>
2. Administration > JFFS2 Support <Enable>, Clean JFFS2 <Disable>
3. 登入管理網頁 > Services > USB >
Core USB Support <Enable>
USB 2.0 Support <Enable>
USB Storage Support <Enable>
ext2/ext3 File System Support <Enable>
4. ssh login 下以下command
mount /dev/discs/disc0/part1 /opt
mount /dev/discs/disc0/part3 /mnt
5. 登入管理網頁 > Administration > Commands,在文字框填入以下內容 (nobody for squid)
sleep 5 && echo 'nobody'::65534:65534:,,,:/tmp/nobody:/sbin/nobody >> /tmp/etc/passwd
sleep 12 && mount /dev/discs/disc0/part1 /opt sleep 12 && mount /dev/discs/disc0/part3 /mnt
然後save 在開機執行的command (Save Startup)
這時可以用mount看一下device information
接著下以下command
ipkg update
cd /tmp
wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
sh optware-install.sh
/opt/bin/ipkg-opt install busybox-base
/opt/bin/ipkg-opt install busybox
/opt/bin/ipkg-opt install busybox-links /opt/bin/busybox mkswap /dev/discs/disc0/part2 /opt/bin/busybox swapon /dev/discs/disc0/part2 這邊要把上面指令加到要開機執行的command (Save Startup), 前面加sleep 12
ipkg-opt install squid
ipkg-opt install joe
joe不一定要裝, 灌完後編輯
/opt/etc/squid/squid.conf
加上
--------------------------------------------
visible_hostname localhost
.
.
acl localnet src 192.168.1.0/24
http_access allow manager localnet localhost
.
.
acl our_networks src 192.168.1.0/24 http_access allow our_networks .
.
cache_dir ufs /opt/var/squid/cache 50 8 128
--------------------------------------------
cache_dir 設小一點(default 100 16 256), 設太高
squid -z都過不了, 會整台當掉.
設定完後command
squid -z
squid
以上就ok了.
tomato上有用rtorrect時
cache_dir ufs /opt/var/squid/cache 25 4 64
比較順暢 (20110503)