I am configuring a REDIS server and I want to allow connections only from a set of specific IP addresses.
This is a Debian 10 server, and the recommended framework to use is nft, which I haven't used in the past.
The default ruleset is this:
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0;
}
chain forward {
type filter hook forward priority 0;
}
chain output {
type filter hook output priority 0;
}
}
What rule do I need to add in that file to allow incoming connections to redis from IP 1.1.1.1 and 2.2.2.2, dropping everything else?
REDIS is using port 6379.