system/wireguard: also forward udp
This commit is contained in:
parent
52e53ba5b3
commit
4a91f8a165
1 changed files with 3 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ let
|
||||||
serverIp = gcSecrets.wireguard.gateway;
|
serverIp = gcSecrets.wireguard.gateway;
|
||||||
|
|
||||||
forwarding = {
|
forwarding = {
|
||||||
# "22727" = [ "10.100.0.3" "7777" ];
|
"22727" = [ "10.100.0.3" "7777" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
mapForwards = type:
|
mapForwards = type:
|
||||||
|
|
@ -18,6 +18,8 @@ let
|
||||||
in ''
|
in ''
|
||||||
${pkgs.iptables}/bin/iptables -${type} PREROUTING -t nat -i ${serverInterface} -p tcp --dport ${sport} -j DNAT --to ${dest}:${dport}
|
${pkgs.iptables}/bin/iptables -${type} PREROUTING -t nat -i ${serverInterface} -p tcp --dport ${sport} -j DNAT --to ${dest}:${dport}
|
||||||
${pkgs.iptables}/bin/iptables -${type} FORWARD -p tcp -d ${dest} --dport ${dport} -j ACCEPT
|
${pkgs.iptables}/bin/iptables -${type} FORWARD -p tcp -d ${dest} --dport ${dport} -j ACCEPT
|
||||||
|
${pkgs.iptables}/bin/iptables -${type} PREROUTING -t nat -i ${serverInterface} -p udp --dport ${sport} -j DNAT --to ${dest}:${dport}
|
||||||
|
${pkgs.iptables}/bin/iptables -${type} FORWARD -p udp -d ${dest} --dport ${dport} -j ACCEPT
|
||||||
'') forwarding
|
'') forwarding
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue