码迷,mamicode.com
首页 > 其他好文 > 详细

iptables示例

时间:2016-11-23 19:04:36      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:conf   related   nbsp   icmp   filter   mon   table   drop   output   

[root@iZ23um2lv3tZ ~]# more /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Mon Oct 24 09:14:35 2016
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [3697:3188321]
-A INPUT -s 219.85.158.148/32 -j DROP 
-A INPUT -s 58.213.122.115/32 -j DROP 
-A INPUT -s 61.180.64.196/32 -j DROP 
-A INPUT -s 42.62.65.236/32 -j DROP 
-A INPUT -s 58.217.192.54/32 -j DROP 
-A INPUT -s 58.213.122.115/32 -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p icmp -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
-A FORWARD -j REJECT --reject-with icmp-host-prohibited 
COMMIT
# Completed on Mon Oct 24 09:14:35 2016

 

命令:

#iptables -I INPUT -s 58.217.192.54 -j DROP

#service iptables save

iptables示例

标签:conf   related   nbsp   icmp   filter   mon   table   drop   output   

原文地址:http://www.cnblogs.com/coffee_cn/p/6094576.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!