【问题标题】:IPTables disrupts WebServer Connections on Startup [closed]IPTables 在启动时中断 WebServer 连接 [关闭]
【发布时间】:2016-09-13 11:22:22
【问题描述】:

好吧,这在我过去的编码和使用 Linux 经验中以前没有发生过,但是现在,当我启动 IPTables 时,我无法以任何可能的方式访问我的网站。 SSH 仍然有效。

我的操作系统:
CentOS Linux release 7.2.1511 (Core)

还有我的 IPTables 里面的东西:

# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

如果有人能帮我解决这个问题,那就太好了。

【问题讨论】:

    标签: linux configuration centos webserver iptables


    【解决方案1】:
    iptables -I INPUT 3 -p tcp -m state --state NEW -m tcp -m multiport --dports 80,443 -j ACCEPT
    

    如果你能阅读 iptables 的手册,那就太好了。

    【讨论】:

    • IPTables 给我一条消息说:iptables: Index of insertion too big. 还有其他方法可以解决这个问题吗?
    • 不能太大,INPUT链已经有5行了。
    • 我想我会尝试在规则文件中手动编辑它。如果它有效,我会更新你。
    • 效果很好!谢谢! ^_^
    • 如果您通过 cli 添加规则以保持持久性,也请保存规则。
    猜你喜欢
    • 1970-01-01
    • 2017-02-20
    • 1970-01-01
    • 1970-01-01
    • 2014-02-04
    • 1970-01-01
    • 2016-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多