原文:https://my.oschina.net/ironwill/blog/902006
Redis server v=3.2.3
################################## NETWORK #####################################
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
#默认情况下,如果没有声明bind指令,Redis会监听服务器上所有可用的网络接口(网卡)上的连接。
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#可以用bind指令指定Redis监听的一个或多个网络接口(网卡),示例如下:
#
# Examples:
#
#bind 192.168.10.3 192.160.10.4 127.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
#如果你的Redis部署在公网上,并且监听所有网络接口(网卡),那么你的Redis示例便暴露给了互联网上的每个人,这样是很危险的。
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#bind 127.0.0.1
总之,通过bind是无法指定某个IP来访问redis的。这在网上是一个很大的误区!!
原文:https://www.cnblogs.com/binzhou75/p/12100419.html