forked from mirrors/nixpkgs
nixos/network-interfaces: Add ipv6 gateway support
This commit is contained in:
parent
c812e45292
commit
1036c66d43
|
@ -85,6 +85,12 @@ in
|
|||
optionalString (cfg.defaultGatewayWindowSize != null)
|
||||
"window ${cfg.defaultGatewayWindowSize}"} || true
|
||||
''}
|
||||
${optionalString (cfg.defaultGateway6 != null && cfg.defaultGateway6 != "") ''
|
||||
# FIXME: get rid of "|| true" (necessary to make it idempotent).
|
||||
ip -6 route add ::/0 via "${cfg.defaultGateway6}" ${
|
||||
optionalString (cfg.defaultGatewayWindowSize != null)
|
||||
"window ${cfg.defaultGatewayWindowSize}"} || true
|
||||
''}
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ in
|
|||
DHCP = override (dhcpStr cfg.useDHCP);
|
||||
} // optionalAttrs (cfg.defaultGateway != null) {
|
||||
gateway = override [ cfg.defaultGateway ];
|
||||
} // optionalAttrs (cfg.defaultGateway6 != null) {
|
||||
gateway = override [ cfg.defaultGateway6 ];
|
||||
} // optionalAttrs (domains != [ ]) {
|
||||
domains = override domains;
|
||||
};
|
||||
|
|
|
@ -256,6 +256,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
networking.defaultGateway6 = mkOption {
|
||||
default = null;
|
||||
example = "2001:4d0:1e04:895::1";
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The default ipv6 gateway. It can be left empty if it is auto-detected through DHCP.
|
||||
'';
|
||||
};
|
||||
|
||||
networking.defaultGatewayWindowSize = mkOption {
|
||||
default = null;
|
||||
example = 524288;
|
||||
|
|
Loading…
Reference in a new issue