hat jemand von euch eine Firewall mit nftables erstellt?
Ich probiere es gerade und so sieht es bisher aus:
Code: Select all
#!/usr/sbin/nft -f
flush ruleset
table ip filter {
chain input {
type filter hook input priority 0; policy drop;
ct state { established, related } accept
ct state invalid drop
iifname lo accept
tcp dport { ftp, ftp-data, ftps, ftps-data } accept comment "FTP-Server"
tcp dport ssh limit rate 3/minute accept comment "SSH"
tcp dport { http, https } accept comment "Webserver"
tcp dport { smtp, submission, imaps, pop3s } accept comment "Mailserver"
tcp dport domain accept comment "DNS-Server"
udp dport domain accept comment "DNS-Server"
udp dport ntp accept comment "NTP"
icmp type { echo-request, echo-reply, destination-unreachable, time-exceeded } limit rate 7/second accept comment "ICMP"
icmp type { echo-request, echo-reply, destination-unreachable, time-exceeded } counter drop comment "ICMP-Drop"
tcp flags & ( fin | syn | rst | ack ) == syn drop
counter drop;
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
include "/etc/nftables/fail2ban.conf"
Muß man noch irgenwelche Kernel-Module laden und wie?
lsmod | grep ^nf gibt folgendes aus:
Code: Select all
nf_log_ipv4 16384 0
nf_log_common 16384 1 nf_log_ipv4
nft_log 16384 0
nft_limit 16384 2
nft_ct 20480 3
nf_conntrack 172032 1 nft_ct
nf_defrag_ipv6 20480 1 nf_conntrack
nf_defrag_ipv4 16384 1 nf_conntrack
nf_tables_set 32768 7
nf_reject_ipv4 16384 1 ipt_REJECT
nft_compat 20480 0
nft_counter 16384 3
nf_tables 143360 73 nft_ct,nft_compat,nft_log,nft_counter,nft_limit,nf_tables_set
nfnetlink 16384 2 nft_compat,nf_tables
Grüße
WebLive
[Mod-Edit]
Thread nach Off Topic verschoben, da der Topic erstmal nichts mit Keyhelp zu tun hat.