-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnftables.conf
41 lines (29 loc) · 1.02 KB
/
nftables.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/nft -f
table inet filter {
chain input {
type filter hook input priority 0;
# Standardaktion: Alle nicht explizit erlaubten Verbindungen werden abgelehnt
policy drop
# Erlaube bereits etablierte und verwandte Verbindungen
ct state {established, related} accept
# Verbindungen von und zu Loopback-Interface erlauben, damit können anwendungen innerhalb der Server mit einander kommunizieren.
iifname lo accept
# ICMP (Ping) erlauben
ip protocol icmp accept
ip6 nexthdr icmpv6 accept
# Erlaube SSH, HTTP, HTTPS und Port 8080
tcp dport {ssh,http,https,8080} accept
# Alle anderen Verbindungen abweisen mit ICMP-Port-Unreachable
reject with icmp type port-unreachable
}
chain forward {
type filter hook forward priority 0;
# Standardaktion: Alle Weiterleitungen werden abgelehnt
policy drop
}
chain output {
type filter hook output priority 0;
# Standardaktion: Alle ausgehenden Verbindungen werden erlaubt
policy accept
}
}