I was looking around , in my needs to build a wireless mesh network for an hotel Fon installation , and I found a lot of resources , mainly written in italian to transform la fonera in a wireless repeater. I didn’t found much in english , so I decided to write this post with the aim of make you build your wireless repeater in 5 easy steps.
first step
Get a shell acces to la fonera. To do this you have multiple choices . One of them , besides asking google , is using the search function whithin this blog.
second step
Deactivate chillispot , thinclient and the conncheck function on la fonera. This is done , performing the following commands on the shell prompt:
mv /etc/init.d/N10conncheck /etc/
mv /etc/init.d/N40thinclient /etc/
mv /etc/init.d/N50chillispot /etc/
third step
remove all cronjobs
crontab -e
It will appear a list of cronjobs , it’s enough to cancel everything , using the command “a” (vi insert mode ) positioning the cursor at the end o the lines and hitting the back button on the keyboard. Once blanked the file hit “esc” and type “wq”
fourth step
Modify the /etc/dnsmasq.conf file:
rm /etc/dnsmasq.conf
vi /etc/dnsmasq.conf
dhcp-leasefile=/tmp/dnsmasq.leases
interface=ath0
dhcp-range=192.168.10.50,192.168.10.100,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.10.1
dhcp-option=6,192.168.10.1
A little explanation to this . We will create in step 5 a script which will bring up a wireless network ath0 who will broadcast the extender SSID. In order to get an ip address a default gateway and a dns server , we need to modify the dnsmasq configuration.
fifth step
Create the init script to set la fonera as a wireless repeater
#!/bin/sh
# /etc/ponte
#*******************************************************
# this script force router fonera to act as:
# - repeater (of an external AP) on ath1, configured via dhcp
# - Access Point on ath0 (hard-coded as 192.168.10.1/24) with
# SSID "ponte-"
# the two subnet are then routed.
#
# You can associate your WiFi-interface to the AP builded on ath0
# iwconfig essid 'ponte-'
# ifconfig 192.168.10.nnn netmask 255.255.255.0 up
# route del default
# route add default gw 192.168.10.1
#
# Powering off, fonera returns in standard mode !
# The script must be executable and located in /etc
#
# ansanto@interfree.it
#*****************************************************
#
# stop daemons
killall -9 udhcpc
killall dnsmasq
# flush netfilter tables
iptables -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -F
# create new VAPs devices
wlanconfig ath0 destroy
wlanconfig ath1 destroy
# VAP ath0 as Access Point
wlanconfig ath0 create wlandev wifi0 wlanmode ap
# VAP ath1 as station managed
wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon
# nosbeacon disables the use of hardware beacon timers for ath1
# (the station should not modify the TSF clock for the AP)
# discover external dhcpd settings for ath1
udhcpc -i ath1
# setup ath0 with a proper SSID and IP
iwconfig ath0 essid "repeater"
ifconfig ath0 192.168.10.1 netmask 255.255.255.0 up
killall -9 N50chillispot
killall -9 chilli
# insert here some ath parameters
route add default gw 192.168.182.1
dnsmasq
# ip_forward is set to 1 by default in fonera configuration
# echo 1 > /proc/sys/net/ipv4/ip_forward
# forwarding between the two subnets
iptables -t nat -A POSTROUTING -o ath1 -j MASQUERADE
# setup eth0 on a wired LAN
#ifconfig eth0 172.16.0.126 netmask 255.255.0.0 up
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# firewall
# you can add here your personal netfilter setup
# have fun!
The syntax is pretty clear and commented . If you want to personalize the script , you can edit the ifconfig ath0 192.168.10.1 netmask 255.255.255.0 up part , putting the desired ip address for te AP interface. Another tweaking is the desired SSID you want to repeat . If you know the source you want to repeat , you can swap udhcpc -i ath1 with iwconfig ath1 mode managed ap 00:01:02:03:04:05 replacing 00.01.02.03.04.05 with the SSID af the AP you want to repeat .Once finished , name this script as bridge and save it in /etc. Make it executable with chmod +x /etc/bridge and try to launch it with /etc/bridge.
If everything goes well , your fonera will repeat the signal of your first main fonera .To make everything works after reboot place the bridge script in the init.d directory with cp /etc/bridge /etc/init.d/S98bridge and you are done.
Let me know if everithing goes well , and don’t forget always to preserve Fon functionality on your wireless network , activating the chillispot auth and the thinclient script in the main node.
credits
Antonio Anselmi resource page on la fonera.
Paolo Gatti weblog with a lot of resources on la fonera
This post on eftecno.com with a lot of comments , tip and tricks.
update 20/02/2007
German speakers can follow discussion at http://tinyurl.com/39sawm





skynetbbs 4:59 pm on February 19, 2007 Permalink |
Nice…i’ll try this out… btw is there a limitation on how many times a signal can be repeated?
dema 5:08 pm on February 19, 2007 Permalink |
@skynetbbs it should be enough to change the lines ifconfig ath0 192.168.20.1 netmask 255.255.255.0 up , iwconfig ath0 essid “repeater#2” and route add default gw 192.168.10.1 in the bridge script and change the dnsmasq.conf configuration in dhcp-leasefile=/tmp/dnsmasq.leases
interface=ath0
dhcp-range=192.168.20.50,192.168.20.100,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.20.1
dhcp-option=6,213.134.45.129
I will post my report once I will get the hardware for build the hotel wireless mesh network.
Bye
kyros 1:29 am on February 20, 2007 Permalink |
Hi dema!
Just one question: Sorry that I cannot figure it out of the code (I’m not an expert)but does this repeat both WLAN SSIDs or just the FON one?
Is it possible to determine which one of the both should be repeated and is it possible to alternate the SSID repeated or to repeat both SSIDs?
Regards, Kyros
dema 8:26 am on February 20, 2007 Permalink |
@kyros la fonera repeater should pick up the strongest signal and repeat it. To repeat a selected wifi signal , you should replace udhcpc -i ath1 with iwconfig ath1 mode managed ap 00:01:02:03:04:05 where 00:01:02:03:04:05 is the MAC/BSSID of the AP you want to repeat and apply afterward udhcpc -i ath1 if you can receive DHCP or ifconfig ath1 –IP address– netmask –netmask– up to manually give an IP address , fill with a dns entry the file resolv.conf and assigning the default route with route add default gw –gateway–.
It’s possible also to repeat the crypted wlan , but it needs more tweaking such as adding the wpa _supplicant and libopenssl support to the repeater.
skynetbbs 8:32 am on February 20, 2007 Permalink |
@dema is it also possible to bind the “lan” port of the repeaterport?
Hence if we provide this “hotspots” in every hotelroom; people without a wifi card can connect to the available LAN port and register via the LAN port to FON and surf “wired”? and the wireless will be how the FON signal will be propagated? eg “bind” the eth0 to the ath0?
Also I notice you change the ESSID of the repeater in #2 …
currently in a “networked” environment… I give all the accesspoints thesame SSID… so people come in and see FON_HOTEL (10) with 10 as possible accesspoints within reach… If 1 fonera starts upgrading the others will do the failover without a glitch as well…
(and probably 10 is a bit much, hence only 3 channels don’t overlap :^)
I also (trying to comprehend your script) there will only be 1 chillispot running and that’s on the one connected to the internet?
what about the “fon ping”-tool? hence shouldn’t they all be telling fon they are alive? or is that part still working?
dema 10:26 am on February 20, 2007 Permalink |
@skynetbbs
1)
lan port can bind to wireless connection adding to the script the line ifconfig eth0 172.16.0.126 netmask 255.255.0.0 up
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
and editing the dnsmasq.conf file with
dhcp-leasefile=/tmp/dnsmasq.leases
interface=ath0
interface=eth0
dhcp-range=192.168.10.50,192.168.10.100,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.10.1
dhcp-option=6,192.168.10.1
2)i change the essid to #2 for the second repeater which should repeat the signal of the first repeater.
3)ideally the chillispot and the heartbeat function is managed only by the first fonera attached to the wan port of the dsl router. I need to try several authentications since I’m thinking that with this method only the first person who connect to the repeater has to enter the fonero login . The forthcoming person who connect to the repeater perhaps bypass the radius auth as the repeater is already authenticated. I need to make further testings , but in theory base should be like that.
mhap 1:11 pm on February 20, 2007 Permalink |
Thanks, looks very interesting. Don’t you want to work for FOn?
But
> replacing 00.01.02.03.04.05 with the SSID af the AP you want to repeat
Isn’t “MAC” instead of SSID the right spelling?
Thanks
claudio 8:32 pm on February 20, 2007 Permalink |
hey – the hack addon of comment #6 looks like a pretty interesting thing – this hack can open the LAN port so the fonera can be used as wireless extension to get wifi access! – anybody tried that yet?
dema – would you mind to write a howto for that hack? I do not get where to add the lines provided. thx!
claudio
MWS 9:46 pm on March 5, 2007 Permalink |
Hey… I did/attempted this and now I cannot connect to my fonera. (stupidly, I misread the intro… I thought this could repeat my Dlink router and still preserve FON functionality.) Anyway, I get the “limited or no connectivity” stuff from windows. I also tried holding the reset button for like 60 seconds, but to no avail. Is there any way I can undo this (other than using serial port)?
antonde 5:14 am on March 6, 2007 Permalink |
Don’t panic.
If you just paste exactly the lines of the bridge script you can :
And you should be done. Your Fonera should return at his normal functionality.
Lemme know !
redz 5:36 am on March 11, 2007 Permalink |
sir, where and how to do this script to enable as a repeater for my dlink router. thanx
antonde 10:51 am on March 11, 2007 Permalink |
@redz , follow step by step the instructions on fonera side . To connect to an encrypted ap such as your dlink (i guess is encrypted , isn’t it ? ) , if in wep flavour , substitute the line
with
.
If your dlink router is encrypyed in WPA flavour , you need some more tweaking .
Check this howto from Antonio Anselmi
redz 11:22 am on March 11, 2007 Permalink |
yes sir. dlink is on WEP. and how to insert those scripts? sorry but i’m noob to pc world
igul222’s Blog » Use La Fonera as a Wireless Repeater 8:54 pm on March 19, 2007 Permalink |
[...] http://fonblog.wordpress.com/2007/02/19/fonera-as-a-wireless-repeater/ [...]
sergio91 11:53 am on March 23, 2007 Permalink |
By using FON as a repeater does it stops working as hotspot for other ppl?
antonde 3:10 pm on March 23, 2007 Permalink |
@sergio91 the scrip to preserve fon captive portal functionality is written in my moleskine blog
enrico 10:23 pm on April 7, 2007 Permalink |
I have a problem with my zyxel router, which is probably rather trivial: Basically, both the connection from my laptop to the fonera and from the fonera to the zyxel router seems to work (I can even access the zyxel router login page in my browser via a connection over the fonera).
However, I cannot access random internet pages, e-mail or ftp (apart from sites that were in my browser cache and linked sites under the same TLD). What could be the problem?
dema 7:41 am on April 10, 2007 Permalink |
@Enrico , the symptoms you describe could be related to sluggish dns server. But could be also something else . I really cannot tell for sure basing only on what you said. I’m sorry .
Bye
aladin 7:47 pm on April 13, 2007 Permalink |
My config: Freebox(-Router config from free)+Fonera+ another Fonera as a repeater+PC in dhcp from second fonera SSID.
As I was doing the test with either ponte or ponte2 config, I realize that I have the same prb with DNS
ipconfig /all gave me a good Ip adresss , a good gateway , but a bad DNS that was 255.255.255.0
That could explain the fact that its impossible to surf even if we have the network on.
any Idea ?
peterete 6:52 pm on June 17, 2007 Permalink |
did it work ?
did you install some foneras with this script and all replicate a FON_xxx ?
it dosn’t work for me.
peterete 9:02 pm on June 18, 2007 Permalink |
All is right, i guess…
from 192.168.2.1 (linksys with ddwrt), I can ping 192.168.2.5 (using wifi) to Remote Router (fonera)
but I connect a PC to FONERA, use a fix ip 192.168.10.2/255.255.255.0/192.168.10.1, and I can not ping .
whats the problem with the net ?
thanks
wireless configuration
**********************
lo no wireless extensions.
eth0 no wireless extensions.
wifi0 no wireless extensions.
ath0 IEEE 802.11g ESSID:”G31R”
Mode:Master Frequency:2.462 GHz Access Point: 00:18:84:10:XX:XX
Bit Rate:0 kb/s Tx-Power:18 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:4141-4141-41 Security mode:restricted
Power Management:off
Link Quality=56/98 Signal level=-40 dBm Noise level=-96 dBm
Rx invalid nwid:2 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
ath1 IEEE 802.11g ESSID:”G31″
Mode:Managed Frequency:2.462 GHz Access Point: 00:0C:11:22:XX:XX
Bit Rate:36 Mb/s Tx-Power:18 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:4141-4141-41 Security mode:restricted
Power Management:off
Link Quality=56/98 Signal level=-40 dBm Noise level=-96 dBm
Rx invalid nwid:1088 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
IP configuration
****************
ath0 Link encap:Ethernet HWaddr 00:18:84:10:XX:XX
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2556 (2.4 KiB) TX bytes:1046 (1.0 KiB)
ath1 Link encap:Ethernet HWaddr 00:18:84:10:XX:XX
inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:236 errors:0 dropped:0 overruns:0 frame:0
TX packets:168 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:21152 (20.6 KiB) TX bytes:47434 (46.3 KiB)
eth0 Link encap:Ethernet HWaddr 00:18:84:10:XX:XX
inet addr:192.168.4.5 Bcast:192.168.4.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3528 (3.4 KiB)
Interrupt:4 Base address:0×1000
eth0:1 Link encap:Ethernet HWaddr 00:18:84:10:XX:XX
inet addr:169.254.255.1 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:4 Base address:0×1000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:82 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7216 (7.0 KiB) TX bytes:7216 (7.0 KiB)
wifi0 Link encap:Ethernet HWaddr 00:18:84:10:XX:XX
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3204 errors:0 dropped:0 overruns:0 frame:160
TX packets:251 errors:1 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:199
RX bytes:380905 (371.9 KiB) TX bytes:58966 (57.5 KiB)
Interrupt:3 Memory:b0000000-b00ffffc
routing table
*************************
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 ath1
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 ath0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 ath1
networks received by station ath1
*********************************
ath1 Scan completed :
Cell 02 – Address: 00:0C:11:22:33:46
ESSID:”G31″
Mode:Master
Frequency:2.462 GHz (Channel 11)
Quality=40/98 Signal level=-56 dBm Noise level=-96 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s
Extra:bcn_int=100
Extra:wme_ie=dd180050f2020101800003a4000027a4000042435e0062322f00
peers on Acces Point ath0
*************************
ADDR AID CHAN RATE RSSI DBM IDLE TXSEQ RXSEQ CAPS ACAPS ERP STATE MODE
00:90:4b:ef:XX:XX 1 11 36M 71 -24 120 11 31920 EPSs 0 27 Normal WME
peterete 9:16 pm on June 18, 2007 Permalink |
more (last) info….
i can connect a PC with WIFI to FONERA (as repeater), but never received an IP.
any ideas ?
bishop 8:57 pm on October 30, 2007 Permalink |
Hi guys,
I really want to do this mod, but i can’t seem to access the fon via ssh… i have installed dd-wrt on the fon, so the hack has already been done, but i can not access it. I have tried to do the ssh hack again, but it doesn’t work – I just get connection refused.
Sorry to ask a question that probably makes me seem ignorant of this blog and the posts.
Any help is appreciated, thanks in advance.