[Dnsmasq-discuss] Fast add/remove of route for dnsmasq DHCP clients

Hartmut Krafft hartmut at mail.ru
Sat Jan 16 20:32:21 GMT 2016


On Sat, 16 Jan 2016 20:07:57 +0000
Olszowi Bernd <Bernd.Olszowi at esolutions.de> wrote:

> Hi,
> 
> I use dnsmasq as DHCP server for a WLAN hotspot and also got a dial
> up network (3G/LTE) for internet connection. The internet connection
> is not always available. Therefore I add the DHCP route option when
> there is an internet connection and remove the route when there is
> none. My problem is that when WLAN clients connect, when there is no
> internet connection, they don't get the route. But when the internet
> connection is available I have to wait for lease renewal until the
> route is available at the WLAN device. Is there a solution that the
> clients immediately get the new route and can start to access the
> internet?

Hi Bernd,
what about setting the machine dnsmasq runs on as default route for the
WLAN clients,  Then configure it to forward packets to the machine with
the WWAN interface and also, set that machine as default route.
So you'd get: 

WLAN client -default route-> dnsmasq machine -default route-> WWAN
gateway (which will then have it's defaultroute set by the provider).
(IIRC, in this case, you wouldn't even have to set the default route for
dnsmasq's dhcp).

That way the WLAN clients don't have to cope with a changing default
route, the only thing that happens if the WWAN is unavailable is that
they're unable to reach the Internet.

Hartmut


> Same problem when internet connection shuts down. At the
> moment I set a very short lease time (4 min) but this cause problems
> with old Android smartphones and I have to wait ~2 min.
> Deauthenticating all WLAN clients so that they have to reauthenticate
> and redo DHCP is unfortunately not an option.
> 
> Thank you
> Bernd



More information about the Dnsmasq-discuss mailing list