How to build a mesh network with WRT54Gs
Updated
This is just a quick bit of techie documentation capturing what I did. I figured most of this out thanks to:
http://csircoin.blogspot.com/2005/06/setting-up-olsr-mesh-on-linksys.html
Florian Walther and a bunch of other guys from olsr-users at olsr.org.
Here is my plan: Take a bunch of Freifunked WRT54Gs and disperse them around the neighborhood, preferable on rooftops with antennas. Some of these would be connected to VSAT systems and therefore provide a route to the web. Then whoever wants to jump on the mesh, just turns on their machine and connects with normal DHCP to the ad-hoc network supplied by the mesh.
Here is my step by step:
Take a stock WRT54G, connect to it via the web interface. Upload the freifunk firmware. It will reboot, then you can connect to it on the same address: 192.168.1.1. You will do this for all of your WRT54Gs (if you only have one or none, for that matter, you can still build a mesh network with a PC running the OLSR.org software).
Next I configured the boxes to have sane IP addresses, to offer separate blocks of IP addresses to clients, and to maximize the distances they cover. Here are the settings. I copied most of the plan from Florian’s topology diagram. Here are the changes I made from the default settings:
OLSR
OLSR DHCP: 104.3.2.0/26,255.255.255.192
Wireless
WLAN Protocol: Static
IP Address: 104.3.2.1
Netmask: 255.0.0.0
WLAN Mode: Ad Hoc (Peer to Peer)
ESSID: Lil-Mesh
TX Power: 84
Radio Mode: B Only
Transmission Rate: 1 Megabit/s
LAN
LAN Protocol: Static
LAN IP:192.168.5.1
Netmask: 255.255.255.0
Disable Firewall: Checked
WAN
WAN Protocol: DHCP
Hostname: lil1-wrt54g
The second and third boxes were similar. Differences for the second box:
OLSR
OLSR DHCP: 104.3.2.64/26,255.255.255.192
Wireless
IP Address: 104.3.2.65
LAN
LAN IP:192.168.6.1
WAN
Hostname: lil2-wrt54g
Once that is done you can power up all of your WRT54Gs. If you have an internet connection from a DSL modem, or a shared internet connection then plug that into the internet port of one of the WRT54Gs. The mesh will then calculate all of the optimum routes to one another, including routes to the closest internet connection. Now connect your clients to them with either an ethernet cable or with a wireless connection. Finished!
Update:
I found that I didn’t need any of the HNA entries - and also turning on NAT made things simpler. I just successfully googled from a neighbors house about 1/4 mile away using the mesh. I am on my way!
Solar powered mobile phone towers
It looks like a solar powered mobile phone tower has been developed and deployed in Malawi.
The solar-powered base station does not rely on either mains power or a diesel generator for back-up, so each site will be significantly cheaper to...
Wireless Mesh Networking in the news
It sounds like some companies are trying to capitalize on the wireless mesh networking. The idea is pretty simple - let neighbors with broadband connections join them together to increase the total bandwidth that is available to them. The situation...

