nftables: use allowlist for ICMP types

This commit is contained in:
Daniel Micay 2024-07-25 23:13:29 -04:00
parent 437c5a5f3d
commit 27bd153454
9 changed files with 18 additions and 9 deletions

View File

@ -41,7 +41,8 @@ table inet filter {
tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -41,7 +41,8 @@ table inet filter {
tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -53,7 +53,8 @@ table inet filter {
tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 25, 80, 443, 465, 993 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -41,7 +41,8 @@ table inet filter {
tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -51,7 +51,8 @@ table inet filter {
udp dport 123 notrack accept udp dport 123 notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -43,7 +43,8 @@ table inet filter {
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -55,7 +55,8 @@ table inet filter {
tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 53, 80, 443, 853 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -41,7 +41,8 @@ table inet filter {
tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {

View File

@ -51,7 +51,8 @@ table inet filter {
tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept tcp dport { 22, 80, 443 } tcp flags syn limit rate over 1024/second burst 1024 packets counter notrack accept
meta l4proto { tcp, udp } accept meta l4proto { tcp, udp } accept
meta l4proto { icmp, ipv6-icmp } notrack accept icmp type { echo-reply, destination-unreachable, echo-request, time-exceeded, parameter-problem } notrack accept
meta l4proto ipv6-icmp notrack accept
} }
chain input { chain input {