OpenWrt Install
OpenWrt Install
OpenWrt Install
INSTALLING OPENWRT
The Tutorial is made using a ASUS WL-500G Deluxe (or WL-500GX and WL-500GD as it is sometimes called).
It should however apply to all "OpenWRT Com patible" devices, even though some details like hardware ad\dresses, storage
locations and so on could differ if you use other hardware. Check out the General OpenWRT Tutorial Inform ation page for more
information.
This Tutorial will guide you through the basics in installing and setting up OpenWRT on ASUS WL-500g (Deluxe).
After following this Tutorial you will have:
NAT enabled router, allowing LAN and Wireless LAN (WiFi / WLAN) access to the WAN (Internet).
Tutorial Index
1. Prerequisites - What is needed to get started.
2. Installing OpenWRT.
Prerequisites
All you need is :
Installing OpenWRT
The build of OpenWRT used here is release codenamed WhiteRussian RC6
Dow nload this imagefile:
http://dow nloads.openw rt.org/w hiterussian/rc6/bin/openw rt-brcm -2.4-squashfs.trx
This tutorial provides you w ith one w ay to upload the firmw are using w indow s. For more information about installing OpenWRT, refer to the OpenWRTDocs/Installing
During the upload process, w e w ill start by resetting your router to factory defaults.
Use either the w ebinterface to do so, ow simply hold the reset button on your router for appx 20 secs (or until the PWR led flashes rapidly), then release the button.
Your router w ill now be found on 192.168.1.1.
Be sure the WAN port is not connected, and connect your computer to one of the 4 LAN ports.
Now reboot your router, w hile holding the reset button. A few seconds into bootup, the PWR LED w ill start blinking slow ly. Now issue the follow ing command from a
commandpromt in your Window s XP (from the folder w here you placed the .trx image):
tftp -i 192.168.1.1 PUT openwrt-brcm-2.4-squashfs.trx
The firmw are w ill now load into your router finishing w ith a message stating some figures on bytes transfered and time used etc.
macsat.com/…/contentwindow.p… 1/9
21-04-2010 Content Preview
Do a hard reboot by removing and reapplying pow er (simply pulle the plug). It might take a w hile for the router to boot the first time, you can "keep an eye" on w hen it is
booted by pinging it from a cmd prompt:
ping -t 192.168.1.1
Once you starting getting ping replys, you can login to the router using your favourite telnet client. I like putty a lot.
You w ill be logged in directly w ith no asking for username nor passw ord.
The fist thing to do is to change the root passw ord, you do this by issuing:
passwd < enter >
Try to connect the WAN port to some WAN connection and reboot.
reboot
This time boot w ill take a bit of time as w ell. Telnet w ill now be disabled, and you have to logon using ssh. Username is "root" and passw ord is the passw ord you
defined in the previous step.
The OpenWRT version w e installed uses a combined squasfs and jffs2 filesystem . Meaning that the "/" filesystem is read/w rite, just as a normal linux running from a
hard disc.
You can try to do a:
df -h
Too see how much space is available. On my ASUS WL-500g Deluxe it show s some 3.2 MB total, and 1.4 MB free in /dev/root mounted on /
{mosgoogle bot}
In order for the new version to work, we need to create a new symlink:
ln -s /bin/ipcalc /bin/ipcalc.sh
After this you should be able to setup all the features you want on the router using the excellent web interface at
http://192.168.1.1 (or the ip you have setup your user to use).
Here I will merely present a few screen shots of some of the pages that allows management of the basic networking,
wireless and dhcp features.
The webif greets you with a page looking like this, that gives you a bit of info on the interface version, and allows you to
upgrade to a new version if one is available:
macsat.com/…/contentwindow.p… 2/9
21-04-2010 Content Preview
macsat.com/…/contentwindow.p… 3/9
21-04-2010 Content Preview
Basic WAN and LAN settings can be handled from this page:
macsat.com/…/contentwindow.p… 4/9
21-04-2010 Content Preview
A Simulary and very self explanatory page exists for setting up WLAN (WiFi) including security. I highly suggest that
users use at least WPA if not WPA2 for their network. WEP really is outdated.
macsat.com/…/contentwindow.p… 5/9
21-04-2010 Content Preview
macsat.com/…/contentwindow.p… 6/9
21-04-2010 Content Preview
Finally, a lot of users are using "static DHCP" entries, that ensures that certain computers always gets the same IP on
the network. This is very handy when running services like web servers, shared folders and P2P software like emule,
frostwire and bittorrent that all needs port forwarding.
macsat.com/…/contentwindow.p… 7/9
21-04-2010 Content Preview
As mentioned - I have no intentions of making a complete manual for the web interface, as I consider it to be largely
self explanatory. Users that needs more info should consult their manuals, as the official firmwares will often use names
for the different settings that are very simular to those used here.
This can be avioded by installing the ipt_recent module for iptables, and changing the firew all rules accordingly.
The method includes allow ing only X number of connections to port 22 from the same IP in a period of YY seconds.
The ipt_recent module is in the iptables-mod-extra package, install this by:
ipkg install iptables-mod-extra
In this example of the setup, w e w ill allow a maximum of 3 connections to port 22 from each IP w ithin a 120 seconds timeframe. Also w e w ill make a log-entry in the
syslog for each blocked request to port 22. This means that w e need to load both the ipt_recent and the ipt_LOG modules, and use them in our firew all.user script.
To load the modules at starup do this:
echo "ipt_recent" >> /etc/modules
echo "ipt_LOG" >> /etc/modules
Now you can either reboot your router, or issue the follow ing commands to load the modules now :
insmod ipt_recent
insmod ipt_LOG
To create the firew all rules, you need to replace this like in your firew all.user script :
macsat.com/…/contentwindow.p… 8/9
21-04-2010 Content Preview
iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT
macsat.com/…/contentwindow.p… 9/9