[Dnsmasq-discuss] IPv6 configuration for Android clients

Michal Zatloukal myxal.mxl at gmail.com
Tue Jan 7 12:42:45 GMT 2020


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
<geert.stappers at hendrikx-itc.nl> 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<UP,BROADCAST,RUNNING,MULTICAST>  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<link>
> >         inet6 2001:db8:0:1::1  prefixlen 64  scopeid 0x0<global>
>
> 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]: <info>  [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 class: android-dhcp-9
> > Jan  7 04:51:11 char dnsmasq-dhcp[18847]: 4061430237 DHCPREQUEST(wlp1s0) 10.42.0.214 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 DHCPACK(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  5
> > 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
> >
> > And my Android device gets IPv4 address 10.42.0.214, but no IPv6
> > address.
> >
> > What is wrong with my local.conf dnsmasq settings?
>
> Probably nothing.
>
>
> Please be aware that the actual question is "Why is there no sign of
> IPv6 address assignment in the logging of dnsmasq?"
>
> Make sure that the Android client is realy doing IPv6 address assigment
> requests that trigger some event that gets log by dnsmasq.
>
> How to do that?  I don't know. I even don't know how to do that on
> another system as an andriod device.
>
>
> Thing I'm trying to tell is that  original poster is dealing with a
> network protocol that uses multicast heavely.  Not the classic DHCP
> broadcast request with unicast DHCP answers.  That the magic happens on
> the wire, not a server where it can get logged.
>
>
> Regards
>
> Geert Stappers
>
>
> P.S.
>
> Feel welcome to share how the "IPv6 configuration for Android clients"
> is going.  The includes reporting back "It works and indeed no log entry
> at server side of it".
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



More information about the Dnsmasq-discuss mailing list