Bonjour,
je fais des test sur l’interface NFTABLES.
Mon souci est que j’ai plus acces a Internet alors que j’ai ouvert les port 443 et 80, le port 53 et autorise l’ICMP en entrée et en sortie. Apres plus recherche, je ne vois pas ce qui pose probleme.
#!usr/sbin/nft -f
# creation de la table test_ip_v4
add table ip test_ip_v4
# creation de la base chain rattacher au hook input
add chain ip test_ip_v4 input { type filter hook input priority 0; }
# creation de la base chain rattacher au hook output
add chain ip test_ip_v4 output { type filter hook output priority 0; }
#ajout des regles
#regle HTTP
add rule test_ip_v4 input tcp dport 80 accept
add rule test_ip_v4 output tcp sport 80 accept
#regle HTTPS
add rule test_ip_v4 input tcp dport 443 accept
add rule test_ip_v4 output tcp sport 443 accept
#regle SSH
add rule test_ip_v4 input tcp dport 1337 accept
add rule test_ip_v4 output tcp sport 1337 accept
#regle DNS
add rule test_ip_v4 input tcp dport 53 accept
add rule test_ip_v4 input udp dport 53 accept
add rule test_ip_v4 output tcp sport 53 accept
add rule test_ip_v4 output udp sport 53 accept
#regle pour l'ICMP
add rule test_ip_v4 input icmp type echo-reply accept
add rule test_ip_v4 input icmp type echo-request accept
add rule test_ip_v4 output icmp type echo-reply accept
add rule test_ip_v4 output icmp type echo-request accept
#blocage des autres ports
add rule test_ip_v4 input drop
add rule test_ip_v4 output drop
Si je drop pas, y a aucun souci ce qui est normal.
Précision utile ou non, je fais mes tests sur une VM
merci d’avance pour votre aide.