Based on http://wiki.openwrt.org/OpenWrtDocs/Hardware/Asus/WL500GP and http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration/WiFiEncryption – all credits goes to openwrt wiki
Might be outdated by now.
Use at your own risk!
Prepare
- Make a backup of the system, like described in the link abov.
- Remove the power cord
- Connect computer to the routers lan1 port
- Press and hold the reset button in
- Reinsert power cord, and release reset button when the power LED is flashing slowly
- Do sudo dhclient eth0 to connect to the router
Install firmware
- Download openwrt-brcm-2.4-squashfs.trx from http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/
- nstal atftp, tftp or tftp-hpa (in ubuntu do sudo apt-get install tftp for example)
- tftp 192.168.1.1
- tftp > binary
- tftp > trace
- tftp > put openwrt-brcm-2.4-squashfs.trx
- Wait for at least six minutes! When time is up you can restart the router by taking out the power cord and inserting it again – if you do anything before you risk do brick the router!!!!
Setup
Telnet to the router and change the password
telnet 192.168.1.1
root@OpenWrt:/# passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
Now you are able to ssh to the router
Enable wifi
(Note this i for Breadcom, if you have Atheros see the link at the top. If you write dmesg in router terminal you should be able to the which driver you are)
uci set wireless.wl0.disabled=0
uci commit wireless && wifi
Wifi encryption
Note: this is also based on Broadcom hardware. This only enables WPA2, see http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration/WiFiEncryption for types and Atheros
- opkg install nas (might be installed by default)
- uci set wireless.cfg2.encryption=psk2
- uci set wireless.cfg2.key=<password>
- uci commit wireless && wifi
Note password shoud be between 8 and 63 characters and only contain letters and digits
USB
source: http://forum.openwrt.org/viewtopic.php?pid=65789 and http://wiki.openwrt.org/UsbStorageHowto
- ipkg update
- ipkg install kmod-usb-uhci-iv
- ipkg install kmod-usb2
- insmod ehci-hcd
- The following might not be necessary, but if you have problems mounting they could help
- ipkg install kmod-fs-vfat
- ipkg install kmod-nls-cp437
- ipkg install kmod-nls-cp850
- ipkg install kmod-nls-iso8859-1
- ipkg install kmod-nls-iso8859-15
- ipkg install kmod-nls-utf8
Enable SSH from the outside
(http://forum.openwrt.org/viewtopic.php?id=12545 )
To enable SSH from the outside you need to do uncomment the two lines starting with iptables below “### Open port to WAN”, in /etc/firewall.user. My firewall.user file looks like this:
[...] ### Open port to WAN ## -- This allows port 22 to be answered by (dropbear on) the router iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT iptables -A input_wan -p tcp --dport 22 -j ACCEPT [...]
When the /etc/firewall.user is updated you will need to do /etc/init.d/firewall restart or a reboot to make the changes take effect.
You may also need to forward the port from your internet modem/router.
Upgrade
- wget the newest version to /tmp
- mtd write openwrt-brcm-2.4-squashfs.trx linux && reboot
- Setup the rest of the system (security etc.)
Or alternatively use the sysupgrade, which backups config files before applying the trx, very useful.
Tools
See all connected hosts
root@OpenWrt:~# arp IP address HW type Flags HW address Mask Device 87.57.16.1 0x1 0x2 00:AA:BB:CC:FF:EE * eth0.1 192.168.1.249 0x1 0x2 01:AA:BB:CC:FF:EE * br-lan 192.168.1.247 0x1 0x2 02:AA:BB:CC:FF:EE * br-lan
Recovery
If you, like me, happen to screew things up big time, there is some possibilities make things right again.
Failsafe mode
- Set your lan to use a IP between 192.168.1.2 and 192.168.1.254 (gateway and DNS does not matter)
- Unplug the power cord
- Plug the power cord back
- When power LED turns off press the reset or ezsetup button
- When the power LED starts blinking you can enter the router over telnet (no password or username)
Reset
This helped me out. First the JFFS2 partition is completely erased, removing all packages, and the change is committed
firstboot
sync