1、更新iptables并立即生效:

  a、保存当前设置:iptables-save > /etc/iptables.up.rules

  b、修改iptables规则;

    例如: -I INPUT -s 61.164.252.0/24  -d 0/0 -p tcp --dport 5001 -j ACCEPT  //指定某网段访问5001端口

       -A INPUT -p tcp -m tcp --dport 9105 -j ACCEPT             //对所有的ip均可访问9105端口

        -A INPUT -s 203.156.196.2/32 -p tcp -m tcp -j ACCEPT     //允许该ip访问

  c、使当前rule生效:iptables-restore < /etc/iptables.up.rules

相关文章:

  • 2022-12-23
  • 2021-06-05
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-06-12
  • 2021-07-08
猜你喜欢
  • 2021-12-05
  • 2021-12-05
  • 2021-11-18
  • 2021-12-19
  • 2021-11-28
  • 2022-01-06
  • 2022-12-23
相关资源
相似解决方案