朱纯树博客
VPS测评推荐网站
cloudacead cloudacead

如何配置redis外网可访问并只允许指定的ip可访问redis

如何配置redis外网可访问并只允许指定的ip可访问redis插图

 

# bind 192.168.1.100 10.0.0.1

# bind 192.168.1.8

# bind 127.0.0.1

修改完成后,需要重新启动redis服务。

redis-server redis.conf如果iptables 没有开启6379端口,用这个方法开启端口

 

命令:/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT保存防火墙修改命令:/etc/rc.d/init.d/iptables save

通过iptables 允许指定的外网ip访问

修改 Linux 的防火墙(iptables),开启你的redis服务端口,默认是6379。

 

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

未配置拒绝前

配置拒绝后

另外一种方式是通过bind方式启用

以上就是配置redis外网可访问,并只允许指定的ip可访问redis的全部内容。

 

文章来源于互联网: 如何配置redis外网可访问并只允许指定的ip可访问redis

赞(0) 打赏
未经允许不得转载:VPS测评推荐网站 - 朱纯树博客 » 如何配置redis外网可访问并只允许指定的ip可访问redis

评论 870

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #870

    portuguese milf porn

    aunty fuck2小时前回复
  2. #869

    get generic pregabalin without prescription how to buy generic pregabalin prices where to get generic pregabalin without prescription

  3. #868

    Drugs information. Effects of Drug Abuse.
    abilify tablet
    Everything what you want to know about pills. Read now.

    ZfiHTLC11小时前回复
  4. #867

    Actual information about medication. Get information here.
    prednisone no prescription
    Best news about medicines. Read here.

    RclYQED14小时前回复
  5. #866

    Medication information sheet. What side effects?
    propecia
    Best what you want to know about medication. Read information here.

    AtbRNDM17小时前回复
  6. #865

    Medicine information sheet. Long-Term Effects.
    lyrica
    All trends of pills. Get now.

    MskPSQC18小时前回复
  7. #864

    Best news about drugs. Get information here.

    lisinopril/hctz
    Best news about medicine. Read information here.

    HqfCRML21小时前回复
  8. #863

    how to buy cheap pregabalin prices cheap pregabalin pills buying generic pregabalin no prescription

  9. #862

    pregabalin pills can you buy cheap pregabalin prices can i purchase pregabalin without insurance

  10. #861

    can i get cheap pregabalin without insurance buying pregabalin without prescription get cheap pregabalin prices

  11. #860

    Drug information sheet. Short-Term Effects.
    cheap trazodone
    Actual news about medication. Get now.

  12. #859

    Medicines information leaflet. Generic Name.
    prednisone tablet
    All what you want to know about medicament. Read here.

  13. #858

    https://doxycycline.science/# doxycycline 100 mg

    Thomasbix1天前回复
  14. #857

    cost of generic lyrica without prescription cheap lyrica without a prescription can i order cheap lyrica without prescription

  15. #856

    All about meds. Read information now.

    pantoprazole side effects in elderly
    Actual what you want to know about drugs. Get now.