【问题标题】:iptables allow request started by serveriptables 允许服务器启动的请求
【发布时间】:2021-05-01 01:12:31
【问题描述】:

如您所见,我们需要 iptables 来阻止我们不需要保护服务器的端口。 但是我需要请求一些第三方资源,我对如何去做感到困惑。 这是我的 iptables 规则

iptables -F
iptables -A INPUT -p UDP -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -s 110.75.147.65/32 -j ACCEPT
iptables -A INPUT -s localhost -j ACCEPT
iptables -A INPUT -j DROP

110.75.147.65/32是第三方服务器的IP之一,不知道有没有办法让我的服务器启动所有连接,例如curl https://www.google.com/,否则我需要将我所有第三方服务器的 IP 添加到 iptables 规则中。

【问题讨论】:

    标签: linux iptables


    【解决方案1】:

    怎么样

    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    

    【讨论】:

      猜你喜欢
      • 2013-11-04
      • 2018-12-03
      • 2017-01-02
      • 1970-01-01
      • 1970-01-01
      • 2018-08-02
      • 2018-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多