|Version 14 (modified by anonymous, 6 years ago)|
Installing the gateway on a Linksys WRT54G FAQ
Due to the lightness of the Wifidog client it is often installed inside the linksys WRT54G. This is why it has it's own FAQ.
The easy way
You are not comfortable with linux and don't know how to do all this compiling stuff.
You can use an OpenWRT and WiFiDog compiled by someone else. They MUST be compiled for your specific version of OpenWRT.
IleSansFil makes it's own pair of OpenWRT images and WiFiDog .ipk compiled files available to the public:
- You can download a pre-compiled OpenWRT firmware image here
- And you can download a compatible WiFiDog .ipk file here
Note that the packages on sourceforge are the only one we will support. If you use package distributed by another organisation, you will have to asssk them for support.
Look in the OpenWRT site for instructions on how to re-flash your router with the firmware image (skip any download/building instructions).
Then follow the above installation instructions for installing the WiFiDog .ipk file into the OpenWRT-flashed router.
Please note that the above saves you from the knowledge and time needed to compile and produced these binary files. It is however no magical cure for linux illiteracy. You need to be proficient enough in a unix environment to be able to telnet/ssh into the router and perform the outlined installation and configuration tasks. If you do not feel comfortable doing this we advise you consult with someone who is proficient in linux and networking.
The long way (Note: The following need a good update, it has changed somewhat in more recent versions of openwrt benoitg 2006-01-18)
Q: What do I need ?
A: You will need to have basic/full proficiency in a Linux environment
Do not proceed until you've completed the above. We also recommend you spend some time familiarizing yourself with your new router's OS before introducing Wifidog into that environment. This especially includes the nvram settings, network interfaces and existing interface bridges.
A: The same rules apply as the pre-installation in a non-WRT54G environment above. Do not proceed until you've satisfied them. In summary: Make sure EVERYTHING works first.
Installation of the client on the WRT54G is a bit tricky. The space limitations on the device mean there is no compiler in the OpenWRT operating system. That means that you must compile the client on an external machine then transfer the compiled form onto the router.
To complicate things more, if you compile your client regularly on a standard x86 desktop the produced binary will not run on the router due to the different type of processor (MIPS) on that router.
What is needed is called cross-compilation, In that scenario you use an architecture (such as your x86 desktop) to produce binaries explicitly designed to run on a different architecture (your MIPS router).
The above was the bad news since it makes things sound complicated. The good news is that it's not too complicated and we've built scripts to make this a snap for you. As a matter of fact, you've already done this before!
Remember when you followed the OpenWRT building instructions ? Without knowing it, you already cross-compiled stuff! You used your desktop to cross-compile an entire operating system for the MIPS architecture which resulted in one compressed firmware image you installed on your router.
Compiling a MIPS-friendly WiFiDog
- Download the latest WiFiDog tarball from sourceforge.
- Uncompress the tarball, enter the directory
- Run the following, replacing /usr/local/openwrt/ with wherever you unpacked the OpenWRT tarball earlier:
You're done. If all is well you should now have a new file named wifidog_1.1.0_mipsel.ipk (version number may be different depending on the tarball you downloaded).
Getting the new MIPS-friendly WiFiDog onto the router
The .ipk is a data file for the simple "ipkg/i-Package" package manager already on your router. All that's needed now is to copy that file onto your router. If you have installed the dropbear SSH daemon package on your router you can use scp on your desktop to copy the .ipk file to the router. Otherwise copy that file to any web server you have access to, then use wget on the router to download the file from the web server.
Either way, place the file in the /tmp/ directory on the router.
Once you have the .ipk file on the router, use this command to install it:
ipkg install /tmp/wifidog_1.1.0_mipsel.ipk
Once that is successful delete the .ipk file from /tmp/ to free the occupied memory.
Configuration, Running and Testing
If you set up your OpenWrt?-powered router with a bridged network interface (default), the current firewall rules of OpenWrt do not permit to block all outgoing TCP/UDP ports except port 80 until a user has authenticated via WiFiDog's login page.
You are going to have to disable forwarding from the bridge interface to the wan interface in /etc/init.d/S45firewall:
# The following have been commented out for WiFiDog to work # iptables -A FORWARD -i br0 -o br0 -j ACCEPT # iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
Important notes on the prior step!!'''
How to edit files, like the step above!
Summary: On the Linksys WRT-54GL (and most other devices, you'll be editing files on a READ-ONLY file system. Since the filesystem is a collection of symlinks to a readonly filesystem, you can't simply edit files -- they're readonly. Instead you have to delete the symlink, and copy the file so you have a writable version of the file to edit:
rm /etc/init.d/S45firewall <br> cp /rom/etc/init.d/S45firewall /etc/init.d/ <br> vim /etc/init.d/S45firewall <br>
That will get you there...
You'll need libpthread - that can be installed/downloaded from the Web interface of OpenWRT. WifiDog gateway won't run without it.
Well, it's the same as the earlier section in a non-WRT54G environment.
The intricate link between WiFiDog and OpenWRT
Repeat after me:
A WiFiDog RUNNING ON AN OpenWRT INSTALLATION MUST HAVE BEEN COMPILED AGAINST THE SAME OpenWRT BUILDROOT USED TO CREATE THAT INSTALLATION
What does that mean ?
- If you downloaded and compiled OpenWRT yourself, download and compile WiFiDog yourself against the same buildroot - Do not use someone else's pre-compiled WiFiDog
- If you downloaded a pre-compiled OpenWRT firmware image:
- Ask the person who built it to compile WiFiDog for you against the same buildroot
- Or ask them for a copy of their OpenWRT buildroot so you may compile WiFiDog against it