[OLSR-users] dhcp for wireless clients

Jan Groenewald (spam-protected)
Sun Apr 8 11:42:28 CEST 2007


On Sat, Apr 07, 2007 at 08:22:13PM +0530, Nagarjuna G. wrote:
> we successfully setup two routers of linksys routers using freifunk 
> firmware1.4.5.  we are managing to get the mesh working and the nodes 
> connected are also able to get connected to internet.  However laptop 
> users have to connect to the mesh only after adding manually their IP.
> OLSR DHCP: option on the web interface is not present, instead in its 
> place we have OLSR services: How do we configure DHCP for WLAN clients?


I use WRT54GL (1.1) Linksys routers. I also need OLSR-DHCP.

This worked fine for me on freifunk 1.4.1 (english version).
But on 1.4.5 (english) I have the exact same nvram settings 
and it does not work. All recommended software and 
freifunk-gateway-en are installed. The recommended software includes
freifunk-dnsmasq which allows this functionality
[as per where it says
freifunk-dnsmasq:        Caching DNS / OLSR-DHCP (Admin/OLSR after install) ]

(spam-protected):~# ipkg status freifunk-dnsmasq
Package: freifunk-dnsmasq
Status: install ok installed
Root: /
Conffiles: etc/ethers 0787f2a9480ff939411d1cfa147b665b etc/local.hosts b215a56b3826c7d39a3d1ff454c82d88 etc/local.dnsmasq.conf 4083b9f7855af7581f5d25e2228e8f7d etc/init.d/S50dnsmasq 61d260de16ea4901feb8afc575bba8f9
Version: 1.4.3

(spam-protected):~# nvram show|grep wldhcp    

(The mesh is on

The /etc/init.d/S50dnsmasq seems to parse the nvram vars wrong,
in this section:
        WLDHCP=$(nvram get ff_wldhcp)
        for ENT in $WLDHCP; do
                if [ -n "$NET" ] && [ -n "$MSK" ]; then
                        DHCPBEG=$(ipcalc -n $NET|cut -d'.' -f4)
                        DHCPBEG=$(( $DHCPBEG + 2 ))
                        DHCPEND=$(ipcalc -b $NET|cut -d'.' -f4)
                        DHCPEND=$(( $DHCPEND - 1 ))
                        DHCPNET=$(ipcalc -n $NET|cut -d'=' -f2|cut -d'.' -f1-3)
                        echo "dhcp-range=wlnat,$DHCPNET.$DHCPBEG,$DHCPNET.$DHCPEND,$MSK,$DHCPLEASE">>/var/etc/dnsmasq.conf

which produces (the + 2 and - 1 bits above):
(from 20 to 17?? This is assuming I don't have just one IP
to give out for DHCP, which in my case I do. Anyway, that
dns.conf file can be fixed, but the problem persists. Trying 
a dhcp range and wifi range, instead
of just one IP doesn't help either.)

Even if I change that line to 

and kill dnsmasq and restart it in debug mode, with command line
output, I can see the LAN (with its own separate range line 
in the dhcp-conf) but not the WLAN take DHCP successfully.

While writing, I read this:
saying that the setting should be without
the "," after it. But the freifunk wiki contradicts 
this, the netmasks are different: wlhdcp=,
says hand out IPs from the range (one IP) and give
out the netmask with that, so that the client can see
the non-DHCP IP of the router giving out DHCP. The DHCP server can obviously
not be in the range it is giving out itself! See the last paragraph
(German) in http://wiki.freifunk.net/IP_Grundwissen. The full setting is also
shown in the help on the web page admin-olsr (press f1 in the olsr-dhcp
box). It is correct and worked with ff 1.4.1 for me. So I test this
variation (without mask) anyway :-P but the range is still written wrong
in dnsmasq.conf, and before/after fixing that I still don't get DHCP 
from the WRT to a non-OLSR Linux laptop or Nokia E61.

Any assistance appreciated. Is there something in the NATTING of
OLSR-DHCP addresses which breaks this? Should I reflash a 1.4.1
to test? I'm not sure where to look for the differences.


PS. I am playing with the new dhcp-splash packages too, which will 
put up a splash page for new dhcp users. These seem to be new in 
   /V\     Jan Groenewald
  /( )\    www.aims.ac.za

More information about the Olsr-users mailing list