OpenWrt Forum Archive

Topic: IPv6 w/o odhcpd in Barrier Breaker (14.07)

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I want to be able to use dnsmasq to hand out both Ipv4 and IPv6 addresses. That is I want to disable this odhcpd thing altogether.

Can someone point me to what would be needed to do this in Barrier Breaker. I have a /64 via heanet and want to allow both SLAAC and DHCPv6.

Thanks,
Sachin

This is how I've done it on CC, hopefully some/all applies.  For my own build I excluded odhcpd but this shouldn't be necessary.

Go to lan interface, dhcp, ipv6 settings (bottom of page)  Set Route-advertisement, dhcpv6-server & ndp proxy to disabled.

Add to /etc/dnamasq.conf something like:

quiet-dhcp
quiet-dhcp6
quiet-ra

dhcp-range=lan,::100, ::F:FFFF:FFFF, constructor:br-lan, ra-names, 64, 12h

enable-ra


I'm curious as to why you don't want to use odhcpd?  I've always been a dnsmasq ipv6 integration type guy so as soon as I tried openwrt CC it got disabled....I never gave it a chance.  But I'm thinking of re-enabling it to see what behaviour/functionality it has, whether it is better or just different.

Kevin

edit: Thought, under BB dnsmasq may not be compiled with ipv6 support  run 'dnsmasq --version' and check it has IPv6 & DHCPv6 in the compile time options.

(Last edited by kevindb on 19 Apr 2015, 08:08)

In both BB14.07 and in CC trunk you need to install a special variant of dnsmasq, either "dnsmasq-dhcpv6" or "dhcpv6-full", as the basic dnsmasq package has been stripped of the dhcpv6 functionality due to size optimization. You can see the packages size below (for ar71xx):

https://downloads.openwrt.org/snapshots … ages/base/
dnsmasq-dhcpv6_2.73rc4-2_ar71xx.ipk                17-Apr-2015 16:03              103064
dnsmasq-full_2.73rc4-2_ar71xx.ipk                  17-Apr-2015 16:04              121716
dnsmasq_2.73rc4-2_ar71xx.ipk                       17-Apr-2015 16:03               85840

https://downloads.openwrt.org/barrier_b … ages/base/
dnsmasq-dhcpv6_2.71-4_ar71xx.ipk                   24-Sep-2014 09:29               98625
dnsmasq-full_2.71-4_ar71xx.ipk                     24-Sep-2014 09:29              116919
dnsmasq_2.71-4_ar71xx.ipk                          24-Sep-2014 09:29               82212

And you probably need to go the example config file in dnsmasq sources to see the correct options:
BB14.07: http://thekelleys.org.uk/gitweb/?p=dnsm … tags/v2.71
trunk: http://thekelleys.org.uk/gitweb/?p=dnsm … s/v2.73rc4

(Last edited by hnyman on 19 Apr 2015, 08:28)

Thanks a lot, both of you guys. I will try this out and report back.

hnyman: where can I find differences between dnsmasq-dhcpv6 & dnsmasq-full?

kevindb: I first used odhcpd as the only DHCP server and it would not serve IPv4. As I have to use dnsmasq anyway, why not use a single package? Also DNSMasq does have a lot of documentation (albeit scattered around), while odhcpd sorely lacks documentation. How does one run hook scripts when interfaces get leases etc.? Also, if dnsmasq does provide what is needed and is pretty well used and a stable piece of software, I have not seen the need of a new package to do part of the stuff.

Another question: what is the state of CC? Where can I find build for my router?

Thanks all. I was able to get this working. However, my need was to be able to also provide DHCPv6 addresses to hosts for which the option should be "slaac" and not "ra-names".

However, I am still struggling with the format of the "dhcp-host" line.

This works:
# Static IPv4 addresses                                                   
dhcp-host=<mac address>,hostname 

However, am unable be get the following to work:
                       
dhcp-host=id:<duid as 00:01:00:01:...>,[::abcd],hostname 

But this works:

dhcp-host=hostname,[::abcd]


So, will the following IPv4 & v6 combination work?

dhcp-host=<mac address>,hostname,[::abcd]

IPv6 in desperate efforts to make things simple has the most confusing set of address advertising/allocation options I've ever come across.  And the dnsmasq man page isn't the most readable but then it is a very powerful piece of software!

I've found 'ra-names' works for me in that hosts that understand dhcpv6 will get address via that, whilst those that don't fall back to SLAAC in response to the router advertisments that go out on the wire.  Certainly my 'i' devices from the fruit emporium collect SLAAC ipv6 addresses rather than DHCPv6:  I want devices to try dhcpv6 first if they're capable and so far it seems to behave as I want....willing to be corrected though :-)

Re: dhcp-host option - I've not yet tackled trying to do fixed addresses for hosts (or DUIDs) so I'd be interested in your success or otherwise.  What I would suggest is using 'log-dhcp' to see what dhcp requests are being made, and what replies, complete with all the dnsmasq internal tagging that goes on.

I can see dhcpv6 DUID based fixed addressing being tomorrow's experiment :-)

This works to give fixed names (for me):

dhcp-host=MACID,IPv4,hostname,[::IPv6 Host part]

Didn't try duid. Wrote a script to do nsupdate of all leases which works smile However, had to jump through hoops to get whether address is IPv6 and then hardcode for global routing ... Don't want link-local addresses to be in DNS smile

The discussion might have continued from here.