Lee said,
July 22, 2005 @ 6:36 pm
is it possible to split the lan into two subnets (nat and non-nat) and run oslr on the lan interface to for wrt54g in back to back configuration
LAN—wrt54g–wlan—wrt54g—LAN—wrt54g—wlan—-wrt54g
etc etc?
nice howto…!
Mike said,
July 23, 2005 @ 7:33 am
Thats a good question. I think the answer is yes - but I am no networking guru, so I am not positive. If you need to know for sure, ask these guys: https://www.olsr.org/mailman/listinfo/olsr-users
Croaky said,
August 9, 2005 @ 11:02 pm
How many nodes have you got there in Malawi? What do you see as the use of mesh networks in developing country contexts? Is their main advantage the fact that individual nodes tend to be unreliable because of things like poor electricity supply?
A somewhat related project that may interest you if you haven’t seen it already, using wireless and open source in a developing country is the Ratanakiri Internet Motoman at http://www.cambodia.net/kiri/projects/motoman.html
Sounds like a fantastic project! Am keen to hear more as it progresses.
Mike said,
August 11, 2005 @ 5:28 am
At the moment I have anywhere between 1 and 5 nodes - depending on what is plugged in at my desk. In other words, things are not live yet - but I am expecting to have my VSAT activated any time now - maybe even today. But Africa teaches you patience, if nothing else.
I basically just see mesh nodes as a cheap solution to cover an area with internet access. By using DIY wireless mesh, the developing world can leapfrog over government (in Africa government = corruption) owned old fashioned wired networks that have not made it to the villages yet because they are lazy and there is no business case for it. Individual nodes are fine, but you need line of sight to that node - whereas a bunch of mesh nodes create lots of options to find line of sight. And yeah poor electricity would be part of it - or no electricity as the case may be. My dream would be solar, wind and or bicycle driven options. But who knows - I need to get it working here in my backyard in Lilongwe first!
Thanks for the comment!
Mark Williams said,
August 11, 2005 @ 8:47 am
I have had the pleasure of working with several in Ghana, and other areas of the dark continent whom are deploying successful mesh networks. To date, I have experimented with just about every platform dreamt of from military / carrier grade systems to the DIY / roll your own solutions. Bravo to the hardwork you are doing! Continue to spread your networks and bring reasonable communication options to your bretheren.
I applaud the efforts of the innovators!
MESH networks based upon the locustworld meshap software are my favorites!
http://www.locustworld.com
If anyone of you should ever need advise or assistance with the meshap stuff feel free to drop me an email.
God Bless,
Mark Williams
Lee said,
August 11, 2005 @ 12:34 pm
hey, it seems if you want a back to back configuration, you need to start the olsr daemon on both interfaces, i.e. the wlan and lan. beaware , that because it’s being routed, the lan segment will need unique subnet’s, and you’ll have to turn nat off and firewalling. this needs more research, anyone like to try it out?
tom monroe said,
August 23, 2005 @ 4:14 pm
hi,
does it make sense to have mesh network consisting of wrt54gs if only *ONE* of them is directly connected to the internet?
regards,
tom
Jim Forster said,
August 24, 2005 @ 3:51 am
Very cool stuff! I will follow your progress with great interest.
Do you have any need/wish to expand beyond the 3 WRT’s you mentioned?
— Jim Forster
Mike said,
August 24, 2005 @ 5:15 am
Good question Tom. The answer is absolutely! In fact that is the whole point of a mesh! You see, the WRT54Gs will be communicating with each other, and the OLSR software will be managing the gateways to the web. So if any one WRT54G is connected to the internet, then all of the other WRT54Gs in the mesh (and the computers connected to them) will know that they can make internet requests hop along the mesh until that one connected WRT54G is reached. So basically you can extend one internet connection over many hops along a mesh of WRT54Gs. Cool, eh?
Jake said,
August 25, 2005 @ 3:56 am
I’m somewhat noob to mesh networking but I’ve got a couple questions I hope you can help me sort out…
1.Let’s say I have 8 adhoc WRT54Gs in an area. 3 of them have internet access connected while the remaining do not. The question: Will any computer that connects to the network be able to access the closest internet connection or is only one internet connection allowed?
2. I have a WRT54G(Router A) running in Client Mode. It connects wirelessly to WRT54G(Router B) which is running in AP Mode. The question: Will RouterA still be able to utilize the internet access through RouterB if Router A is switched to AdHoc?
Mike said,
August 26, 2005 @ 6:22 am
Thanks for the encouragement Jim. Expansion is definitely in the long term vision. Check out some of these other posts:
diy-broadband-in-malawi
vsat-update
learning-the-ropes-of-vsat
how-to-build-the-johnny-redneck-special
And Jake - to answer your 1st question, it depends on what firmware you are using. OLSR which is part of freifunk allows for multiple internet connections and intelligently routes to the closest one. If you are just in ad-hoc mode then I don’t think it will work.
You second question reminds me of a controversial post from hack a day. Sounds like a way to turn your neighbor’s access point into your own! I think the answer is no - but I am not sure. I don’t think ad-hoc connections can connect to ad-hoc ones.
Jake said,
August 27, 2005 @ 10:13 pm
I think I see and thank you for answering my questions. I did read that article on hackaday. I guess the way I meant on my second question was for the RouterA to be very much like a repeater. What the guy was doing on hackaday was more along the lines of forcing his neighbors open AP into his own secure network My intensions have nothing to do with closing up anything that is already open just extending the range. At this point I don’t think extending the range of an open AP breaks any laws but that’s why I ask the questions and read before trying anything that I find to be in the *Grey Area*.
tom monroe said,
August 29, 2005 @ 4:54 pm
i am having problems with the settings described in this guide.
i have put exactly those numbers (ip, subnet etc) into three wrt54gs.
the three can ping each other, however, i can only connect to the WAN port from the wrt54 that is actually physically connected to it..
one of the wrt54gs is connected to the internet, and only if i plug into that one, or connect to it over wlan, i can connect to the web.
if i am connected to one of the others, my pings dont get through.
since the three wrt54gs can ping each other, it must be something with the settings, can anybody help?
once again, i am using *exactly* the ips, olsr settings etc as described in the guide above!
thanks a lot!!
tom
tom monroe said,
August 29, 2005 @ 4:55 pm
another quick question,
is there any way to authenticate users running the freifunk firmware.. like an addon, encryption, or anything?
regards,
tom
Mike said,
September 2, 2005 @ 3:09 pm
Hi Tom. Not sure what your problem is. I would recommend asking the OLSR list though. You can definitely add stuff to freifunk - it used openwrt which has thousands of plugins for authentication, proxies, all sorts of stuff. Go to the openwrt.org website and start browsing. To add stuff you run a command from the command line. I think you can the web interface as well to upload a package. Let me know if you have any luck.
John Burns said,
September 29, 2005 @ 6:26 am
Hi there,
I’m trying to set up three WRT54G’s in a similar manner but using OpenWRT and OLSR. I’m having a bit of trouble, so before I spend anymore time on it, I would like to know one thing.
Once the mesh of 3 routers is running with OLSR, can a normal wireless client (say a laptop with an 802.11B card in it) connect to the mesh? Do they need to be running olsr on their laptop or will it quite happily mesh without?
Thanks
John Burns
Mike said,
October 1, 2005 @ 4:54 am
Hi John-
A normal wireless client can join the mesh without running any special software (like OLSR). The only thing that is slightly different is that the network is an ad-hoc network instead of an access point.
John Burns said,
October 21, 2005 @ 7:58 pm
Thanks for you reply.
I have given up (for now) on raw OpenWRT and playing with freifunk so I get more confident with OLSR first.
Could you please advise why you are using a slash8 (255.0.0.0) as the netmask on the wireless?
Does the wireless netmask need to cover all of the IPs in the entire network while the OLSR dhcp is purely for local access?
Why have you allocated an entire /24 (255.255.255.0) for each LAN on each access point if dhcp is not enabled? Could I use all my LAN ports on the same subnet, or must it be a different subnet per LAN per WRT54G?
I’m planning on documenting this in more detail for both direct OPENWRT and Freifunk as I’m not a networking/wireless n00b but its causing me a little grief.
Thanks
John Burns
Phil Thompson said,
November 11, 2005 @ 5:13 pm
John,
the individual wired LANs behind the wrt54g’s can be on the same IP addresses as they are NATted and DHCPed by default. I think Mike copied the network map mentioned in the top post which uses public IPs throughout and hence they are on differnet ranges on each wrt’s wired LAN.
I have a pair of wrt54gs and both are 192.168.1.1 default static on the wired LAN with DHCP active (also default). To turn DHCP off you put 0 (zero) max users. Mike’s mention of DHCP is on the one using its WAN port.
I can’t get my laptop assigned an IP etc by DHCP wirelessly, hints welcome !
Phil
davidwatson.org » Behold the Power of WRT54GS said,
November 28, 2005 @ 4:32 am
[...] ly foresaw, people are using these little linux boxen masquerading as router appliances to build mesh networks on the cheap. This community development of M [...]
Marjan said,
December 5, 2005 @ 8:20 pm
Hi I’m trying the freifunk firmware and its great for me i have 3 wrt54g and mesh is great but I’m concerned about security so i found some ipk file nas_0.2-1_mipsel.ipk which have wpa+psk but it seems like when i put the “nasâ€? then nothing works i use “nasâ€? without wds can someone advice or tell some other software for that purpose
here is the config script for “nas�
nvram set wl0_auth_mode=psk
nvram set wl0_wpa_psk=
nvram set wl0_wpa_gtk_rekey=3600
nvram set wl0_ssid=
nvram set wl0_wep=disabled
nvram set wl0_crypto=tkip
nvram commit
reboot
nvram set lan_ifname=br0
nvram set lan_ifnames=”vlan0 eth1″
nvram commit
reboot
rfc13109 » Blog Archive » WiFi Adhoc Mesh with OLSR said,
December 6, 2005 @ 6:13 am
[...] I searched the web for setup instructions, and I found this article to be more useful than this article. I shall outline the steps I took to setup my simpl [...]
cci[RR]us said,
December 8, 2005 @ 3:42 pm
Hi,
I did a guide to setup a simple OLSR mesh too. If you guys are interested please take a look at
here.
Cheers!
sujin said,
December 17, 2005 @ 8:34 pm
hai there,
I am sujin , i am really impressed with th activity in this section .
i have some basic doubts in setting up mesh networks .
1)
i am setting up the mesh with 4 -wrt54gs devices…
each supporting 240 clients …
what should be the protocol between all(4) the wrt54gs nodes ..
which is best like [point to point or olsr] betwen the nodes .
what
(
if a client is getting connected to one node , which in turn is (p to p) connetion to another wrt54gs…..now how many hops away is that node connecting to th einternet ..to this client ..who is newly joiing the base station ….)
3)
the wrt54gs has… one wired input …and radio ..and 4 port switch ..also ..
my doubt is where exactly we have to connect to dsl /where if i wants to connect to the node from my lm laptop..what i sthe solution ???plz
jonw said,
December 19, 2005 @ 2:11 pm
RE
sujin said,
i am setting up the mesh with 4 -wrt54gs devices…
each supporting 240 clients …
Please correct me if i’m wrong, but depending on how much traffic you are intending to get over the wireless, the limit for these boxes is closer to 50 clients max.
I’m only mentioning this as it maysave you time later.
I have read somewhere that ~ 20-25 clients per box can be the maximum.
I’m not referring entirely to the client bandwidth but also to stability issues with lots and lots of clients connected.
any thoughts anyone ??
/Jon
pradeep said,
December 19, 2005 @ 6:20 pm
hai ,
i have seen the basic topology concidered ….
at ..
I copied most of the plan from Florian’s topology diagram. …
i have a doubt ..what is the routing protocol inside the gateway …
if that is olsr …? how would i configure the node ?
do i need to statically configure that ???..when the node is joined to the network ..
hopeing some ones help..
pradeep..
sujin said,
December 20, 2005 @ 10:37 am
hai jonw..
thank you soo much for your reply …
I have used that wrt54gs as a gate way ..and at the same time i have some more nodes in the coverage area ..to support clients ..
can i have some help from you in the context of addressing aslo ..
thanking for your support
sujin
ncoredump said,
January 12, 2006 @ 10:54 pm
ive been running dd-wrt 23beta2 using WDS for weeks, I use chillispot and freeradius to enforce the network it works great.
Scott said,
February 11, 2006 @ 6:19 am
Another Mesh Noob here:
So - several neighborhood friends and I are all connected to the same Internet Service Provider, who has placed some fairly severe bandwidth limits on it’s service. I was wondering if it were possible for us to set up a simple mesh that would allow us to effectively ‘gang’ our separate internet connections together, thereby granting us higher overall bandwidth. In my (admittedly limited) internet research, I haven’t seen a discussion or example of something like this so far…
Any thoughts?
TIA
Scott
Mike said,
February 11, 2006 @ 9:13 am
Scott-
Sounds like a wireless mesh with olsr would be a perfect way to group your dsl or cable connections. You can run olsr over wireless or wired networks - freifunk makes it easy if you have WRT5G. Let me know if you try it.
David Schad said,
February 14, 2006 @ 6:19 pm
i have set up 3 wrt54g and they are all working fine i am using different ip addres than stated above, all cabled clients get an ip no problem but when a wireless client connect there is no ip given wi lan ip 192.168.0.1 lan ip 192.168.1.1 i have nothing in the olsr dhcp as of yet, i have tried many without success, any help much apreciated
David Schad said,
February 14, 2006 @ 6:20 pm
as a follow up i can give the wifi clients a static address and gateway details and can resolve hostnames but no traffic seems to be passed back.
Henning said,
February 19, 2006 @ 5:48 pm
What are the ips and masks you entered on the olsr, wireless and lan pages?
I’ve just setup four nodes acourding to the notes above, and they worked on first hit
David Schad said,
February 20, 2006 @ 6:27 pm
hi im using different ip the first box is 192.168.0.1 lan and 192.168.1.1 wifi
i tried adding in the olsr dhcp setting to that effect but im not sure if i got them correct., its not the first box im having issues with its the subsequent boxes in the mesh i cant get to work. i can go wifi on the first box with the internet connectivity using a static address just fine,but the second node, no joy the second are 192.168.0.2 lan and 192.168.1.2 wifi and so on
Henning said,
February 21, 2006 @ 6:15 pm
What netmask are you using. You need a netmask that covers all the boxes. Eg /23 would cover these two. If you need more select a /22 or even bigger.
My complete config on my 5-node test-setup can be found on
http://wangerin.linux.dk/index.php/freifunk-config.php
The ips _and_ netmask on wifi _and_ lan is important to see what is going wrong.
and 10.128.0.0/16 on wifi (10.128.x.y/27 allocated for each router for incoming NAT and wifi-dhcp. That way the will never be a misconfig with the same adresses on lan and wifi.
That’s why I chosen to have 192.168..* on NATted lan interfaces (at least for the first 254 devices
David Schad said,
February 22, 2006 @ 11:55 am
om im going to try that today, also are all the nodes supposed to be able to access each other as i have a mail server running but only users connect via the first node can access it to which the mail server is attached to
Henning said,
February 23, 2006 @ 5:08 pm
As long as the are link between some nodes, in a way that all are directly or inderictly connected, you can access any node.
a b c d e
also gives a connection between a and e
You can get info on the olsr status-page on how connections are made.
davey said,
February 25, 2006 @ 8:35 pm
Hi folks…
To anyone that has gotten Chillispot to work with WDS, I am a bit stuck. I am the all-around IT person for a camp here in central Indiana and we just got our first outdoor 802.11 unit up and running with chillispot to enforce the network, but we would also like to use WDS to some repeaters out there. I get WDS to work ap to ap but since the iptables setup keeps the lan and wan apart I can’t get a connection to the outside world. I figure there is something that needs to be added to the chillispot firewall script.
If you’ve gotten it to work could you give me some pointers? My email is davidl@camptecumseh.org.
thanks..
yaya said,
March 22, 2006 @ 10:13 am
Bonjour,
J’ai installer freifunk 1.1.4 sur un wrt54g après toutes les config je me rend compte que j’ai un problème au niveau de ma route par defaut. Il prend l’ip du lan et pour accĂ©der Ă internet il faut que je me connecte Ă l’AP en ssh et puis taper # ip route replace default via 192.168.2.1 dev vlan1 qui est l’adresse ip de la paserelle du reseau sur lequel je me connecte Ă internet (un autre routeur). Et si je redemarre mon wrt54g je perd la connexion et il me faut encore reprendre la ligne de commande.
Merci de m’aider.
yaya said,
March 22, 2006 @ 10:45 am
Hello!
My english is not clear.
After installing Freifunk 1.1.4 on my wrt54g, I have noticed a problem about gateway. It uses the LAN Ip to access internet. Then I need to connect the AP by ssh, type :
#ip rooute replace default via 192.168.2.1 dev vlan1
192.168.2.1(an other router) is the gateway Ip of my network. But when I reboot the wrt54g, I loss the connexion and I must retype
#ip route replace default via 192.168.2.1 dev vlan1
Could anybody help me fixing the default route?
Thanks!
Andrew said,
March 25, 2006 @ 9:36 pm
Hi,
Great how-to
can you send me the link of the exact firmware you used. i cant quite find it.
werd75na@gmail.com
Henning said,
April 30, 2006 @ 5:03 pm
Hi!
Anyone having hints on forcing olsr to go over ethernet instead of wlan?
I have a location with 3 olsr-nodes (wrt54g) with directional antennas that I need to connect via lan.
The nodes are running as 10.128.[4,5,6].1/24
I guess I have to setup LAN on the boxes box to 10.128.0.[4,5,6]/29 and just connect them, but how do I setup so trafic is going thru lan instead of wlan? The idea is to lower the load on the radios. (Later on different channels may be used, but not right now)
I’m going to have the same problem later on at two other locations where I have 2 and 4-5 nodes running, but not with the high we have at our central point - our external connection ends there
Thanx for any input