linux – 我的网站会在iptables重启期间停止吗?

在CentOS 6系统中,通过以下命令在iptables重启期间是否会停止网站?
$service iptables restart

解决方法

认情况下,没有. /etc/init.d/iptables脚本在重新启动时执行以下操作:
restart() {
    [ "x$IPTABLES_SAVE_ON_RESTART" = "xyes" ] && save
    stop
    start
}

尽管存在保存现有规则的问题,但未修改的停止的效果是禁用所有规则:

[root@bill ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: mangle nat filte[  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@bill ~]# iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets,0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets,0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 0 packets,0 bytes)
 pkts bytes target     prot opt in     out     source               destination

并假设(a)你要保存停止规则,你现有的规则是你想要的,或者(b)你没有保存规则停止,你的建议规则集在/ etc / sysconfig / iptables中在语法和功能上都是正确的,当开始将规则放回原位时,服务应该不间断地继续.

状态表不受停止防火墙规则的影响,因此在停止之前通过有状态规则允许通过的任何流量应该在启动后继续如此.但是,NAT规则会被暂停(暂时)删除,因此如果您使用NAT,则可能会受到重启的影响.

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...