Hack LA FONERA.

La verdad es que estoy muy contento que exista FON, su idea, su objetivo, los logros hechos desde el 10-2005 (cuando lo conocí). Martín me parece una persona muy curiosa, que impulsa las cosas, que tiene el capital y la fuerza para hacer muchisimas cosas mas. Digamos que no solo "no tengo problemas con FON" sino que tambien "me encanta FON"...

Ahora bien, me ocurre que ademas de FONERO, quiero potenciar y mejorar las funciones de FON para con el menor hardware posible, sin tirar cables, cómodamente hacer mas cosas.


¿ Que necesito ?


Ampliar la red de cobertura colocando otra fonera en la otra punta del piso que haga WDS. Con eso amplio la cobertura de la primer FONERA y además llegaré con mejor señal hacia otro lado de mi comunidad, tengo la suerte de vivir en un 6to con vision abierta y muchisimos vecinos. Quiero brindar mas señal pero no quiero llenar mi casa de cables para poder colocar foneras en varios lugares.

¿ Que pienso hacer ?

Mantener el firmware de FON, pero darle la funcionalidad WDS.
Poner otras Foneras con WDS.
Seguir siendo FONERO como hasta ahora pero con mejor cobertura.
En un futuro poner antenas mejores (todavia espero a Los Reyes que me dijeron que me enviarían una antena... todavia no llegó, estarán demorados...)


¿ Cómo ?

* Fonera v 0.7.0 R4 (es una version vieja del firmware que permite hack por soft)

* Crear dos paginas HTML en mi portatil, conectar el portatil a la fonera por WIFI Privada (wpa2), invocar la primer página, invocar la segunda.

< span style="font-weight:bold;">PAGINA1.HTML
< html>
< head>
< /head>
< body>
< center>
< form method="post" action="http://192.168.10.1/cgi-bin/webif/adv_wifi.sh" enctype="multipart/form-data">
< input name="wifimode" value="/usr/sbin/iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT" size="68" >
< input type="submit" name="submit" value="Submit" onClick="{this.form.wifimode.value='";' + this.form.wifimode.value +';"'}" />
< /form>
< /body>
< /html>


PAGINA2.HTML
< html>
< head>
< /head>
< body>
< center>
< form method="post" action="http://192.168.10.1/cgi-bin/webif/adv_wifi.sh" enctype="multipart/form-data">
< input name="wifimode" value="/etc/init.d/dropbear" size="68" >
< input type="submit" name="submit" value="Submit" onClick="{this.form.wifimode.value='";' + this.form.wifimode.value +';"'}" />
< /form>
< /body>
< /html>


* Entrar a la fonera por ssh, a 192.168.10.1 (root/password)

* mv /etc/init.d/dropbear /etc/init.d/S50dropbear

* quitar comentarios en dos lineas que permitiran el acceso ssh
vi /etc/firewall.user
iptables -t nat -A prerouting_rule -i $WAN -p tcp—dport 22 -j ACCEPT
iptables -A input_rule -i $WAN -p tcp—dport 22 -j ACCEPT
esc :wq

* modificar el final de /tmp/.thinclient para impedir la ejecucion automatica del thinclient y crear copia del thin

vi /bin/thinclient
# . /tmp/.thinclient.sh
cp /tmp/.thinclient.sh /tmp/copia_thinclient_$(date '+%Y%m%d-%H%M')


AHORA ESTOY POR ACA:
http://www.bandaancha.st/foros.php?temid=1116809

La fonera al reiniciarse permite acceso por HTTP, SSH y funciona normalmente.
Le he fijado un IP para la boca LAN, para poder obtener internet de ese punto.

