0

So I have an embedded system I've built with yocto. I'm trying to enable DHCPv6. But when I try to bring the interface online, ifup says it can't find DHCPv6 software, even though dhcpcd is installed. And dhcpcd works if I run it manually.

root@1234:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.5.80
        netmask 255.255.255.0
        gateway 192.168.5.1

iface eth1 inet6 dhcp

root@1234:~# ip a show dev eth1
8: eth1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue qlen 1000
    link/ether ce:e6:83:59:f1:93 brd ff:ff:ff:ff:ff:ff
    inet 169.254.23.45/16 brd 169.254.255.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::468b:6249:e50b:a437/64 scope link
       valid_lft forever preferred_lft forever

root@1234:~# which dhcpcd
/sbin/dhcpcd

root@1234:~# ifup eth1
No DHCPv6 client software found!
ifup: failed to bring up eth1

root@1234:~#

Note that eth1 is just a dummy interface for now, so that I don't break my ssh connection messing with eth0, which is really where I want to add DHCPv6.

1
  • 1
    You could run ifup eth1 with strace to see what DHCPv6 client programs it tries to find. Commented Jan 10 at 13:57

2 Answers 2

2
$ apt-get source ifupdown
[...]
$ grep -rB2 'No DHCPv6 client software found' ifupdown-0.8.44
ifupdown-0.8.44/inet6.defn-    dhclient -6 -1 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
ifupdown-0.8.44/inet6.defn-        elsif (var_true("dhcp", ifd) && execable("dhclient"))
ifupdown-0.8.44/inet6.defn:    echo 'No DHCPv6 client software found!' >&2; false \
[...]

It's looking for dhclient, not dhcpcd.

In inet.defn:

method dhcp
  description
    This method may be used to obtain an address via DHCP with any of
    the tools: dhclient, udhcpc, dhcpcd.

But for inet6, that's dhclient only.

It's found in:

$ apt-file search -F /usr/sbin/dhclient
isc-dhcp-client: /usr/sbin/dhclient
isc-dhcp-client-ddns: /usr/sbin/dhclient
1
  • Thank you! I'd looked at the source, but was looking at the wrong project (ifupdown-ng). This definitely explains it. isc-dhcp-client isn't an option in the yocto repository, so I think I'll just call dhcpcd from a script when the interface comes online. Commented Jan 13 at 13:38
0

I just ran into this and the existing answer doesn't actually tell you what the issue is:

dhcpcd is dual-stack by default, so if you have a iface eth0 inet dhcp line it will actually obtain you both IPv4 and IPv6 unless you have specified differently in dhcpcd.conf. So iface eth1 inet dhcp should work for you because it will just run dhcpcd for you.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Aug 15 at 16:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.