[Dnsmasq-discuss] Can't figure out how to assign static IPv6 addresses to clients

Carlos Laviola carlos.laviola at gmail.com
Tue Oct 2 01:42:34 BST 2012


On Mon, Oct 1, 2012 at 4:49 PM, Sean Boran <sean at boran.com> wrote:
>
> Perhaps you clients are getting their addresses from router advertisement,
> and not DHCP.  So disable RA first in dnsmasq (and make sure no router or
> other host is publishing one)
>
> Syntax like this works, I used it:
> dhcp-host=ubuntu12,[2001:ffff:666::1]
>
> perhaps a v6 range needs to be specified:
> dhcp-range=2001:ffff:666::1, 2001:ffff:666::4, 24h
>
> make sure you're using  a very recent version of dnsmasq.

I tried this to no avail. Actually, if I don't specify something like
slaac (like you did above) the client doesn't get any IP. Here's my
conf right now and the log from a client:

--
dhcp-range=2001:1291:2ad::2,2001:1291:2ad::9999, 24h
dhcp-host=georgia,192.168.1.2,[2001:1291:2ad::2]
--

--
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: started, version 2.62
cachesize 150
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: compile time options:
IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP
no-conntrack
Oct  1 21:38:44 ellis daemon.info dnsmasq-dhcp[2652]: DHCP, IP range
192.168.1.100 -- 192.168.1.249, lease time 12h
Oct  1 21:38:44 ellis daemon.info dnsmasq-dhcp[2652]: DHCP, IP range
2001:1291:2ad::2 -- 2001:1291:2ad::9999, lease time 1d
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver
2620:0:ccd::2#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver
2620:0:ccc::2#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver
2001:4860:4860::8844#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver
2001:4860:4860::8888#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver 8.8.4.4#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using nameserver 8.8.8.8#53
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: using local addresses
only for domain home.laviola.org
Oct  1 21:38:44 ellis daemon.info dnsmasq[2652]: read /etc/hosts - 2 addresses
Oct  1 21:38:44 ellis daemon.info dnsmasq-dhcp[2652]: read /etc/ethers
- 0 addresses
Oct  1 21:38:54 ellis daemon.info dnsmasq-dhcp[2652]: 4243904525
available DHCP range: 192.168.1.100 -- 192.168.1.249
Oct  1 21:38:54 ellis daemon.info dnsmasq-dhcp[2652]: 4243904525
client provides name: georgia
Oct  1 21:38:54 ellis daemon.info dnsmasq-dhcp[2652]: 4243904525
DHCPRELEASE(br-lan) 192.168.1.2 d8:d3:85:b2:da:b3
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
available DHCP range: 192.168.1.100 -- 192.168.1.249
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 client
provides name: georgia
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
DHCPDISCOVER(br-lan) 192.168.1.2 d8:d3:85:b2:da:b3
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 tags:
lan, known, br-lan
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
DHCPOFFER(br-lan) 192.168.1.2 d8:d3:85:b2:da:b3
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 1:netmask, 28:broadcast, 2:time-offset, 3:router,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 15:domain-name, 6:dns-server, 119:domain-search,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 12:hostname, 44:netbios-ns, 47:netbios-scope,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 26:mtu, 121:classless-static-route, 42:ntp-server
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 next
server: 192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  1 option: 53 message-type  2
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 54 server-identifier  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 51 lease-time  43200
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 58 T1  21600
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 59 T2  37800
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  1 netmask  255.255.255.0
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 28 broadcast  192.168.1.255
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  3 router  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  6 dns-server  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size: 16 option: 15 domain-name  home.laviola.org
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
available DHCP range: 192.168.1.100 -- 192.168.1.249
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 client
provides name: georgia
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
DHCPREQUEST(br-lan) 192.168.1.2 d8:d3:85:b2:da:b3
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 tags:
lan, known, br-lan
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
DHCPACK(br-lan) 192.168.1.2 d8:d3:85:b2:da:b3 georgia
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 1:netmask, 28:broadcast, 2:time-offset, 3:router,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 15:domain-name, 6:dns-server, 119:domain-search,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 12:hostname, 44:netbios-ns, 47:netbios-scope,
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949
requested options: 26:mtu, 121:classless-static-route, 42:ntp-server
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 next
server: 192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  1 option: 53 message-type  5
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 54 server-identifier  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 51 lease-time  43200
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 58 T1  21600
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 59 T2  37800
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  1 netmask  255.255.255.0
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option: 28 broadcast  192.168.1.255
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  3 router  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  4 option:  6 dns-server  192.168.1.1
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size: 16 option: 15 domain-name  home.laviola.org
Oct  1 21:38:59 ellis daemon.info dnsmasq-dhcp[2652]: 104793949 sent
size:  7 option: 12 hostname  georgia
--

Any ideas?
Thanks again for your help.

>
> "tcpdump ip6" can show what packets are on the wire too.
>
> Sean
>
>
> On 1 October 2012 01:38, Carlos Laviola <carlos.laviola at gmail.com> wrote:
>>
>> Hello everyone,
>>
>> I've recently switched to using only dnsmasq on openwrt since finding
>> out that it could also hand out IPv6 addresses. This works, but the
>> clients only get SLAAC addresses.
>>
>> Also, the manpage states:
>>
>> "A single dhcp-host may contain an IPv4 address or an IPv6 address, or
>> both. IPv6 addresses must be bracketed by square brackets thus:
>> --dhcp-host=laptop,[1234::56] Note that in IPv6 DHCP, the hardware
>> address is not normally available, so a client must be identified by
>> client-id (called client DUID in IPv6-land) or hostname."
>>
>> How do I find this client-id/DUID? Even with the "log-dhcp" directive,
>> I don't see anything that looks like it.
>>
>> Here are my conffiles. openwrt auto-generates a /var/etc/dnsmasq.conf
>> based on a file written in their own DSL (/etc/config/dhcp), which is
>> it's split in two files.
>>
>> /var/etc/dnsmasq.conf:
>>
>> --
>> conf-file=/etc/dnsmasq.conf
>> dhcp-authoritative
>> domain-needed
>> no-resolv
>> localise-queries
>> read-ethers
>> bogus-priv
>> expand-hosts
>> domain=home.laviola.org
>> server=/home.laviola.org/
>> server=8.8.8.8
>> server=8.8.4.4
>> server=2001:4860:4860::8888
>> server=2001:4860:4860::8844
>> server=2620:0:ccc::2
>> server=2620:0:ccd::2
>> dhcp-leasefile=/tmp/dhcp.leases
>> stop-dns-rebind
>> rebind-localhost-ok
>>
>>
>>
>>
>> dhcp-range=lan,192.168.1.100,192.168.1.249,255.255.255.0,12h
>> no-dhcp-interface=pppoe-wan
>>
>>
>> address=/ellis.home.laviola.org/192.168.1.1
>> ptr-record=1.1.168.192.in-addr.arpa,ellis.home.laviola.org
>> --
>>
>> /etc/dnsmasq.conf:
>>
>> --
>> dhcp-range=2001:ffff:666::,slaac
>> enable-ra
>> dhcp-host=192.168.1.2,[2001:ffff:666::1],client1
>> dhcp-host=192.168.1.3,[2001:ffff:666::2],client2
>> dhcp-host=192.168.1.4,[2001:ffff:666::3],client3
>> dhcp-host=192.168.1.5,[2001:ffff:666::4],client4
>> log-dhcp
>> --
>>
>> Thanks for your help!
>>
>> Best regards,
>> Carlos
>>
>> _______________________________________________
>> 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