有我的测试nft 规则集,除了表 inet 测试之外的所有工作, 但表f2b-table非常相似(除了 drop vs accept)并且工作正常:
table inet f2b-table {
set addr-set-sshd {
type ipv4_addr
elements = { 0.0.0.0 }
}
chain input {
type filter hook input priority filter - 1; policy accept;
tcp dport { 222 } ip saddr @addr-set-sshd drop
}
}
table inet default {
set full_op_port {
type inet_service
elements = { 222 }
}
set allowed_ips {
type ipv4_addr
elements = { 0.0.0.0 }
}
chain INPUT {
type filter hook input priority filter; policy drop;
ct state invalid drop
ct state { established, related } accept
iif "lo" accept
tcp dport @full_op_port accept
ip saddr @allowed_ips accept
ip protocol icmp accept
counter packets 17 bytes 884
}
chain FORWARD {
type filter hook forward priority filter; policy drop;
}
chain OUTPUT {
type filter hook output priority filter; policy accept;
}
}
table ip test {
chain PREROUTING {
type nat hook prerouting priority filter; policy accept;
}
chain POSTROUTING {
type nat hook postrouting priority srcnat; policy accept;
}
chain FORWARD {
type filter hook forward priority filter; policy drop;
}
}
table inet test {
set op_port {
type inet_service
elements = { 8888 }
}
chain INPUT {
type filter hook input priority filter - 2; policy accept;
tcp dport @op_port accept
}
}
我在 tcpdump 中看到包,当我在表 inet 测试中计数时看到包,但不接受包。我做错了什么?