Skip to content

Instantly share code, notes, and snippets.

@dlitz
Created April 24, 2026 17:52
Show Gist options
  • Select an option

  • Save dlitz/487d733140aa784559d73e4cd6f7231e to your computer and use it in GitHub Desktop.

Select an option

Save dlitz/487d733140aa784559d73e4cd6f7231e to your computer and use it in GitHub Desktop.
systemd-networkd options for stable address assignment
[Network]
DHCPPrefixDelegation=yes
DHCP=yes
IPv6AcceptRA=yes
IPv6LinkLocalAddressGenerationMode=eui64
# Note: If IgnoreCarrierLoss is set to yes, then "networkctl down wan0;
# networkctl up wan0" will still drop the default route and not recreate it
# until another DHCP exchange is performed.
IgnoreCarrierLoss=no
KeepConfiguration=dhcp-on-stop
[DHCPv4]
# Don't release the address when shutting down the network interface.
SendRelease=no
# RequestAddress is initially commented out, then changed to the IPv4 address I was assigned by the server.
RequestAddress=199.x.x.x
# The following allows me to replace router hardware and continue to be assigned the same address simply by cloning the MAC address of the previous router.
ClientIdentifier=duid
DUIDType=link-layer
IAID=0x3355ff77
[DHCPv6]
# ISP only assigns prefixes over DHCPv6. Individual addresses are assigned using SLAAC.
UseAddress=no
# ISP's router advertisements don't have the Managed flag set.
WithoutRA=solicit
# Enable DHCPv6-PD
UseDelegatedPrefix=yes
# Don't release the prefix when shutting down the network interface.
SendRelease=no
# PrefixDelegationHint is initially set to ::/56, then changed to the IPv6 prefix I was assigned by the server.
PrefixDelegationHint=2001:db8:4242:4200::/56
# The following allows me to replace router hardware and continue to be assigned the same address simply by cloning the MAC address of the previous router. IAID can be any constant.
DUIDType=link-layer
IAID=0x3355ff77
[DHCPPrefixDelegation]
ManageTemporaryAddress=no
SubnetId=0xf
Token=::1
UplinkInterface=:self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment