刷新iptables打破了我的pipe道,我怎样才能保存我的实例?

当我执行一个iptables -F和我的sshpipe道坏了的时候,我正在设置我的iptables。

这是我的最后一个输出:

root@alfapaints:~# iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW,ESTABLISHED tcp dpt:2222 ACCEPT tcp -- li465-68.members.linode.com anywhere state NEW,ESTABLISHED tcp dpt:nrpe ACCEPT tcp -- anywhere anywhere tcp dpt:9200 state NEW,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW,ESTABLISHED ACCEPT udp -- anywhere anywhere udp spt:domain Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state ESTABLISHED tcp spt:2222 ACCEPT tcp -- anywhere anywhere state ESTABLISHED tcp spt:nrpe ACCEPT tcp -- anywhere anywhere tcp spt:9200 state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp spt:http state ESTABLISHED ACCEPT udp -- anywhere anywhere udp dpt:domain root@alfapaints:~# iptables -F Write failed: Broken pipe 

我之前testing了我的连接,并且能够连接到ssh。 现在我做了一个nmap扫描,没有一个端口已经打开了。 我知道我的VPS正在VMWare ESXi上运行,可以重新启动吗?

或者,如果不能,我可以附加和挂载磁盘到另一个VM来保存数据?

有人build议吗? 也许解释什么发生或什么可能导致我的pipe道打破?

PS:我没有保存我的规则在iptables的configuration目录。 但是使用了一个存储在〜/ rules.config中的文件来应用我的规则:iptables-restore <rules.config那么重启会有帮助吗?

非常感谢。

所有这三个策略都是DROP ,所以通过刷新链,你已经删除了所有可能修改特定数据包的configuration的规则,并将它们全部留给默认策略:实际上,你已经说过所有的数据包,应通过机器排出并丢弃。

重启是否有帮助取决于你的机器的启动状态。 如果你有一套明智的规则来重新启动,然后重新启动它。 另一方面,如果重新启动代码已设置为在重新启动时保存并恢复正在运行的防火墙状态,或者您的启动规则有严格的限制,则重新启动将无济于事。

假设你找回来了,我发现的东西有助于经常处理iptables规则

 at now+5min service iptables stop ^D 

当试图做一些聪明的事情时,这经常节省了我。 我可以把自己搞砸了,知道在五分钟之内防火墙就会掉下来,我就可以重新进入设置。

你似乎在使用Linode。 在这种情况下,使用Linode Shell访问虚拟机的控制台。 然后您可以login并修复您的防火墙。

使用其他提供者,提供者可以给你等价的虚拟控制台访问权限。 举例来说,VMware完全有能力做到这一点。