The information in this page is outdated but is left as a guide for anyone trying to setup its own internet gateway using his/hers university network.
Introduction
How to configure your OpenWRT router to create a stand-alone solution to access your university's eduroam secured network and have a permanent connection to the internet. For my first attempt I used a LaF*nera router from FON but you can use any other router capable of running Linux OpenWRT .
The few things needed are:
LaF*nera is a very small router with one ethernet and one wireless NIC. It comes preloaded with a special version of OpenWRT compiled by FON to create their Social Network which makes it perfect to experimentsince we know it runs OpenWRT.
Download OpenWRT v7.09 from www.openwrt.org
You'll get two files: one with the root filesystem and the other with the kernel.
Connecting to the serial port
Disassemble the router by removing the two front rubber feet and screws with a small philips screwdriver and locate the serial port connector next to the ram chip.
Looking at the board with the ethernet port on your right and the ram chip on your left the correct pin functions are:
Run your favorite terminal application on the PC. Minicom is a good choice! Configure the settings to:
Now apply power to the router and the bootloader should appear after a few seconds! Press CTRL+C to stop the boot procedure.
Flashing the router via serial port (ymodem)
To load the new version of OpenWRT into the router follow these steps:
Change the baudrate to 115200 bits per second to speed things up:
Change the settings in your terminal program to 115200 too and then erase the flash and load the root filesystem into the ram via serial port:
In the terminal program select the file openwrt-atheros-2.6-root.jffs2-64k to send via ymodem protocol and wait while it gets transfered.:
After the transfer completes, write it to the flash memory of the router:
Finally load the kernel file to ram (file openwrt-atheros-2.6-vmlinux.lzma) and then to its own partition in the flash memory:
Reboot the router and let linux boot:
More information on flashing a OpenWRT can be found at Fonera mit OLSR - Freifunk Hannover page.
Connecting linux to eduroam
Boot your new openwrt linux instalation and wait until you see the system prompt.
Now install the following packages:
You can use the following command:
Now lets move on to the configuration.
You'll need to disable the firewall but don't worry since your private network will be running behind NAT. It will provide some level of security.
Next, configure the dhcp in: /etc/config/dhcp
The lan interface will be the one connected to the private network and the wan the one connected to eduroam.
Now configure the network interfaces in: /etc/config/network
This example shows the private (lan) interface using ip addresses in the 192.168.88.0/24 range. Change it if you want but be careful not to select the same network range used in the eduroam network. If you look more careful you'll see that the lan interface is bridged with the eth0 which means that the ethernet cable of your F*n also gives you access to your private network. You should use this interface if any problems arise while configuring the router.
Give your F*nera OpenWRT a name: /etc/config/system
Next configure the wireless settings for both eduroam and your private network: /etc/config/wireless
Lets check the first wifi-iface: it's for the private lan interface with ssid=HomeNetName, wpa-psk encryption, password homenetpasswd2008 and mode ap (access point to provide a network).
The second wifi-iface: it's the wan interface that connects to eduroam with ssid=eduroam (obviously), no encryption because it will be provided externally because of 802.1x authentication and mode sta (station means it simulate a network interface like a regular computer to connect to the desired network).
Encryption to the eduroam network is provided by wpa_supplicant that must be configured outside this file. wpa_supplicant will use 3 files:
Create the file /config-wpa with the following:
It will configure NAT on the outgoing traffic to ath1 (the wan eduroam interface) and start wpa_supplicant when the router starts.
Create a symbolic link to /config-wpa in /etc/rc.d/ by typing the following in the console:
And finally the wpa_supplicant settings in /etc/wpa_supplicant.conf
Among other things you should check if the ssid is eduroam, key-mgmt is WPA-EAP, pairwise is TKIP and eap is PEAP. Your identity is your login name and your password... well you should know what it is! Also check if phase2 is MSCHAPv2.
To end this configuration only one thing remains to check: if the dnsmasq is configured to provide ip addresses to your lan private network. Remember the network range 192.168.88.0/24? Make sure no options outside this range are enabled in the config file. Here's my example:
Detailed information on how to manually connect to eduroam network can be found at glua wiki.
To help you in this task I'm providing a zip file with all the files I changed and a small description of what needs to be configured in openwrt below.
Don't forget to reboot and change your root password from admin to something else!
Files
Zip with all the files edited at their places inside the filesystem
Reference sites
There are plenty of wikis on the web that teach you how to change from the original firmware, here are some of the sites I visit from time to time:
Published on Wednesday 2008/04/16, last modified on Thursday 2014/09/04