nixos-module/container/bird: add radv
This commit is contained in:
parent
e9a2092608
commit
daa7bef9d5
|
@ -2,6 +2,13 @@
|
|||
|
||||
let
|
||||
hostConf = config.site.hosts.${hostName};
|
||||
|
||||
gatewayNet =
|
||||
let
|
||||
m = builtins.match "(.+)-gw" hostName;
|
||||
in if m == null
|
||||
then null
|
||||
else builtins.head m;
|
||||
in
|
||||
{
|
||||
services.bird2 = {
|
||||
|
@ -23,16 +30,27 @@ in
|
|||
scan time 10;
|
||||
}
|
||||
|
||||
# protocol radv {
|
||||
# interface "c3d2" {
|
||||
# min ra interval 10;
|
||||
# max ra interval 60;
|
||||
# prefix ::/64 {
|
||||
# preferred lifetime 20;
|
||||
# valid lifetime 60;
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
${lib.optionalString (gatewayNet != null) ''
|
||||
protocol radv {
|
||||
rdnss ${config.site.net.serv.hosts6.dn42.dnscache};
|
||||
|
||||
interface "${gatewayNet}" {
|
||||
min ra interval 10;
|
||||
max ra interval 60;
|
||||
|
||||
${builtins.concatStringsSep "\n" (
|
||||
map (subnet6: ''
|
||||
prefix ::/64 {
|
||||
preferred lifetime 20;
|
||||
valid lifetime 60;
|
||||
};
|
||||
'') (builtins.attrValues config.site.net.${gatewayNet}.subnets6)
|
||||
)}
|
||||
|
||||
dnssl "${config.site.net.${gatewayNet}.domainName}";
|
||||
};
|
||||
}
|
||||
''}
|
||||
|
||||
protocol ospf v2 ZW4 {
|
||||
area 0 {
|
||||
|
|
Loading…
Reference in New Issue