都是自己记的笔记,分享给大家,点个关注啊。 通用匹配 -p 匹配协议 使用:-p tcp || udp || icmp || number -s 匹配源IP地址 使用:-s 10.0.0.1 || 10.0.0.1/24 -d 匹配目的IP 使用:-d 10.0.0.1 || 10.0.0.1/24 -i 匹配进入的设备 使用:-i eth0 备: 只能用于INPUT,FORWARD和 PREROUTING链 -o 匹配出去的设备 使用:-o eth0 -f 匹配分片后的包 隐式匹配模块 --sport 匹配源端口 使用:--sport 22 || 20:100 || :90 || !1024 --dport 匹配目的端口 使用:--dport 22 || 20:100 || :90 || !1024 --tcp-flags 匹配tcp标记 使用:--tcp-flags SYN,ACK,FIN SYN --syn 匹配syn标记 使用:--syn --tcp-option 匹配tcp选项 使用:--tcp-option 16 --icmp-type 匹配icmp类型 使用 :--icmp-type 8 这些匹配都是必须有 -p 选项才能使用的。 显式匹配模块 state 状态匹配模块 使用: -m state --state NEW,ESTABLISHED,RELATED iprange ip范围匹配模块 使用: -m iprange --src-range || --dst-range 10.0.0.1-10.0.0.230 multiport 端口范围匹配模块 使用: -m multiport --sourec-ports || --destination-ports || --port 3301,3394,3333 limit 速率匹配模块 使用: -m limit --limit 1000/3second/minute/hour /day mac MAC地址匹配模块: -m mac --mac-source XX:XX:XX:XX:XX:XX 备:只能用在PREROUTING,FORWARD 和INPUT链 mark 标记匹配模块: -m mark --mark 1 owner ID匹配模块: -m owner --uid-owner || --pid-owner || --gid-owner || --sid-owner 100 备: 只能用在OUTPUT链 tos IP服务类型匹配模块: -m tos --tos 0x16 ttl 生存时间匹配模块: -m ttl --ttl 64 connlimit 连接限制模块 : -m connlimit --connlimit-above 5 time时间模块: -m time--timestart 09:40 --timestop 09:59 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun --kerneltz webstr 网址过滤模块: -m webstr --url "qq.com" string 字符匹配模块: -m string --string "sex" --algo bm |
| 本文出处: http://www.toutiao.com/a6401233655499866370/ |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|