redis "No route to host" when pinging a remote redis host

Seems iptables was filtering everything out. Solution was to create a REDIS chain.

iptables -N REDIS
iptables -A REDIS -s 192.168.10.1 -j ACCEPT
iptables -A REDIS -s 192.168.10.2 -j ACCEPT
iptables -A REDIS -j LOG --log-prefix "unauth-redis-access"
iptables -A REDIS -j REJECT --reject-with icmp-port-unreachable
iptables -I INPUT -p tcp --dport 6379 -j REDIS

Hat tip to http://www.golja.org/blog/monitoring-traffic-with-iptables/


For me, I just use the Firewall GUI tool, to open the port 6379 TCP (which is being used by redis-server).

After that, I can use the redis-cli command line to connect using:

redis-cli -h <server IP> -p 6379