Networking: Difference between revisions
imported>Makefu initial batch of nixos-users |
imported>Fadenb m →Prefix delegation with fixed DUID: syntaxhighlight |
||
Line 7: | Line 7: | ||
Sometimes the hosting provider manages ipv6 networks via a so-called ''DUID'' or ''clientid''. This snippet is required to make the network routable: | Sometimes the hosting provider manages ipv6 networks via a so-called ''DUID'' or ''clientid''. This snippet is required to make the network routable: | ||
< | <syntaxhighlight lang="nix"> | ||
{ config, pkgs, ... }: | |||
let | let | ||
# Get this from your hosting provider | # Get this from your hosting provider | ||
clientid = | clientid = "00:11:22:33:44:55:66:77:88:99"; | ||
interface = | interface = "enp2s0"; | ||
subnet = | subnet = "56"; | ||
network = | network = "2001:bbb:3333:1111::/${subnet}"; | ||
own_ip = | own_ip = "2001:bbb:3333:1111::1/${subnet}"; | ||
in { | in { | ||
# ... snip ... | # ... snip ... | ||
Line 23: | Line 24: | ||
networking.dhcpcd.persistent = true; | networking.dhcpcd.persistent = true; | ||
networking.dhcpcd.extraConfig = '' | networking.dhcpcd.extraConfig = '' | ||
clientid | clientid "${clientid}" | ||
noipv6rs | noipv6rs | ||
interface ${interface} | interface ${interface} | ||
Line 29: | Line 30: | ||
static ip6_address=${own_ip} | static ip6_address=${own_ip} | ||
''; | ''; | ||
environment.etc. | environment.etc."dhcpcd.duid".text = clientid; | ||
}</ | } | ||
</syntaxhighlight> | |||
Source: [https://gist.github.com/gleber/9429ea43e6beb114250c3529b5c9d522 gleber gist for online.net IPv6 config in NixOS] | Source: [https://gist.github.com/gleber/9429ea43e6beb114250c3529b5c9d522 gleber gist for online.net IPv6 config in NixOS] |