Inicio > Geek, General > NoCatSplash en Linksys WRT54g

NoCatSplash en Linksys WRT54g

2 marzo, 2006

Sin ningún tipo de ncesidad real y solo como un laboratorio, decidí instalar NoCatSplash en mi Linksys WRT54g (version 3) con OpenWRT whiterussian RC4.

La tarea no fue dificil, pero tampoco fue tan simple como parecía. El tema es que desde la pantalla web de admisnitración de software de OpenWRT elegí la opción para instalar NoCatSplat, y me dio problemas con un paquete que debía instalar pero que no encontraba. El error es el siguiente:

ERROR: Cannot satisfy the following dependencies for nocatsplash:
iptables-extra

Como se puede observar el paquete en cuestión es iptables-extra, el cual efectivamente no existe en whiterussion RC4 (ignoro si en RC3 existía o no), pero ipkg insistía en que debía instalarlo.

Recurrí entonces a foros y distintos sitios web, hasta que encontré este workaround. En concreto la solución que plantea es ignorar esa dependencia (ya que en realidad lo que esta mal es el nombre del paquete) y de esta manera se instalo bien.

Por supuesto, que todo esto después de varias pruebas en las cuales instaló otras dependencias que si eran correctas.

Luego de esto, había que configurar el nocatsplah y por supuesto no tenía muy en claro como, asi que después de jugar un poco con el archivo de configuración y buscar por más foros y sitios web, encontré un link (que resulta ser el cache de google, ya que en el sitio original parece que ya no esta) y simplemente agregando ipt_REDIRECT donde dice mas abajo, voila!!!

Ahora tengo mi NoCatSplash funcionando, aunque no se muy bien para que, ya que realmente no lo necesitaba, pero valió la pena para aprender un poco más del tema.

Actualizacion: Por las dudas que expire el cache de Google, copio aqui el texto del ultimo link al que hacia referencia mas arriba.

[BNM] OpenWRT plus NoCatSplash HOWTO (was BNM Wi-fi (was Wi-fi in Steyning))
Dave Phelan dave.phelan at gmail.com
Tue Sep 13 00:15:32 BST 2005

* Previous message: [BNM] [OT] Cheap MP3 Player needed
* Next message: [BNM] OpenWRT plus NoCatSplash HOWTO (was BNM Wi-fi (was Wi-fi in Steyning))
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

On 9/12/05, Dave Phelan wrote:
> really should write a
> step-by-step howto.

Hey, I’m 39 in 90 minutes. Let’s see if I can do one before I start on
my 40th year. Here goes:

== piertopier.net OpenWRT node HOWTO ==
version 0.1 (draft)
2005-09-12
Some Rights Reserved: http://creativecommons.org/licenses/by-sa/2.0/uk/

Here follows instructions on taking a factory default Linksys WRT54G
accesspoint, reflashing it to OpenWRT (http://openwrt.org) and
installing the NoCatSplash captive portal.

1. Set boot_wait

All reflashing instructions recommend this. The system variable
boot_wait being set means the WRT54G will enter a known state for 3
seconds before booting, which will allow you to recover from a
corrupted firmware image.

There are various mechanisms for setting boot_wait. The openWRT
instructions are here:
http://openwrt.org/OpenWrtDocs/Installing#head-76921c79e7c7ed3b03d3bc9a40b1a2c792c215b0
They cover both pasting shell code into the ping window on the web
front end of the standard Linksys firmware, and using non-standard
methods like a serial port.

This bit may be hard. The ping page hack may not work with your
version of the Linksys firmware, so you may need to downgrade to an
earlier version. Download the Linksys firmware from the Linksys FTP
site: ftp://ftp.linksys.com/pub/network/ and follow the in structions
below to load it.

2. Reflash

Caveat: this *will* void your warranty.

Download the openWRT firmware from here:
http://downloads.openwrt.org/whiterussian/rc2/bin/

You want white russian, release candidate 2(RC2), and then the
openwrt-wrt54g-jffs2.bin image (assuming a WRT54G, and not a WRT54GS).

The WRT54G firmware can be upgraded through the standard web
front-end. Click on the Help tab. Select the Administration tab, and
then the Upgrade Firmware option.

Browse to the firmware you downloaded.
Click the Upgrade button to upgrade the firmware.

Details are in the Linksys User Guide, downloadable from here:
http://www.linksys.com/servlet/Satellite?childpagename=US%2FLayout&packedargs=c%3DL_Product_C2%26cid%3D1124916802645&pagename=Linksys%2FCommon%2FVisitorWrapper

The AP should reboot, and when it returns, you will be able to telnet
to it from the ‘inside’ (wireless or the 4 non-internet ports). It
will retain the same IP address you were using previously, and will
function as an AP as before. But without the Linksys web interaface.

You really want to be SSHing, but that can wait for a later version of this.

3. NoCatSplash

>From the lovely openWRT command line do the following:

ipkg update
ipkg install nocatsplash

It should update the packgae list, then install NoCatSplash and dependancies.

Then find the initialise.fw script, and edit it with vi:

vi /usr/lib/nocat/initialize.fw

find the section that reads

for module in ipt_TOS ipt_mac; do
insmod $module
done

Modify it to:

for module in ipt_TOS ipt_mac ipt_REDIRECT; do
insmod $module
done

and save.

Test this out by running dplashd (the NoCatSplash binary) from the command line:

/usr/sbin/splashd

Then try and connect a new machine to the wifi. You should see it
captured on the console log, and a captive portal page (NoCat
standard) displayed when the test client initiates a web session.
Click on login on the client and away you go.

Create a script to allow NoCatSplash to start automatically when the AP boots:

vi /etc/init.d/S60nocat:

#!/bin/sh
#
# start/stop splashd super server.
case “$1” in
start)
echo -n “Starting NoCat splash server:”
echo -n ” splashd” ;
/usr/sbin/splashd -D &
echo “.”
;;
stop)
echo -n “Stopping NoCat splash server:”
echo -n ” splashd” ;
killall splashd
echo “.”
;;
restart)
echo -n “Restarting NoCat splash server:”
echo -n ” splashd”
$0 stop
$0 start
echo “.”
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
;;
esac

Make the script executable:

chmod 755 /etc/init.d/S60nocat

Reboot your AP to make sure it all works. If it still does, then
you’ll want to modify the splash pages. You want to edit splash.html
in the /usr/share/nocat/htdocs directory. There’s a piertopier.net
script available that will download all the required splash page
gubbins to the correct place.

Ends.

PLEASE NOTE: this is an *untested* draft HOWTO. The author and/or
piertopier.net accept *no responsibility* for any damage caused by
following it.

Phew. I’m older now.
Hope this helps someone.

Dave Ph


Dave Phelan CCIE#3590 ICQ: 50180416 GSM: +44 (0)7740 186987
dave.phelan at gmail.com http://www.davephelan.org
“It may be the warriors that get the glory, but it’s the
engineers that build society” — B’lanna Torres, ST:Voyager 7.10

Anuncios
Categorías:Geek, General
A %d blogueros les gusta esto: