Hello,
I've purposely avoided NFT for a while as I've never been able to find an answer for this, but as the new version of openwrt is now all nft/fw4 based, I guess now is the time to step up asking for help on this one.
All my firewalls, for years now, have been protected using a scheme where I use iptables -m recent module to basically allow a sequence of pings to specific tcp (or udp) ports in a specific order within a specific time frame (60 seconds). Each subsequent ping in order puts the ip address in another list, and after 3 or 4 proper pings, it finally reaches the goodperson bucket, where there is a rule to allow any ip in that bucket access to ssh (or whatever ports I want to give them etc)..
In the 10+ years I've done this, I have NEVER had a single hacker get thru to the ssh port of any device I have protected in this way.
So, before I switch to nft/fw4 I need to know how to do the equivilant in that.. I was told that nft doesn't support something like this a while back, although I find that hard to believe.. I am sure I am not the only one that has thought of and implemented something like this..
Can anyone tell me how to convert, for example, the following to nft/fw4??
iptables -I INPUT 3 -m state --state NEW -m tcp -p tcp --dport xxxx -m recent --rcheck --name knocked --seconds 30 -j open-doornumber2
iptables -I INPUT 4 -m state --state NEW -m tcp -p tcp --dport yyyy -m recent --rcheck --name doornumber2 --seconds 30 -j open-goodperson
iptables -I INPUT 5 -m state --state NEW -m recent --rcheck --name goodperson --seconds 43200 -j ACCEPT
iptables -N open-doornumber2
iptables -A open-doornumber2 -m recent --name doornumber2 --set
iptables -N open-goodperson
iptables -A open-goodperson -m recent --name goodperson --set