Skip to content

Commit 4548324

Browse files
lukegbflokli
authored andcommitted
nixos/tayga: add option to allow toggling WKPF strict compliance
The RFC requires that we don't allow access to non-global v4 addresses using the well-known 64:ff9b:: prefix, but there are some deployments where it's convenient to permit this. To make this work in tests, disable wkpf-strictness via the config option introduced in bc18503e2ff1ee48ac472a67ba982dae76a5c2d3. Tayga added 100.64.0.0 to the set of WKPF in 4dff17ef61821f5bc1996ce687a3dc317fd4fa50.
1 parent b45ba94 commit 4548324

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

nixos/modules/services/networking/tayga.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ let
2727
${optionalString ((builtins.length cfg.log) > 0) ''
2828
log ${concatStringsSep " " cfg.log}
2929
''}
30+
31+
wkpf-strict ${if cfg.wkpfStrict then "yes" else "no"}
3032
'';
3133

3234
addrOpts =
@@ -145,6 +147,12 @@ in
145147
[ "drop" "reject" "icmp" "self" ]
146148
'';
147149
};
150+
151+
wkpfStrict = mkOption {
152+
type = types.bool;
153+
default = true;
154+
description = "Enable restrictions on the use of the well-known prefix (64:ff9b::/96) - prevents translation of non-global IPv4 ranges when using the well-known prefix. Must be enabled for RFC 6052 compatibility.";
155+
};
148156
};
149157
};
150158

nixos/tests/tayga.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@
3131
};
3232

3333
nodes = {
34-
# The server is configured with static IPv4 addresses. RFC 6052 Section 3.1
35-
# disallows the mapping of non-global IPv4 addresses like RFC 1918 into the
36-
# Well-Known Prefix 64:ff9b::/96. TAYGA also does not allow the mapping of
37-
# documentation space (RFC 5737). To circumvent this, 100.64.0.2/24 from
38-
# RFC 6589 (Carrier Grade NAT) is used here.
34+
# The server is configured with static IPv4 addresses. We have to disable the
35+
# well-known prefix restrictions (as required by RFC 6052 Section 3.1) because
36+
# we're using private space (TAYGA also considers documentation space non-global,
37+
# unfortunately).
3938
# To reach the IPv4 address pool of the NAT64 gateway, there is a static
4039
# route configured. In normal cases, where the router would also source NAT
4140
# the pool addresses to one IPv4 addresses, this would not be needed.
@@ -145,6 +144,7 @@
145144
"icmp"
146145
"self"
147146
];
147+
wkpfStrict = false;
148148
};
149149
environment.systemPackages = [ pkgs.tcpdump ];
150150
};
@@ -217,6 +217,7 @@
217217
"icmp"
218218
"self"
219219
];
220+
wkpfStrict = false;
220221
};
221222
environment.systemPackages = [ pkgs.tcpdump ];
222223
};

0 commit comments

Comments
 (0)