En Los ficheros /etc/firewall.fon y /etc/firewall.user he comentado (#) los DROPs, para que no haya reglas restrictivas en el firewall. (iptables)

Editar el fichero /etc/fon, para que la placa WAN/cableada tenga siempre 192.168.2.1
___ config network wan
___ option mode static
___ option ipaddr 192.168.2.1
___ option netmask 255.255.255.0
___ option dhcp 1


Hasta ahora al iniciar (la fonera) pone 192.168.10.1 en wifi y 192.168.2.1 en WAN, con ssh activado.

*******************************
*******************************
** AHORA POR ACA **************
*******************************
*******************************

http://www.dd-wrt.com/phpBB2/viewtopic.php?t=9011

pc cable con 169.254.255.166

via cable serial
cd /tmp
wget http://169.254.255.166/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
reboot

cd /tmp
wget http://169.254.255.166/out.hex
mtd -e "RedBoot config" write out.hex "RedBoot config"
reboot

pc con 192.168.1.99
telnet 192.168.1.254 9000
activar el tftp

cable red
ip_addr -h 192.168.1.199 -l 192.168.1.254/24

Algunos de estos no muestran nada en pantalla y tardan varios minutos, si no da error al tipear, esperar....

ESTO ES PARA OPENWRT
fis init
load -r -v -b 0x80040450 openwrt-atheros-2.6-root.jffs2-64k
fis create -b 0x80040450 -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
fis load -l vmlinux.bin.l7
exec
ESTO ES PARA OPENWRT

ESTO ES PARA DDWRT
fis init
load -r -v -b 0x80041000 root.fs
fis create -b 0x80041000 -f 0xA8030000 -l 0x002C0000 -e 0x00000000 rootfs
load -r -v -b 0x80041000 vmlinux.bin.l7
fis create -r 0x80041000 -e 0x80041000 -l 0x000E0000 vmlinux.bin.l7
fis create -f 0xA83D0000 -l 0x00010000 -n nvram
reset
ESTO ES PARA DDWRT

192.168.1.1


en /etc/init.d/S90DAC

#!/bin/sh
wlanconfig ath1 destroy
wlanconfig ath5 create wlandev wifi0 wlanmode ap
wlanconfig ath1 create wlandev wifi0 wlanmode wds

iwconfig ath5 essid link

#iwconfig ath5 key 12312312312313212312
# Para empezar, nada de seguridad

iwconfig ath5 channel 6
#(de nada sirve, se vuelve al 1)

# mac del router con wds (linksys)
iwpriv ath1 wds_add aa:aa:aa:aa:aa:aa


#esta es la mac wireless del router linksys
iwpriv ath1 wds 1
iwpriv ath5 wds 1
ifconfig ath5 up
ifconfig ath1 up

# definir una interfaz bridge
brctl addbr br0
brctl addif br0 ath1
brctl addif br0 ath5
ifconfig br0 up
ifconfig br0 192.168.10.2 netmask 255.255.255.0

#ahora accedo al router usando esa IP
route add default gw 192.168.10.1


Ahora estoy tambien probando con un Kamikaze (openwrt 2.6) veremos en donde logro que funcione.
El tema WDS es una tonteria pero aun no funciona....


ESTO NO ESTA PROBADO ------------------
/etc/config/wireless:
config wifi-device wifi0
___ option type atheros
___ option channel 6
config wifi-iface
___ option device wifi0
___ option mode wds
___ option ssid PZO2
___ option hidden 0
___ option encryption none

/etc/config/network
config interface loopback
___ option ifname lo
___ option proto static
___ option ipaddr 127.0.0.1
___ option netmask 255.0.0.0

config interface lan
___ option ifname eth0
___ option proto static
___ option ipaddr 192.168.1.50
___ option netmask 255.255.255.0
___ option gateway 192.168.1.1
___ option dns 192.168.1.1
ESTO NO ESTA PROBADO ------------------



ALGO DE INFO SOBRE EL TEMA
* Repositorio de paquetes para FONERAS.
http://fon.rogue.be/lafonera-0.7.0-rev4/

* La fonera si no se conecta a internet, genera una red virtual 169.254.255.1/255.255.0.0 en la interfaz cableada, que se puede usar para conectarse a ella.

Algunos links interesantes...
http://www.fonera.info/index.php/topic,19.0.html
http://www.fonera.info/index.php/topic,44.0.html
http://www.fonera.info/index.php/topic,32.0.html
http://www.fonera.info/index.php/board,3.0.html
http://wiki.openwrt.org/OpenWrtDocs/Hardware/Fon/Fonera
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=9011&postdays=0&postorder=asc&start=15&sid=27078dad7d3534d1cb28665be0319199
http://fon.freddy.eu.org/fonera/bridge-private-wlan/

Comentarios

Entradas populares de este blog

Como ganar al apalabrados, trucos, trampas... y algo mas.

Una semana en la vida de un DBA (aún vivo)...