mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
hosts/plover: update Wireguard firewall rules
This commit is contained in:
parent
9f91d78294
commit
805ef47f70
@ -24,15 +24,19 @@ in
|
||||
# IP forwarding for specific interfaces.
|
||||
filterForward = true;
|
||||
extraForwardRules = ''
|
||||
iifname ${wireguardIFName} oifname ${lanIFName} accept comment "IP forward from Wireguard interface to LAN"
|
||||
iifname ${wireguardIFName} accept comment "IP forward from Wireguard interface to LAN"
|
||||
'';
|
||||
};
|
||||
|
||||
networking.nftables.ruleset = ''
|
||||
table ip wireguard-${wireguardIFName} {
|
||||
chain prerouting {
|
||||
type nat hook prerouting priority filter; policy accept;
|
||||
}
|
||||
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority srcnat; policy accept;
|
||||
iifname ${wireguardIFName} oifname ${lanIFName} masquerade comment "Masquerade packets from Wireguard interface to LAN"
|
||||
iifname ${wireguardIFName} snat to ip ${interfaces.internal.IPv4.address} comment "Make packets from Wireguard interface appear as coming from the LAN interface"
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user