Re: [Dnsmasq-discuss] IPv6 configuration for Android clients

2020-01-08 Thread Juha Heinanen
Thanks for the replies.  As Simon suggested, there must have been
something wrong in how I had configured IPv6 address for the WLAN
interface.

After I added IPv6 address 2001:db8:0:1::1 with prefix 64 in
NetworkManager IPV6 Settings of the hotspot WLAN connection, my Android
device got two IPv6 addresses with prefix 2001:db8:0:1 when it
connected to the WLAN.  One has labels "scope global temporary dynamic"
and the other has labels "scope global dynamic mngtmpaddr".

-- Juha

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] IPv6 configuration for Android clients

2020-01-07 Thread Geert Stappers
On Tue, Jan 07, 2020 at 01:42:45PM +0100, Michal Zatloukal wrote:
> On Tue, 7 Jan 2020 at 11:43, Geert Stappers wrote:
> > On 07-01-2020 03:52, Juha Heinanen wrote:
> > > In order to support IPv6 address allocation to Android clients I have
> > > tried to extend default Debian NetworkManager Wifi hotspot dnsmasq
> > > configuration:
> > >
> > > 18240 ?S  0:00 /usr/sbin/dnsmasq --conf-file=/dev/null 
> > > --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo 
> > > --clear-on-reload --strict-order --listen-address=10.42.0.1 
> > > --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-lease-max=50 
> > > --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlp1s0.leases 
> > > --pid-file=/run/nm-dnsmasq-wlp1s0.pid 
> > > --conf-dir=/etc/NetworkManager/dnsmasq-shared.d
> > >
> > > with file local.conf in /etc/NetworkManager/dnsmasq-shared.d:
> > >
> > > enable-ra
> > > dhcp-range=::,constructor:wlp1s0,ra-names,slaac,infinite
> > > dhcp-authoritative
> > > log-dhcp
> > >
> > > Interface wlps1s0 has these addresses:
> > >
> > > wlp1s0: flags=4163  mtu 1500
> > > inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
> > > inet6 fe80::14c0:c516:36cb:8b44  prefixlen 64  scopeid 0x20
> > > inet6 2001:db8:0:1::1  prefixlen 64  scopeid 0x0
> >
> > That seems to be output of `ifconfig wlp1s0`.
> >
> > Advice:   use  `ip address show dev wlp1s0` or shorthand `ip a sh dev
> > wlp1s0`.  Because `ifconfig` is not in pace with kernel development,
> > `ip` is.
> >
> > >
> > > When I start dnsmasq, I get to syslog:
> > >
> > > Jan  7 04:46:10 char NetworkManager[18816]:   [1578365170.5750] 
> > > dnsmasq-manager: starting dnsmasq...
> > > Jan  7 04:46:10 char dnsmasq[18847]: started, version 2.80 cachesize 150
> > > Jan  7 04:46:10 char dnsmasq[18847]: compile time options: IPv6 
> > > GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth 
> > > DNSSEC loop-detect inotify dumpfile
> > > Jan  7 04:46:10 char dnsmasq[18847]: chown of PID file 
> > > /run/nm-dnsmasq-wlp1s0.pid failed: Operation not permitted
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCP, IP range 10.42.0.10 -- 
> > > 10.42.0.254, lease time 1h
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > > wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > > 2001:db8:0:1::, constructed for wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > > 2001:db8:0:1::, constructed for wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: IPv6 router advertisement 
> > > enabled
> > > Jan  7 04:46:10 char dnsmasq[18847]: no servers found in 
> > > /etc/resolv.conf, will retry
> > > Jan  7 04:46:10 char dnsmasq[18847]: cleared cache
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > > 2001:db8:0:1::, old prefix for wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > > 2001:db8:0:1::, constructed for wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > > 2001:db8:0:1::, constructed for wlp1s0
> > > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > > 2001:db8:0:1::, old prefix for wlp1s0
> > >
> > > When I connect my Android device to this hotspot, I get to syslog:
> > >
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 available DHCP 
> > > range: 10.42.0.10 -- 10.42.0.254
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 vendor class: 
> > > android-dhcp-9
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPDISCOVER(wlp1s0) 
> > > a8:3e:0e:ab:65:dd
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 tags: wlp1s0
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPOFFER(wlp1s0) 
> > > 10.42.0.214 a8:3e:0e:ab:65:dd
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > > 1:netmask, 3:router, 6:dns-server, 15:domain-name,
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > > 26:mtu, 28:broadcast, 51:lease-time, 58:T1,
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > > 59:T2, 43:vendor-encap
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 next server: 
> > > 10.42.0.1
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  1 
> > > option: 53 message-type  2
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 
> > > option: 54 server-identifier  10.42.0.1
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 
> > > option: 51 lease-time  1h
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 
> > > option: 58 T1  30m
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 
> > > option: 59 T2  52m30s
> > > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 
> > > 

Re: [Dnsmasq-discuss] IPv6 configuration for Android clients

2020-01-07 Thread Simon Kelley
On 07/01/2020 02:52, Juha Heinanen wrote:

> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, old prefix for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, old prefix for wlp1s0

^^^

I'll take a guess the the preferred lifetime for that address on the
interface is zero. As Geert suggests, use "ip" not "ifconfig" to get the
interface information: it will tell you such things.


Simon.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] IPv6 configuration for Android clients

2020-01-07 Thread Michal Zatloukal
Last time I checked, Android doesn't do DHCP6 (at all, even if
instructed with M/O bits in RA).

Either way, IMHO you should first be looking for RTR-SOLICIT and
RTR-ADVERT log messages. The solicitation and advertisement packets
themselves should be relatively easy to find in a pcap capture with
"icmp6" filter. If you don't get anything in pcap (captured at the
dnsmasq end) while toggling WiFi on the android device on and off,
then something is blocking/breaking multicast.

MZ

On Tue, 7 Jan 2020 at 11:43, Geert Stappers
 wrote:
>
>
> On 07-01-2020 03:52, Juha Heinanen wrote:
> > In order to support IPv6 address allocation to Android clients I have
> > tried to extend default Debian NetworkManager Wifi hotspot dnsmasq
> > configuration:
> >
> > 18240 ?S  0:00 /usr/sbin/dnsmasq --conf-file=/dev/null 
> > --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo 
> > --clear-on-reload --strict-order --listen-address=10.42.0.1 
> > --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-lease-max=50 
> > --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlp1s0.leases 
> > --pid-file=/run/nm-dnsmasq-wlp1s0.pid 
> > --conf-dir=/etc/NetworkManager/dnsmasq-shared.d
> >
> > with file local.conf in /etc/NetworkManager/dnsmasq-shared.d:
> >
> > enable-ra
> > dhcp-range=::,constructor:wlp1s0,ra-names,slaac,infinite
> > dhcp-authoritative
> > log-dhcp
> >
> > Interface wlps1s0 has these addresses:
> >
> > wlp1s0: flags=4163  mtu 1500
> > inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
> > inet6 fe80::14c0:c516:36cb:8b44  prefixlen 64  scopeid 0x20
> > inet6 2001:db8:0:1::1  prefixlen 64  scopeid 0x0
>
> That seems to be output of `ifconfig wlp1s0`.
>
> Advice:   use  `ip address show dev wlp1s0` or shorthand `ip a sh dev
> wlp1s0`.  Because `ifconfig` is not in pace with kernel development,
> `ip` is.
>
> >
> > When I start dnsmasq, I get to syslog:
> >
> > Jan  7 04:46:10 char NetworkManager[18816]:   [1578365170.5750] 
> > dnsmasq-manager: starting dnsmasq...
> > Jan  7 04:46:10 char dnsmasq[18847]: started, version 2.80 cachesize 150
> > Jan  7 04:46:10 char dnsmasq[18847]: compile time options: IPv6 GNU-getopt 
> > DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC 
> > loop-detect inotify dumpfile
> > Jan  7 04:46:10 char dnsmasq[18847]: chown of PID file 
> > /run/nm-dnsmasq-wlp1s0.pid failed: Operation not permitted
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCP, IP range 10.42.0.10 -- 
> > 10.42.0.254, lease time 1h
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > 2001:db8:0:1::, constructed for wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > 2001:db8:0:1::, constructed for wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: IPv6 router advertisement enabled
> > Jan  7 04:46:10 char dnsmasq[18847]: no servers found in /etc/resolv.conf, 
> > will retry
> > Jan  7 04:46:10 char dnsmasq[18847]: cleared cache
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > 2001:db8:0:1::, old prefix for wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> > 2001:db8:0:1::, constructed for wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > 2001:db8:0:1::, constructed for wlp1s0
> > Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> > 2001:db8:0:1::, old prefix for wlp1s0
> >
> > When I connect my Android device to this hotspot, I get to syslog:
> >
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 available DHCP range: 
> > 10.42.0.10 -- 10.42.0.254
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 vendor class: 
> > android-dhcp-9
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPDISCOVER(wlp1s0) 
> > a8:3e:0e:ab:65:dd
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 tags: wlp1s0
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPOFFER(wlp1s0) 
> > 10.42.0.214 a8:3e:0e:ab:65:dd
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > 1:netmask, 3:router, 6:dns-server, 15:domain-name,
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > 26:mtu, 28:broadcast, 51:lease-time, 58:T1,
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> > 59:T2, 43:vendor-encap
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 next server: 10.42.0.1
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  1 option: 
> > 53 message-type  2
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 
> > 54 server-identifier  10.42.0.1
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 
> > 51 lease-time  1h
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 

