Fórum Root.cz
Hlavní témata => Sítě => Téma založeno: vesterna12 15. 12. 2022, 19:21:35
-
Po aplikování následujících pravidel v Nftables jsem bez konektivity z localhostu
add table ip Restrictive
add chain ip Restrictive Incoming { type filter hook input priority 0; policy drop; }
add chain ip Restrictive Redirect { type filter hook forward priority 0; policy drop; }
add chain ip Restrictive Outgoing { type filter hook output priority 0; policy accept; }
add rule ip Restrictive Incoming iifname lo counter accept
add rule ip Restrictive Incoming oifname lo counter accept
Čekal bych, že pravidlo
add chain ip Restrictive Outgoing { type filter hook output priority 0; policy accept; }
povolí všechna odchozí spojení, ale na internet se nedostanu.
Pokud pravidlo
add rule ip Restrictive Incoming iifname lan33 counter accept
add rule ip Restrictive Incoming oifname lan33 counter accept
povolím i pro lan tak to sice funguje, ale všichni se z lan dostanou na všechny služby.
-
Po aplikování následujících pravidel v Nftables jsem bez konektivity z localhostu
add table ip Restrictive
add chain ip Restrictive Incoming { type filter hook input priority 0; policy drop; }
add chain ip Restrictive Redirect { type filter hook forward priority 0; policy drop; }
add chain ip Restrictive Outgoing { type filter hook output priority 0; policy accept; }
add rule ip Restrictive Incoming iifname lo counter accept
add rule ip Restrictive Incoming oifname lo counter accept
Čekal bych, že pravidlo
add chain ip Restrictive Outgoing { type filter hook output priority 0; policy accept; }
povolí všechna odchozí spojení, ale na internet se nedostanu.
Pokud pravidlo
add rule ip Restrictive Incoming iifname lan33 counter accept
add rule ip Restrictive Incoming oifname lan33 counter accept
povolím i pro lan tak to sice funguje, ale všichni se z lan dostanou na všechny služby.
Na internet sa tymto dostanete, server z internetu vam aj odpovie, len problem je ze tu odpoved zahodite.
-
{ type filter hook input priority 0; policy drop; }
Když povolíš existující spojení v Incoming chainu, tak to bude fungovat.
add chain ip Restrictive Incoming ct state { established, related } accept
Snad jsem to napsal dobře.
Je tu dobrý seriál o nftables.
https://www.root.cz/serialy/firewall-s-nftables/
-
Jedna technicka - misto iifname lo pouzivejte iif lo. Lo interface mate vzdycky. Iifname je urceny pro interfacy, ktere se mohou objevit az po nacteni pravidel.