Re: Prefix delegations lost after link lost on delegated interfaces
Roy Marples
Sat Jun 06 04:19:45 2020
Hi Nathan, sorry for the late reply
On 03/06/2020 16:46, Nathan O'Meara wrote:
I am using dhcpcd 8.1.9 on Gentoo to manage the WAN interface on my router, as
well as to delegate the IPv6 prefixes assigned by DHCPv6 to my internal
interfaces (which have statically configured ipv4 addresses using gentoo’s
net-scripts).
I technically only have two physical interfaces, wan0 and lan0, but lan0 is
configured with multiple VLANs. Occasionally, usually do to switch software
updates, but sometimes due to other causes, the lan0 physical interfaces loses
link for a few minutes. After the link is re-established, the static IPv4
addresses are present, but the delegated ipv6 addresses are missing. A side
effect here is in this state, if I restart dhcpcd or restart the entire system,
the DHCP lease seems to be stuck requesting a /64 instead of the previous /56,
until I clear out the wan0.lease6 file and restart dhcpcd.
I would like to retain the separation between using dhcpcd for my wan (and
prefix delegation), while retaining the distribution-specific config for the
internal static/vlan addresses. Is it possible to configure dhcpcd to
re-establish the PD addresses on the internal interfaces when they come back up,
without using dhcpcd to configure their IPv4 addresses?
It should be doing this by default.
When an interface comes up, it asks any other interfaces "do you have a
delegaton for me?" and then rocks with it.
For example this:
allow interfaces eth0
interface eth0
ia_pd 1 eth1 eth2
So dhcpcd only operates on eth0 directly.
It will "activate" eth1 and eth2 for delegation only.
If the only way to fix this is to use dhcpcd fully administer the lan0*
interfaces, is there a way to manage them separately at runtime? For example,
currently I can restart dhcpcd to force a renewal of my wan0 interface, but that
only effects the ipv6 delegated addresses on the internal addresses, which
become invalid if the prefix is released, so that is correct behavior. I do not
want to lose LAN connectivity when I simply need to restart the WAN interface.
I have included my config file below in case I have any errors in it or old
config options that should be changed in the current version.
Thanks.
$ cat /etc/dhcpcd.conf | grep -v "^#"
debug
logfile /var/log/dhcpcd.log
hostname
duid
waitip 6
noipv6rs
nodhcp
nodhcp6
noipv4ll
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
nohook lookup-hostname
nohook resolv.conf
interface wan0
dhcp
dhcp6
ipv4ll
ia_pd wan0/::/56 lan0/0/64 lan0.42/2/64 lan0.43/3/64 lan0.110/4/64 lan0.214/5/64
lan0.215/6/64
The bit you are missing is allow/deny to limit dhcpcd as per your request.
Roy
Archive administrator: postmaster@marples.name