redis有两个方案都可以只允许某些ip访问

1.redis.conf 修改bind 并重启
bind 192.168.1.100 10.0.0.1

2.使用iptables
iptables -A INPUT -s 10.19.42.53 -p tcp –dport 6379 -j ACCEPT
iptables -A INPUT -s 10.19.190.32 -p tcp –dport 6379 -j ACCEPT
iptables -A INPUT -s 10.19.165.206 -p tcp –dport 6379 -j ACCEPT
iptables -A INPUT -p TCP –dport 6379 -j REJECT

Comments are closed.

Post Navigation