iptables禁止外网访问redis server服务默认端口6379的命令

 

//只允许127.0.0.1访问6379
iptables -A INPUT -s 127.0.0.1 -p tcp --dport 6379 -j ACCEPT
//其他ip访问全部拒绝
iptables -A INPUT -p TCP --dport 6379 -j REJECT

远程测试下

没拒绝前

iptables禁止外网访问redis server服务默认端口6379的命令

拒绝后

iptables禁止外网访问redis server服务默认端口6379的命令

posted @ 2016-10-30 21:21  这个名字想了很久~  阅读(5981)  评论(0编辑  收藏  举报