Discussion:
[Dnsmasq-discuss] Fast add/remove of route for dnsmasq DHCP clients
Olszowi Bernd
2016-01-16 20:07:57 UTC
Permalink
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? 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
Hartmut Krafft
2016-01-16 20:32:21 UTC
Permalink
On Sat, 16 Jan 2016 20:07:57 +0000
Post by Olszowi Bernd
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
Post by Olszowi Bernd
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
Olszowi Bernd
2016-01-16 20:37:39 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:17:00 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:20:27 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:42:28 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:44:57 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:42:20 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:50:51 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:09:50 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 21:07:15 UTC
Permalink
Post by Hartmut Krafft
Post by Olszowi Bernd
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.
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
Post by Olszowi Bernd
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.

Cheers
Bernd
Hartmut Krafft
2016-01-16 23:20:18 UTC
Permalink
On Sat, 16 Jan 2016 21:07:15 +0000
Post by Olszowi Bernd
Post by Hartmut Krafft
Post by Olszowi Bernd
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
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
Post by Olszowi Bernd
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
Post by Olszowi Bernd
Cheers
Bernd
Olszowi Bernd
2016-01-16 20:43:47 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:47:05 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:51:20 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:52:42 UTC
Permalink
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? 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
Olszowi Bernd
2016-01-16 20:43:15 UTC
Permalink
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? 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
Loading...