linux基础之iptables
2015-05-04 09:52
375 查看
Linux iptables相关:
iptables用法
iptables [-ttable] command chain(链) [cretiria(匹配标准)] –jaction
-t [raw,mangle,net ,filter]
Command: 对链,或者对链中的规则进行管理操作
链中规则:
-A 添加一条规则
-I # 在第几条规则后插入一条规则
-R # 修改第几条规则
-D # 删除第几条规则
链:
-N 增加
-X 删除空链
-E 重命名一条自定义链
-F 清空指定链,如果不指定,则清空表中所有链
-P 设定链的默认策略
-Z 置零(每条规则,包括默认策略,都有两个计数器,一个是被本规则匹配到的所有数据包的个数,另一个是被本规则匹配到的数据包的大小之和)
-L 查看
-v 详细信息
-n 数字标准
iptables对应服务脚本:/etc/rc.d/init.d/iptables
服务脚本配置文件:/etc/rc.d/init.d/iptables-config
规则保存位置:/etc/sysconfig/iptables
匹配标准:
基本匹配 -s 源地址 -d 目标地址 -p [icmp|tcp|udp] 协议 -i 进来网络接口 -o 出去网络接口扩展匹配隐式扩展 -p tcp --sportport [port2] --dportport [port2] -p udp --sport --dport -p icmp --icmp-type 0:响应 8:请求显式扩展(/lib/iptables) netfilter扩展模块引入的扩展,用于扩展匹配条件,通常需要额外选项来定义 -m 指定模块 -m state 用于实现链接的状态检测 --state -mmultiport --source-ports 源端口 --destination-ports 目标端口 --ports -m limit --limit 3/min --limit-burst 30 -mconnlimit --connlimit-above n 连接上限n -m iprange --src-range ip-ip 一段范围ip --dst-range ip-ip -m string --algo --stringAction: ACCEPT DROP REJECT REDIRECT DNET SNET MASQUERADE LOG RETURN
iptables用法
iptables [-ttable] command chain(链) [cretiria(匹配标准)] –jaction
-t [raw,mangle,net ,filter]
Command: 对链,或者对链中的规则进行管理操作
链中规则:
-A 添加一条规则
-I # 在第几条规则后插入一条规则
-R # 修改第几条规则
-D # 删除第几条规则
链:
-N 增加
-X 删除空链
-E 重命名一条自定义链
-F 清空指定链,如果不指定,则清空表中所有链
-P 设定链的默认策略
-Z 置零(每条规则,包括默认策略,都有两个计数器,一个是被本规则匹配到的所有数据包的个数,另一个是被本规则匹配到的数据包的大小之和)
-L 查看
-v 详细信息
-n 数字标准
iptables对应服务脚本:/etc/rc.d/init.d/iptables
服务脚本配置文件:/etc/rc.d/init.d/iptables-config
规则保存位置:/etc/sysconfig/iptables
匹配标准:
基本匹配 -s 源地址 -d 目标地址 -p [icmp|tcp|udp] 协议 -i 进来网络接口 -o 出去网络接口扩展匹配隐式扩展 -p tcp --sportport [port2] --dportport [port2] -p udp --sport --dport -p icmp --icmp-type 0:响应 8:请求显式扩展(/lib/iptables) netfilter扩展模块引入的扩展,用于扩展匹配条件,通常需要额外选项来定义 -m 指定模块 -m state 用于实现链接的状态检测 --state -mmultiport --source-ports 源端口 --destination-ports 目标端口 --ports -m limit --limit 3/min --limit-burst 30 -mconnlimit --connlimit-above n 连接上限n -m iprange --src-range ip-ip 一段范围ip --dst-range ip-ip -m string --algo --stringAction: ACCEPT DROP REJECT REDIRECT DNET SNET MASQUERADE LOG RETURN
相关文章推荐
- [转载]linux防火墙基础和管理设置iptables规则
- 马哥2016全新Linux+Python高端运维班-Iptables 防火墙基础练习,tcp_wrapper
- Linux上iptables基础应用
- Iptables(一):Linux防火墙基础与iptables命令
- Linux入职基础-5.27_防火墙iptables简单应用(应用实战11)
- Linux入职基础-6.2_iptables的表与链
- linux网络防火墙-iptables基础详解
- 【Linux 驱动】netfilter/iptables (一) 基础概念
- Linux防火墙工具iptables基础介绍
- linux防火墙基础和管理设置iptables规则
- Linux iptables基础
- Linux防火墙iptables基础
- Linux防火墙iptables基础
- Linux基础优化之SElinux和iptables项
- linux下iptables防火墙配置基础
- Linux中iptables基础命令
- 【linux基础】22、iptables基础
- Linux基础命令介绍七:网络传输与安全 wget curl rsync iptables
- 【iptables】linux网络防火墙-iptables基础详解(重要)