Sample Header Ad - 728x90

nftables allow redis only from specific IP addresses

4 votes
2 answers
16901 views
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.
Asked by Miguel Mesquita Alfaiate (449 rep)
Dec 23, 2019, 10:24 AM
Last activity: Jul 28, 2021, 07:05 AM