全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3404|回复: 11

debian 7 的 iptables 不稳定啊

[复制链接]
发表于 2014-7-11 10:20:01 | 显示全部楼层 |阅读模式
你们有没有发现啊?
postrouting forward 有时候会自动失效,找不出原因
iptables-restore 也无效
只能把规则写成脚本,全清再运行几次才可以
 楼主| 发表于 2014-7-11 12:05:06 | 显示全部楼层
无重启,而且只有 postrouting forward 自动失效,其他规则不影响
其实就是TNND影响我扶墙啊
发表于 2014-7-11 12:06:25 | 显示全部楼层
iptables-persistent
 楼主| 发表于 2014-7-11 12:07:13 | 显示全部楼层

没用
 楼主| 发表于 2014-7-11 12:12:24 | 显示全部楼层
iptables-persistent 的脚本我看过,也用过其他脚本
都会偶尔在重启之后,forward 规则不生效
最严重的,是机器在良好运行的时候,偶尔突然失效
发表于 2014-7-11 13:54:16 | 显示全部楼层
原来都有这个体会。  
我还以为是我系统问题。

有时失效,搞得我重启VPS


看来还是 Centos 的  service iptables  restart 简单
且保存也简单  service iptables save
发表于 2014-7-11 13:57:11 | 显示全部楼层
http://www.vpser.net/security/linux-iptables.html
  1. 创建/etc/network/if-post-down.d/iptables 文件,添加如下内容:

  2. #!/bin/bash
  3. iptables-save > /etc/iptables.rules
  4. 执行:chmod +x /etc/network/if-post-down.d/iptables 添加执行权限。

  5. 创建/etc/network/if-pre-up.d/iptables 文件,添加如下内容:

  6. #!/bin/bash
  7. iptables-restore < /etc/iptables.rules
  8. 执行:chmod +x /etc/network/if-pre-up.d/iptables 添加执行权限。
复制代码
发表于 2014-7-11 14:13:33 | 显示全部楼层
debian 7下一直用csf,无压力。
发表于 2014-7-11 16:05:43 | 显示全部楼层
大鬍子說的或是csf都行 csf其實方法類似吧我記得
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-5-4 10:34 , Processed in 0.066426 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表