Installation Guide

WARNING: If you make a mistake installing this software, it is possible to permanently disable your router, effectively turning it into a brightly colored brick. Bricked routers aren't very useful – you can use one to beat someone about the head or as modern art, but that's about it.

You can pretty much eliminate this risk by following the directions given here so please read them first before attempting to install Gargoyle.

Garoyle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The author(s) of Gargoyle assume ZERO liability for any damage caused by this software.

Overview -- READ FIRST

Installing the firmware onto your router is probably the trickiest part of using Gargoyle. There are basically two ways to do this. You can either (1) install OpenWrt Kamikaze and then install Gargoyle as a set of packages on top of it, or (2) install one of the Gargoyle images directly onto your router.

Instructions for installing images onto several models are provided below, but there many routers that will (likely) run Gargoyle that are not listed here and for which instructions are not provided. Gargoyle should run on any router that uses a mips architechture, has either a broadcom or atheros based wireless card, and has at least 4MB of flash. You may try installing the gargoyle images (AT YOUR OWN RISK) for these routers, or, more wisely, you may try installing OpenWrt broadcom-2.4 images or atheros-2.6 images on these routers, and if you get this working, install the Gargoyle packages on top of it. Consult the OpenWrt Table of Hardware to determine whether your router is compatible with OpenWrt and whether it is likely to be compatible with Gargoyle based on the criteria listed above.

Be VERY careful of the 4MB flash memory requirement. Most newer WRT54G models have only 2MB, making installation of Gargoyle/OpenWrt impossible

If you install Gargoyle using one of our images the inital connection procedure is a little different than for OpenWrt. OpenWrt defaults to having no root password, while Gargoyle sets the initial root password to “password” (which you can change later). You cannot telnet in like you can with a default OpenWrt installation. Instead you can access the router at the initial default ip (192.168.1.1, just like OpenWrt) via ssh (ssh root@192.168.1.1) using the password “password”. You may also login to the web interface with username “admin” OR “root” and the password “password”.

If you find the documentation here insufficient there are several other resources on installing OpenWrt you may find helpful. In fact, much of the information provided here was derived from these sites:

Linksys WRT54GL, WRTSL54GS

The Linksys WRT54G* routers were the first routers to work with 3rd Party firmware. However, be aware that newer WRT54G routers do NOT work with OpenWrt or Gargoyle – they have only 2.0MB of Flash, unlike their predecessors which had 4.0MB which is sufficient. If you want to use a Linksys WRT54G* router with Gargoyle, hunt down one of the old WRT54G units, v1-4 or obtain a Linksys WRT54GL or WRTSL54GS.

These routers have a broadcom wireless chip, so you will want to use the brcm-2.4 images. There are several *.bin images for different models and a generic *.trx image. The *.bin images are identical to the generic *.trx image, except they have a model-specific header that allows for easy installation. You can select the appropriate *.bin file for your router and upload it with the original firmware, and it should work ok.

If you upgrade using the Gargoyle web interface to a new version of Gargoyle or to a different third-party firmware use the .trx file. If you are installing from another third-party firmware such as DD-WRT or Tomato, you should also use the .trx file. The .bin files are only appropriate when installing from the stock firmware.

It is also possible to upload the image to the router via tftp. As the router boots there will be a few seconds when it will accept tftp connections on ip 192.168.1.1 (regardless of what you have the ip of the router set to). Follow these instructions to install the image via tftp. Transferring a new firmware image via tftp is also the best way to “de-brick” a router that is malfunctioning.

Linksys WRT54G-TM

This router was only produced briefly by Linksys but is compatible with Gargoyle because it has 8 Megs of RAM and 32 Megs of flash giving you plenty of room to do cool stuff. The ”-TM” part of the name refers to T-Mobile functionality that Linksys supports in their stock firmware. This functionality will be lost if you install Gargoyle so if you have a T-Mobile phone and use this function you have to decide what you want to do. Flashing of this router requires a special step because the stock Linksys firmware will not allow itself to be directly replaced by Gargoyle. The procedure is to replace the Linksys firmware with the CFE_Updater and then replace the CFE_updater with Gargoyle.

