nixos/nat: optional networking.nat.externalInterface (#41864)

to prevent "cannot coerce null to string" raise before the assertions are checked
This commit is contained in:
volth 2018-06-12 13:14:15 +00:00 committed by xeji
parent 91cda44cf9
commit d79a5057d3

View File

@ -50,7 +50,7 @@ let
# NAT from external ports to internal ports.
${concatMapStrings (fwd: ''
iptables -w -t nat -A nixos-nat-pre \
-i ${cfg.externalInterface} -p ${fwd.proto} \
-i ${toString cfg.externalInterface} -p ${fwd.proto} \
--dport ${builtins.toString fwd.sourcePort} \
-j DNAT --to-destination ${fwd.destination}
@ -81,7 +81,7 @@ let
${optionalString (cfg.dmzHost != null) ''
iptables -w -t nat -A nixos-nat-pre \
-i ${cfg.externalInterface} -j DNAT \
-i ${toString cfg.externalInterface} -j DNAT \
--to-destination ${cfg.dmzHost}
''}