如何在Ubuntu上暂时停止iptables

前端之家收集整理的这篇文章主要介绍了如何在Ubuntu上暂时停止iptables前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在/ etc / network / interfaces中使用IPTABLES
pre-up iptables-restore /etc/firewall.txt

我尝试在Ubuntu上搜索/etc/init.d/iptables这样的东西,但这似乎不存在.所以如果我必须暂时停止IPTABLE进行系统管理员工作,我该怎么办呢?

@H_502_6@
iptables不是服务,而是内核中的一个工具.这就是为什么你无法阻止它.

如果你需要快速停止iptables,这是我的建议:

>配置您的iptables完成.
>首先保存配置:iptables-save> /etc/iptables.conf
>刷新iptables,并将其配置为“open”:

>所有策略都设置为ACCEPT
>为sysadmin配置所有必需的NAT以使其正常工作
>如果在mangle表中使用基于策略的路由,也可以根据需要进行配置

>保存’open’规则集:iptables-save> /etc/open-iptables.conf

现在,每当您需要快速“禁用”iptables时,请执行以下操作:

cat /etc/open-iptables.conf | iptables-restore.

之后,使用以下命令“重新启用”iptables:

cat /etc/iptables.conf | iptables-restore

(iptables-restore< /etc/open-iptables.conf也可以工作;但我读过其他地方,有时它不起作用)

原文链接:https://www.f2er.com/ubuntu/348632.html

猜你在找的Ubuntu相关文章