To prepare for the procedure

  1. Download latest .trx image of the Gargoyle package
  2. Download this TFTP utility
  3. Download Tornado's CFE_Updater-WRT54G-TM.bin

Do not use the procedure on any router except the WRT54G-TM.

1. First assign two STATIC IP addresses to your ethernet wired adapter. Assuming the default LAN IP Address of the Linksys WRT54G-TM is 192.168.0.1 we will use 192.168.0.2 and 192.168.1.2 on your computer.

On Windows XP, Control Panel/Network Connections/right-click on Local Area Connection icon and select Properties.

On Windows Vista, Control Panel/Network and Sharing Center. Go into the properties of the Local Area Connection/Internet Protocol TCP/IP and set the static IP address.

    IP Address: 192.168.0.2
    Subnet Mask: 255.255.255.0
    Default Gateway: 192.168.0.1

Click the Advanced button in the TCP/IP setup window and in the IP Address section click the ADD button to add the following 2nd IP Address to the adapter:

    IP Address: 192.168.1.2
    Subnet Mask: 255.255.255.0

Then click OK on each screen. Your network interface card (NIC) now has 2 LAN IP Address statically set on it, 192.168.0.2 and 192.168.1.2. This will allow your PC to communicate with the router before and after the CFE_Updater is on it. It will also allow you to be able to tell when the router is ready for a TFTP upload.

2. Open a command prompt window and type ping -t 192.168.1.1 and hit enter. The ping with begin execution and there will be no response. This is normal and what you want. Leave this window open.

3. Log into the WRT54G-TM's web interface @ http://192.168.0.1 (assuming that the router has been reset to defaults) and go to the Administration Tab - Firmware Upgrade. Upload the CFE_Updater-WRT54G-TM.bin to the router.

!!!ATTENTION!!! You MUST wait 5 minutes after clicking the Upgrade button to allow the CFE_Updater to replace the stock CFE on the router and for it to erase the rest of the flash.

A few seconds after clicking the Upgrade button the Linksys web interface will report that the upload has been successful and the power light will begin flashing on the router. DON'T BE IMPATIENT! This only means the CFE_Updater has begun its work so wait. Once it is finished replacing the stock firmware and erasing the rest of the flash, the router will reboot again.

Confirm that the process is complete by observing continuous ping responses in your still open ping window.

4. Start up the TFTP utility and set the following:

    Server: 192.168.1.1
    Password: <leave blank>
    File: <path to your Gargoyle Image>

Now click the Upgrade button. Once the firmware is sent to the router, it will reboot. The power light will change from flashing to solid when it is ready to be configured @ http://192.168.1.1

If at some point you want to revert to the stock Linksys firmware you can find instructions athttp://www.dd-wrt.com/wiki/index.php/WRT54G-TM

Asus WL500G Premium (V1 & V2)

The Asus WL500G Premium is another router that uses a broadcom wireless chip and is very much like the LinksysWRT54G* routers. You will want to use the generic .trx image for this router. The best way to upload it is using the upgrade utility for Windows that ships with the router. Unfortunately, the upgrade utility on the web interface that ships with this router is incompatible with existing third-party firmware.

Before installing on this router you need to put it in 'diag' mode. To do this, follow the following steps:

  1. Unplug the router's power cord.
  2. Confirm your PC is configured to request an address via DHCP.
  3. Connect the router's LAN1 port directly to your PC.
  4. Push the black RESTORE button using a pen or such, and keep the button pushed down.
  5. Plug the power on while keeping the RESTORE button pushed for few seconds.
  6. When you see a slowly blinking power light, you are in diag mode.

Once you are in diag mode you can use the windows utility to upgrade the firmware.

