ich versuche grade, mich in nftables einzuarbeiten, habe aber ein paar Probleme damit.
Wir haben ein IPv4/IPv6 Setup und ich möchte, daß der betroffene host (in beiden IP-Stacks) von überallher pingbar ist.
Außerdem soll er von bestimmten Netzen aus per ssh erreichbar sein sowie ntp, syslog, smtp bzw submission in bestimmten Netzen erreichen können.
Da es sich um einen Reverse-Proxy handelt soll er außerdem http und https eingehend und ausgehend von/zu allen Hosts zulassen.
Leider scheitert beispielsweise ping in IPv6.
Ich habe den Verdacht, daß ich irgendwie einen falschen Ansatz verfolge und wäre froh über Ratschläge.
Ich habe derzeit folgendes in /etc/nftables.conf (die Netze habe ich zum posten geändert):
Code: Alles auswählen
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
set netze_intern4 {
type ipv4_addr
flags interval
auto-merge
elements = { 192.168.240.0/24, 192.168.244.0/24, 192.168.245.0/24 }
}
set netze_intern6 {
type ipv6_addr
flags interval
auto-merge
elements = { 2020:67a:1434:1::/64 }
}
chain incoming {
type filter hook input priority 0;
policy drop;
ct state invalid counter drop comment "early drop of invalid packets"
ct state established,related accept comment "accept all connections related to connections made by us"
iifname lo accept comment "accept loopback"
iif != lo ip daddr 127.0.0.1/8 counter drop comment "drop connections to loopback not coming from loopback"
iif != lo ip6 daddr ::1/128 counter drop comment "drop connections to loopback not coming from loopback"
ip protocol icmp counter accept comment "accept all ICMP types"
ip6 nexthdr icmpv6 counter accept comment "accept all ICMP types"
tcp dport { ssh } ip saddr @netze_intern4 accept comment "accept SSH from internal net"
tcp dport { ssh } ip6 saddr @netze_intern6 accept comment "accept SSH from internal net"
tcp dport { http, https } accept
# uncomment to enable log, choose one
log flags all
}
chain outgoing {
type filter hook output priority 0;
policy drop;
ct state established,related accept
iifname lo accept
ip protocol icmp accept #ausgehende pings
tcp dport { http, https, 53, ntp, smtp, submission, 514 } accept
udp dport { 53, 514 } accept
}
}
Vielen Dank im Voraus!
Otto