5,装软件layer7策略包 [root@localhost iptables-1.4.3.2]# cd /usr/local/src/l7-protocols-2009-05-28 [root@localhost l7-protocols-2009-05-28]# make install 可看到下面有很多协议,有qq,iptv等 [root@clx ~]# ls /etc/l7-protocols/protocols/ [root@clx ~]# depmod -a [root@clx ~]# iptables -V iptables v1.4.3.2 [root@clx ~]# iptables -m layer7 –h 能看到下面就表示成功了 layer7 match options: --l7dir <directory> : Look for patterns here instead of /etc/l7-protocols/ (--l7dir must be specified before --l7proto if used) [!] --l7proto <name>: Match named protocol using /etc/l7-protocols/.../name.pat
7.英文介绍,http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/L7 layer7-protocol is a method of searching for patterns in ICMP/TCP/UDP streams. L7 matcher is collecting first 10 packets of connection or first 2KB of connection and searches for pattern in collected data. If pattern is not found in collected data, matcher is not inspecting further. Allocated memory is freed and protocol is considered as unknown. You should take into account that a lot of connections will significantly increase memory usage. To avoid it add regular firewall matchers to reduce amount of data passed to layer-7 filters. Additional requirement is that layer7 matcher must see both directions of traffic (incoming and outgoing). To satisfy this requirement l7 rules should be set in forward chain. If rule is set in input/prerouting chain then the same rule must be set also in output/postrouting chain, otherwise collected data may not be complete resulting in incorrectly matched pattern.