Sunday, June 10, 2012

Clearwire with OpenWRT

The Clearwire USB devices allow you to connect upto 6 wireless devices on wi-fi network. If you want more what to do? Add your own router behind it.
You can use OpenWRT based router to do this easily.
I have a buffalo WZR-HP-AG300H which  has a USB port. I hooked my clear wire device to this USB port and it comes up as a typical USB to Ethernet device. After install OpenWRT in my Buffalo router just telnet and install few packages and some configuration...
1) Install OpenWRT: Download the sqashfs image and locally (openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-factory.bin). Then use firmware upgrade page on Buffalo router to upgrade the firmware.
2) After the router reboots it will get an IP  of 192.168.1.1 so you need to assign yourself 192.168.1.2 or something like that. Then telnet into the router. No ssh, just telnet.
3) I set my PC to act as a router by using the nat.sh script and then made my PC as default gateway on Buffalo router. Also edited /etc/resolve.conf on Buffalo router to use 8.8.8.8 as DNS server.
4) The use opkg on Buffalo router to install required packages.
opkg update ;
opkg install kmod-usb-net kmod-usb-net-cdc-ether luci kmod-ide-core usbutils
5) Then just start http server.
/etc/init.d/uhttpd start

6) Reboot the router
7) Now plugin the clearwire device. It will register as usb0.

8) Login into the router GUI. If you can't access the GUI then login using telnet and start the http server (step 5). Please note that you can not login using ssh unless there root password is set.

9) Add an interface using the GUI and connect the interface.
Thats it. Done. Now you can hook as many devices as you want behind Buffalo/OpenWRT .