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

Hartmut Krafft hartmut at mail.ru
Sat Jan 16 23:20:18 GMT 2016


On Sat, 16 Jan 2016 21:07:15 +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
> 
> Oh sorry, I forgot.
> That's also not an option because when smartphones get a route they
> shut down their own 3G/LTE connection and use the WLAN connection for
> internet access, which is not working. If you set no route the
> smartphone use it's own 3G/LTE connection for internet access.

At least for Android, this is not completely correct. Android uses the
WLAN connection only when a DNS probe to Google succeeds, even if
there's default route on the interface, so the setup works, although it
can take some time for the device to notice.

BTW, please

1) answer to the message you're actually answering and not some other
so that the thread structure stays intact,

2) do not keep sending multiple identical messages to the list.
Thank you.

The other thing that comes to my mind re. your problem is to have
a script checking the WWAN connection and taking down/up the WLAN
interface when the WWAN goes down/up.

Hartmut

> 
> Cheers
> Bernd




More information about the Dnsmasq-discuss mailing list