免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2519 | 回复: 6
打印 上一主题 下一主题

[网络管理] iptables策略莫名被清,找不出原因! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-28 22:11 |只看该作者 |倒序浏览
本帖最后由 whilvydy 于 2011-12-28 22:13 编辑

目前管理着几台务器,其它服务器都正常,其中一台不正常,现象如下:



[root@ip6 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@ip6 ~]# service iptables start
清除防火墙规则:                                           [确定]
把 chains 设置为 ACCEPT 策略:filter                       [确定]
正在卸载 Iiptables 模块:                                  [确定]
应用 iptables 防火墙规则:                                 [确定]
载入额外 iptables 模块:ip_conntrack_netbios_ns ip_conntrac[确定]
[root@ip6 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere
ACCEPT     ah   --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mcns-tel-ret
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:5901
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql
.
.
.
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
[root@ip6 ~]#
[root@ip6 ~]# date
2011年 12月 28日 星期三 22:01:20 CST

过3-5分钟后,再iptables -L,就又为空了,
再service iptables restart,策略又恢复了
cat /etc/sysconfig/iptabes,里面有内容,确定策略是save了的,

iptables策略为空,觉得很不安全,所以很希望能找出原因,请各位指导一下


哦,之前安装过ddos(会自动修改iptables策略),后发现此问题后,kill掉所有ddos.sh进程,并uninstall此ddos

但问题依旧,

请求各位大师指导!

论坛徽章:
0
2 [报告]
发表于 2011-12-28 22:24 |只看该作者
你好 iptables 写目的路由怎么写?

论坛徽章:
0
3 [报告]
发表于 2011-12-28 22:33 |只看该作者
2楼兄弟,我是问问题的哦,怎么反倒给您解答了呢?
我不专业,仅提供参考

iptables -t nat -A PREROUTING -d 192.168.0.2 -p tcp -m tcp --dport 20022 -j DNAT --to-destination 192.168.0.3:22

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2011-12-29 08:22 |只看该作者
楼主检查下cron任务,是不是有清空iptables的命令

论坛徽章:
0
5 [报告]
发表于 2011-12-29 19:35 |只看该作者
同意楼上的,顺便监控一下进程,是否有可疑进程。

论坛徽章:
34
亥猪
日期:2015-03-20 13:55:11戌狗
日期:2015-03-20 13:57:01酉鸡
日期:2015-03-20 14:03:56未羊
日期:2015-03-20 14:18:30子鼠
日期:2015-03-20 14:20:14丑牛
日期:2015-03-20 14:20:31辰龙
日期:2015-03-20 14:35:34巳蛇
日期:2015-03-20 14:35:56操作系统版块每日发帖之星
日期:2015-11-06 06:20:00操作系统版块每日发帖之星
日期:2015-11-08 06:20:00操作系统版块每日发帖之星
日期:2015-11-19 06:20:00黄金圣斗士
日期:2015-11-24 10:43:13
6 [报告]
发表于 2012-01-01 00:03 |只看该作者
看你的 命令是直接 start,-L 为空后看看 iptables 是否在运行吧。

论坛徽章:
0
7 [报告]
发表于 2012-01-01 23:07 |只看该作者
回复 6# vermouth

这样的细节都能发现。。。厉害
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP