[OLSR-users] dhcp for wireless clients

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


Hi

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?

http://wiki.freifunk.net/Freifunk_Firmware_%28English%29#Using_DHCP_with_a_OLSR_Network

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 http://212.222.128.68/sven-ola/ipkg/ 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    
ff_wldhcp=172.18.173.18/32,255.255.0.0

(The mesh is on 172.18.0.0/16)

The /etc/init.d/S50dnsmasq seems to parse the nvram vars wrong,
in this section:
<snip>
        WLDHCP=$(nvram get ff_wldhcp)
        IFS=\;
        for ENT in $WLDHCP; do
                NET=${ENT%[:,]*}
                MSK=${ENT#*[:,]}
                if [ -n "$NET" ] && [ -n "$MSK" ]; then
                        DHCPLEASE=2h
                        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
                fi
        done
</snip> 

which produces (the + 2 and - 1 bits above):
dhcp-range=wlnat,172.18.173.20,172.18.173.17,255.255.0.0,2h
(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 173.18.173.0/24,255.255.0.0 instead
of just one IP doesn't help either.)

Even if I change that line to 
dhcp-range=wlnat,172.18.173.18,172.18.173.18,255.255.0.0,2h

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:
http://global.freifunk.net/item/setting_up_dhcp_with_olsr
saying that the setting should be 172.18.172.18/32 without
the ",255.255.0.0" after it. But the freifunk wiki contradicts 
this, the netmasks are different: wlhdcp=172.18.172.18/32,255.255.0.0
says hand out IPs from the range 172.18.172.18/32 (one IP) and give
out the netmask 255.255.0.0 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.

regards,
Jan

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 
1.4.5:
http://translate.google.com/translate?hl=en&sl=de&u=http://www.freifunk-bno.de/content/view/66/28/
-- 
   .~.
   /V\     Jan Groenewald
  /( )\    www.aims.ac.za
  ^^-^^




More information about the Olsr-users mailing list