Alternatively, you can connect to the router via tftp when it is in diag mode. Follow these instructions to transfer and install the image via tftp.

Like the broadcom-based Linksys routers, if you already have other 3rd party firmware such as Tomato or DD-WRT installed, you can upgrade directly from there using the generic broadcom .trx file.

La Fonera

The La Fonera is somewhat different than the other devices listed here. First, it uses an atheros wireless device, and second you must access the RedBoot bootloader to install OpenWrt/Gargoyle. It can be somewhat tricky to install Gargoyle on a factory default La Fonera, so be warned that it is not as straightforward as with the other routers.

The easiest way to install on a La Fonera is to use the FonFlash utility available in the download section to automatically upload the firmware on to the router. However, this may still require that the device be “unlocked”, so that you can access the RedBoot interface (see below).

Read the instructions below carefully before proceeding. For the purpose of these instructions it is assumed you are running linux (or another unix variant) on your local machine and that you have some knowledge of how to configure your network and network services.

Before you can access the RedBoot bootloader, you have to “unlock” the device. There are many methods for doing this, several of which are can be found on the sites below:

  1. Hacking the La Fonera - PART II for Firmware 0.7.0-4
  2. Hacking la Fonera - Part III for Firmware 0.7.1-r1
  3. Kolofonium Hack for Firmware 0.7.1-2

Before you telnet into RedBoot bootloader you may need to put the following lines in your telnet configuration file on your local machine (~/.telnetrc)

192.168.1.254 9000
        mode line

Next, configure your local machine to have a static ip in the 192.168.1.* subnet other than 192.168.1.254. For the purposes of these instructions I will assume you have configured your local machine to ip 192.168.1.3, though everything should work just as well if you replace 192.168.1.3 with another valid IP address.

The next step is to configure a webserver on your local machine. There are multiple web servers available – any will do. Place both the .lzma and the .squashfs atheros image files in the root directory of your web server so that they can be accessed at http://192.168.1.3/[filename].

Now you are ready to telnet into Redboot. Reboot the Router and wait a few seconds, until the light in the middle starts flashing. Then open a new terminal and telnet into RedBoot by running “telnet 192.168.1.254 9000”. Note: The newer Fonera 2.0 models (and posibly the Fon+, I'm not sure) start with ip 192.168.1.1 by default, instead of 192.168.1.254, so you may need to adjust this accordingly.

mockingbird@linuxbox:~$ telnet 192.168.1.254 9000 

Then, hit Ctrl-C to halt the boot process.

Once you are in, execute the commands listed below in the order listed below. Replace 192.168.1.3 on the first line with the ip of your local machine running the web server, if you configured it to have a different ip. Be aware that the “fis create” commands take a VERY long time (20-45 minutes) to run. This is normal. For some reason writing to the flash on a La Fonera is extrordinarily slow, and so installation takes what seems like forever.

ip_address -l 192.168.1.254/24 -h 192.168.1.3
fis init
load -r -v -b 0x80040450 /gargoyle_xxxxxxxx-root.squashfs -m HTTP
fis create -b 0x80040450 -f 0xA8030000 -l 0x006F0000
      -e 0x00000000 rootfs
load -r -v -b %{FREEMEMLO} /gargoyle_xxxxxxxx-vmlinux.lzma -m HTTP
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
fis load -l vmlinux.bin.l7
exec 

The final “exec” command reboots the router. Gargoyle should now be installed and you should be able to ssh in to the router or log on via the web interface.

D-Link DIR-300

Airlink101 AR430W

The D-link/Airlink is very similar to the La Fonera but only has 4MB of flash memory, it uses an atheros wireless device, and second you must access the RedBoot bootloader to install OpenWrt/Gargoyle. It is impossiable to install Gargoyle on a factory default DIR-300, so be warned that it is not as straightforward as with the other routers.

It appears that Dlink in there wisdom have changed the chipset of the DIR-300. This procedure only works for revision A

This procedure has been tested and works with

P/N: IIR300NTO....A1G
H/W: A1 F/W: v1.01-tomi-1.0
S/N: P1RK 1850 XXXXX

WARNING: Bricking you router is a high if you get this procedure wrong. A serial cable should bring it back to life but this is quite involved and requires soldering a header on your circuit board

Install Procedure

We need to install a new redboot to do this we need to go to dd-wrt and lookup D-Link DIR-300 and install the supplied redboot

www.dd-wrt.com

It now appears that DD-WRT have changed the RedBoot in new releases and it now no longer works with gargoyle. Working previous release found here:

http://robin-files.wik.is/Dlink_DIR-300

Windows flashing instruction for the D-Link DIR-300 to DD-WRT (by Brainslayer, modified by Sash)

Install Method

Configure your local ip to 192.168.20.80 connect your lan cable to the WAN port of the router. unplug the power cord and replug it. Now enter the redboot using telnet and ip 192.168.20.81 and port 9000. connect your lan cable to the dir300 wan port. you might need several tries since its only available for 1 second after aprox. 5 sec. of booting (in the appendix is a windows instruction for easy connecting to redboot)

DIR-300 Info:
IP: 192.168.20.81/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.20.80

Now start a local tftp server on your computer and place ap61.ram as well as ap61.rom in the root dir of this server

back to the redboot enter:

load ap61.ram
go

Now a new temporarily bootloader should start. (on serial console it will display some warnings. but you don't need to worry about this) Plug you lan cable to the lan port of the dir-300. reconfigure your ip to 192.168.1.2 and connect via telnet to 192.168.1.1 and port 9000.

Important: while doing the following steps. never unplug the lan cable or the power supply

fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x807f0000-0x80800000 at 0xbffe0000: 
ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
load -r -b %{FREEMEMLO} ap61.rom
Using default protocol (TFTP)
Raw file loaded 0x80080000-0x800a8717, assumed entry  at 0x80080000
fis create -l 0x30000 -e 0xbfc00000 RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0xbfc00000-0xbfc30000: ...
... Program from 0x80080000-0x800a8718 at 0xbfc00000:  ...
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x807f0000-0x80800000 at 0xbffe0000: .
reset

now the unit will reboot and the new bootloader will be executed and is waiting for your connection. this wil take 30+ sec.

connect to the bootloader with telnet on port 9000 and ip 192.168.1.1

Install DD-WRT

now do the following: (consider that fis create operations are taking sometimes several minutes to finish)

ip_address -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
load -r -b 0x80041000 linux.bin 
fis create linux
fconfig boot_script true
fconfig boot_script_timeout 4

now type fconfig again and configure the bootscript to

fis load -l linux
exec

now type reset again. the unit should now boot dd-wrt and work as known from other atheros based platforms

Install Gargoyle

If DD-WRT is all ready installed on your router start installing Gargoyle form this point.

  • Download and run Fon Flash (special version required)
  • Select correct ethernet port
  • Load gargoyle files
    • gargoyle_x.x.xx-atheros-root.squashfs
    • gargoyle_x.x.xx-atheros-vmlinux.lzma
  • Plug ethernet cable between router and PC
  • Unplug power to router
  • With fon flash click “Flash router now!”
  • Plug in power to router
  • Wait 20 - 30 minutes for router to finish flashing

Router should automatically reboot and install procedure is finished

{{:fon_flash3.png|

Windows easy connecting to redboot

Appendix: download putty.exe to c:\ create a file an c:\ called redboot.bat with the following content:

rem echo off
:start
rem ------------------------------------------------
ping 192.168.20.81 -n 1 -w 1 > NULL
IF ERRORLEVEL 1 goto start
rem putty
rem ------------------------------------------------
break
putty.exe telnet://192.168.20.81:9000 -m redboot.txt
exit

create a file on c:\ called redboot.txt with the following content:

^C

start the bat file and power on the router…..here comes redboot

Other Routers

These are the only routers Gargoyle has been tested/validated on. However, there are likely many others that will work. My budget for routers is rather limited so I haven't been able to acquire other models to test on (yet). PLEASE report successes/failures in the forum so that everyone can get a better idea of what works and what needs work.

Anyone interested in trying to get a specific model working should contact me and I will likely be happy to help. (NOTE: I do mean HELP – you'll still have to do the heavy lifting). Gargoyle aims to be as flexible and hardware-independent as possible, and over time I anticipate hardware compatibility to expand significantly.

Installing Gargoyle As A Set Of Packages

Finally, if you have OpenWrt Kamikaze installed, it's very straightforward to install Gargoyle as a set of packages.

SSH into the router and take a look at the /etc/opkg.conf file:

src/gz snapshots http://downloads.openwrt.org/kamikaze/8.09.1/brcm-2.4/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /jffs

You need to add a line to this file, and it will be slightly different depending on whether you have a broadcom or an atheros based router. You can tell by looking at the first line already in the file. In the file above the first line indicates that this is a broadcom router because it ends with /brcm-2.4/packages. If it were an atheros router it would end with /atheros-2.6/packages. If, as in the file above, you have a broadcom router, add the following line to the file:

src gargoyle http://gargoyle-router.com/packages/kamikaze0809/brcm-2.4 

If it's an atheros router, add this line:

src gargoyle http://gargoyle-router.com/packages/kamikaze0809/atheros-2.6 

Then run “opkg update” to update opkg with information about gargoyle. The router must be connected to the internet for this to work:

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09.1/brcm-2.4/packages/Packages.gz
Connecting to downloads.openwrt.org (195.56.146.238:80)
Packages.gz          100% |*****************|   130k 00:00:00 ETA
Inflating http://downloads.openwrt.org/kamikaze/8.09.1/brcm-2.4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/snapshots
root@OpenWrt:~#

Before you begin installation on a broadcom router you should verify that you have ~800kb of free space available, or ~2.0Mb on an atheros router. That's how much space gargoyle, along with all of it's dependencies requires. Atheros requires so much more space because it requires libopenssl (which is HUGE) to enable WPA wireless encryption.

The next (and final) step is to actually install the packages. If you're running a broadcom router, especially one with lots of memory, this is very simple. Merely run “ipkg install gargoyle”

root@OpenWrt:~# opkg install gargoyle 

However, if you're on an atheros router there's a a chance you will run into a problem. Sometimes the opkg package manager crashes if you try to install too large a package (or a package with lots of dependencies) all at once (though it is much better than it's predecessor ipkg). This MAY also be an issue on some broadcom routers with small amounts of memory. The best way to get around this is to install all the dependencies, one at a time, before trying to install gargoyle. You can run these commands one at a time or put them into a shell script to run at once. Ignore the first three lines if you are running a broadcom router:

opkg install libopenssl
opkg install hostapd
opkg install wpa-supplicant


opkg install tc
opkg install kmod-sched
opkg install kmod-ipt-imq
opkg install kmod-ipt-filter
opkg install kmod-ipt-ipopt
opkg install kmod-ipt-conntrack
opkg install miniupnpd
opkg install ntpclient
opkg install uci
opkg install haserl-dev
opkg install qos-gargoyle
opkg install ddns-gargoyle
opkg install httpd-gargoyle
opkg install bwmon-gargoyle
opkg install gargoyle 

… And that's it. You're done. Gargoyle should now be installed and accessible via the web interface at your router's ip address.

If you still are having trouble getting the gargoyle packages to install because of memory issues, first try rebooting the router. Sometimes this frees enough memory to make the installation work. If that doesn't work consider trying to install from one of the full images as described below which do not rely on using OpenWrt's (terrible) package manager.

 
install_guide.txt · Last modified: 2010/01/31 01:53 by ispyisail
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki