How to configure ip access specified by redis public network
How to configure ip access specified by redis public network? I believe that most people have not yet learned this skill, in order to let you learn, to give you a summary of the following content, do not say much, let's move on.
# bind 192.168.1.100 10.0.0.1# bind 192.168.1.8# bind 127.0.0.1
After the modification is complete, the redis service needs to be restarted.
Redis-server redis.conf if iptables does not open port 6379, use this method to open the port
Command: / sbin/iptables-I INPUT-p tcp-- dport 6379-j ACCEPT save firewall modification command: / etc/rc.d/init.d/iptables save
Allow specified public network ip access through iptables
Modify Linux's firewall (iptables) to open your redis service port. The default is 6379.
/ / only allow 127.0.0.1 access to 6379iptables-An INPUT-s 127.0.0.1-p tcp-- dport 6379-j ACCEPT// other ip access all deny iptables-An INPUT-p TCP-- dport 6379-j REJECT
Before rejecting is configured
After configuration reject
Another way is to enable it through bind.
What is described above is how to configure the redis public network and specify the method for ip to access the redis service. The specific usage needs to be used by everyone in a hands-on experiment. If you want to know more about it, welcome to follow the industry information channel!