Cleaner forwarding
This commit is contained in:
@@ -24,11 +24,13 @@ in
|
||||
|
||||
${concatMapStringsSep "\n" (ports:
|
||||
let
|
||||
src = builtins.elemAt ports 0;
|
||||
dst = builtins.elemAt ports 1;
|
||||
from = builtins.elemAt ports 0;
|
||||
to = builtins.elemAt ports 1;
|
||||
src = builtins.elemAt ports 2;
|
||||
dst = builtins.elemAt ports 3;
|
||||
in ''
|
||||
iifname "${cfg.inInterface}" tcp dport ${toString src} counter dnat to ${cfg.toAddr}:${toString dst}
|
||||
iifname "${cfg.inInterface}" udp dport ${toString src} counter dnat to ${cfg.toAddr}:${toString dst}
|
||||
iifname "${from}" tcp dport ${toString src} counter dnat to ${to}:${toString dst}
|
||||
iifname "${from}" udp dport ${toString src} counter dnat to ${to}:${toString dst}
|
||||
''
|
||||
) cfg.forwarding.ports}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user