[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables vs iptables-legacy



Bonsoir

https://developers.redhat.com/blog/2020/08/18/iptables-the-two-variants-and-their-relationship-with-nftables#using_iptables_nft

peut aider à comprendre. Perso j'ai basculer sur nftables.

Le 27/06/2023 à 18:46, BERTRAND Joël a écrit :
	Bonsoir à tous,

	J'ai toujours écrit mes firewalls à la main. Aujourd'hui, un script
charge au démarrage le contenu de /var/lib/iptables/active au travers de
iptables (nf_tables).

	Or iptables-legacy est toujours disponible.

	J'avoue avoir un peu de mal à comprendre le lien entre les deux filtres.

Root rayleigh:[~] > iptables-legacy -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Root rayleigh:[~] > Root rayleigh:[~] > iptables -L
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain INPUT (policy DROP)
target     prot opt source               destination
f2b-recidive  tcp  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
...
Chain f2b-recidive (1 references)
target     prot opt source               destination
REJECT     all  --  subnet.crackbox.io   anywhere
reject-with icmp-port-unreachable
REJECT     all  --  193.56.29.178        anywhere
reject-with icmp-port-unreachable
REJECT     all  --  147.78.103.120       anywhere
reject-with icmp-port-unreachable
RETURN     all  --  anywhere             anywhere
Root rayleigh:[~] >

	D'après iptables-legacy, tout est ouvert. D'après iptables, tout est
fermé sauf ce qui est explicitement ouvert.

	La question est simple. Si je change la règle par défaut
iptables-legacy -DINPUT DROP, plus rien ne fonctionne. Les deux systèmes
sont-ils en série ? Un paquet traverse-t-il d'abord un système de filtre
puis l'autre en séquence ? Je n'ai pas trouvé l'information (je dois
chercher au mauvais endroit)...

	Bien cordialement,

	JB


Reply to: