Network: Allow syncthing.

This commit is contained in:
Dmitry Voronin 2024-12-13 10:48:04 +03:00
parent af7e9bb147
commit 7ba7e25072
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
5 changed files with 44 additions and 0 deletions

View file

@ -4,6 +4,14 @@
# Ssh access.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22143
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22143
# Syncthing.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 21027
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 21027
'';
};
}

View file

@ -6,6 +6,9 @@
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22143
# Syncthing.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 21027
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 21027

View file

@ -4,6 +4,14 @@
# Ssh access.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22143
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22143
# Syncthing.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 21027
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 21027
'';
};
}

View file

@ -0,0 +1,17 @@
{ ... }: {
networking = {
firewall.extraCommands = ''
# Ssh access.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22143
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22143
# Syncthing.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 21027
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 21027
'';
};
}

View file

@ -4,6 +4,14 @@
# Ssh access.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22143
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22143
# Syncthing.
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p tcp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 22000
iptables -I INPUT -j ACCEPT -s 10.0.0.0/8 -p udp --dport 21027
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p tcp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 22000
ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 -p udp --dport 21027
'';
};
}