The WiFiDog gateway is a pretty clever piece of software. This tutorial shows you how to recycle an old PC into a WiFiDog router. Although you could also use a wireless card on the PC to provide access, this tutorial uses an Access Point as an example as this configuration is much more straight forward.
Although designed for embedded devices like linksys routers, Wifidog will run on more or less any PC hardware no matter how slow it is. You may want to consider how resilient the hardware is however as it will be expected to run for long periods of time without any user intervention.
Typical basic PC requirements:
Added requirements
You will need to go into the BIOS settings of the computer you are using and select CDROM as the primary boot device, and HDD as the secondary. Whilst you are there ensure Wake on LAN is set up, and that the computer will boot without a keyboard and mouse attached (some may not ask this), and finally make sure the PC is set to boot up after a power failure. Occasionally you may have to make sure that the LAN device is enabled on the bios, but usually this is not the case.
Although I used Debian as the operating system of the Wifidog Linux router, and the tutorial describes installation from the Debian minimal net install CD, Ubuntu will do just as well (and is my preferred operating system since I first wrote this how to).
The base operating system is now installed and running. You should reboot the system by typing reboot to ensure that it comes back up again smoothly.
When the operating system was installed, it automatically took you through the setup of the main network connection to the internet. Now the other network card which will be allowing clients to connect to the PC via the wireless access point needs to be set up, and the two network cards bridged together to let wireless clients access the internet.
Now that you have eth0 (connected to the internet) and eth1 (this will face the wireless AP) so you need to get one to talk to the other. This is so that traffic from the wireless AP can pass to the internet (so the wireless users can get internet access). This is accomplished by creating a proxy script, which I’m sure you’ll be glad to know has all ready been written for you by Debian, and meddled with by me!
So that the wireless users are issued with and IP address and DNS server settings when they connect, the Linux box will need a DHCP server running on the wireless facing network interface eth1. This is a program which needs downloading from the central software repository and setting up:
# Defaults INTERFACES="eth1"
You should now have the wireless facing card set up to issue IP addresses and DNS information to connecting clients.
At this stage you should test that the Linux PC is working properly. Give it a reboot by typing reboot, then when it has come up, ensure that it issues an IP address, and bridges the network cards allowing a user to connect to the internet. To do this, simply patch another computer into the wireless facing port on your linux PC with a cross-over cable and try to get a web page on the internet.
Assuming all is working so far we are now moving into the final stages of setting up the Linux router PC.
Wifidog is the ‘nuts and bolts’ of the captive portal. It is the component which captures the wireless user’s webpage, and redirects them to a log on screen. This is the last piece of software which requires installing to create the Linux PC router.
Doing this has now uncompressed the Wifidog files into a separate folder located in the /usr/src section of your Linux PC. Now we need to install the Wifidog components to make it work.
You will see some text running up your screen as you perform each step; this is the PC compiling the program. Now we need to add the configuration file so it works properly.
# Parameter: GatewayID # Default: default # Optional but essential for monitoring purposes # # Set this to the template ID on the auth server # this is used to give a customized login page to the clients # If none is supplied, the default login page will be used. #
GatewayID testnode
Finally we need to make sure that Wifidog runs automatically when the PC starts, so we need to add one more file from the wireless files folder.
Now for the moment of truth. Connect your wireless access point to your remaining network card (remember to turn DHCP off on the AP - your linux box is doing that for you now) You should be able to reboot the Linux PC and see the captive portal page when you connect wirelessly. If not, go over the files you have edited and ensure that you didn’t make any capitalisation/spelling mistakes or leave any commas out!
Good Luck.