The BOOTP protocol was designed to supply basic boot parameters to diskless devices over a local network. It exchanged UDP datagrams containing IPv4 addresses for the server, the gateway, and the client itself, as well as hardware address, host name and boot filename. In addition BOOTP provided for a vendor-specific area. DHCP, that is DHCPv4, extended the vendor area and renamed it as options, otherwise maintaining compatibility with BOOTP. DHCPv6 removed all IPv4 fields, reducing the base record to just four bytes. All the relevant data is stuffed in the form of options. One of them is the IPv6 address lease, which is the semantic core of the protocol. The option for prefix delegation is derived by homology, adding just one byte for the prefix length. That way, boot parameters came to include router configurations.
Most ISPs install a router between a line terminal and the customer's PC or server. This is useless on a Linux box, since the OS includes support for whatever link layer it uses, such as PPPoE, 802.*, and similar. However, my ignorance of IPv6 amazed me when I found that simply connecting to the line didn't work. IPv4 was all right, IPv6 mute. I asked for help in Unix & Linux and eventually replied to myself there. The answer was DHCP. However, I was reluctant to run a DHCP client on the box which is already running a DHCP server. I had already configured fixed IP addresses and didn't want to add processes that would mess up with them. So I managed to hack a program to just send the two required packets.
The program doesn't (yet) check that the delegation went as expected. Copy and paste the script to your editor of choice. Note that it uses
\n line endings. Add
\r if needed. Save it as
dhcpv6cli.c. Last update was today, Mon 22 May 2023.
Copyright (C) 2023 Alessandro Vesely, all rights reserved except as noted.