Ubuntu – Allowing access to redis port for only specific servers with ufw

firewallredisUbuntuufw

I've installed ufw on my Ubuntu 10.04 server. The only thing running on that server is going to be ElasticSearch and Redis. Redis uses port 6379. I only want two different IPs to be able to access the IP address of this machine on that port. I ran the following command:

sudo ufw allow from xx.xx.xx.x1 to any port 6379
sudo ufw allow from xx.xx.xx.x2 to any port 6379
sudo ufw status

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
6379                       ALLOW       xx.xx.xx.x1
6379                       ALLOW       xx.xx.xx.x2
80                         ALLOW       Anywhere
8080                       ALLOW       Anywhere
8080/tcp                   ALLOW       Anywhere

To me it appears as if those two IPs should then be able to access that IP address on that server. But they aren't able to make a connection. Are there other ports I need to open for this to be able to happen?

Best Answer

I figured it out. Deleting the follow rule fixed it such that only those IPs were able to connect.

ufw delete allow 8080

8080                         ALLOW       Anywhere
Related Topic