Re: [Dnsmasq-discuss] IPv6 configuration for Android clients

2020-01-07 Thread Geert Stappers

On 07-01-2020 03:52, Juha Heinanen wrote:
> In order to support IPv6 address allocation to Android clients I have
> tried to extend default Debian NetworkManager Wifi hotspot dnsmasq
> configuration:
>
> 18240 ?S  0:00 /usr/sbin/dnsmasq --conf-file=/dev/null --no-hosts 
> --keep-in-foreground --bind-interfaces --except-interface=lo 
> --clear-on-reload --strict-order --listen-address=10.42.0.1 
> --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-lease-max=50 
> --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlp1s0.leases 
> --pid-file=/run/nm-dnsmasq-wlp1s0.pid 
> --conf-dir=/etc/NetworkManager/dnsmasq-shared.d
>
> with file local.conf in /etc/NetworkManager/dnsmasq-shared.d:
>
> enable-ra
> dhcp-range=::,constructor:wlp1s0,ra-names,slaac,infinite
> dhcp-authoritative
> log-dhcp
>
> Interface wlps1s0 has these addresses:
>
> wlp1s0: flags=4163  mtu 1500
> inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
> inet6 fe80::14c0:c516:36cb:8b44  prefixlen 64  scopeid 0x20
> inet6 2001:db8:0:1::1  prefixlen 64  scopeid 0x0

That seems to be output of `ifconfig wlp1s0`.

Advice:   use  `ip address show dev wlp1s0` or shorthand `ip a sh dev
wlp1s0`.  Because `ifconfig` is not in pace with kernel development,
`ip` is.

>
> When I start dnsmasq, I get to syslog:
>
> Jan  7 04:46:10 char NetworkManager[18816]:   [1578365170.5750] 
> dnsmasq-manager: starting dnsmasq...
> Jan  7 04:46:10 char dnsmasq[18847]: started, version 2.80 cachesize 150
> Jan  7 04:46:10 char dnsmasq[18847]: compile time options: IPv6 GNU-getopt 
> DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect 
> inotify dumpfile
> Jan  7 04:46:10 char dnsmasq[18847]: chown of PID file 
> /run/nm-dnsmasq-wlp1s0.pid failed: Operation not permitted
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCP, IP range 10.42.0.10 -- 
> 10.42.0.254, lease time 1h
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: IPv6 router advertisement enabled
> Jan  7 04:46:10 char dnsmasq[18847]: no servers found in /etc/resolv.conf, 
> will retry
> Jan  7 04:46:10 char dnsmasq[18847]: cleared cache
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, old prefix for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: DHCPv4-derived IPv6 names on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, constructed for wlp1s0
> Jan  7 04:46:10 char dnsmasq-dhcp[18847]: router advertisement on 
> 2001:db8:0:1::, old prefix for wlp1s0
>
> When I connect my Android device to this hotspot, I get to syslog:
>
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 available DHCP range: 
> 10.42.0.10 -- 10.42.0.254
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 vendor class: 
> android-dhcp-9
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPDISCOVER(wlp1s0) 
> a8:3e:0e:ab:65:dd 
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 tags: wlp1s0
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPOFFER(wlp1s0) 
> 10.42.0.214 a8:3e:0e:ab:65:dd 
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> 1:netmask, 3:router, 6:dns-server, 15:domain-name, 
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> 26:mtu, 28:broadcast, 51:lease-time, 58:T1, 
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 requested options: 
> 59:T2, 43:vendor-encap
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 next server: 10.42.0.1
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  1 option: 53 
> message-type  2
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 54 
> server-identifier  10.42.0.1
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 51 
> lease-time  1h
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 58 
> T1  30m
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 59 
> T2  52m30s
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option:  1 
> netmask  255.255.255.0
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option: 28 
> broadcast  10.42.0.255
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option:  3 
> router  10.42.0.1
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 sent size:  4 option:  6 
> dns-server  10.42.0.1
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 available DHCP range: 
> 10.42.0.10 -- 10.42.0.254
> Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 vendor