Update wireguard port and firewall rules
This commit is contained in:
parent
7a5372f030
commit
323d4a4e48
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let wireguard_port = "51902";
|
||||
let wireguard_port = "1194";
|
||||
|
||||
in {
|
||||
# Set hostname, hostid and enable WiFi
|
||||
|
@ -103,12 +103,12 @@ in {
|
|||
];
|
||||
# Allow wireguard traffic
|
||||
extraCommands = ''
|
||||
ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --sport ${wireguard_port} -j RETURN
|
||||
ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --dport ${wireguard_port} -j RETURN
|
||||
iptables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport ${wireguard_port} -j RETURN
|
||||
iptables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport ${wireguard_port} -j RETURN
|
||||
'';
|
||||
extraStopCommands = ''
|
||||
ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --sport ${wireguard_port} -j RETURN || true
|
||||
ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --dport ${wireguard_port} -j RETURN || true
|
||||
iptables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport ${wireguard_port} -j RETURN || true
|
||||
iptables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport ${wireguard_port} -j RETURN || true
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue