作者arpcar (鲤鱼)
看板FreeBSD
标题Re: [问题] pf限制session数
时间Thu Dec 8 17:24:49 2005
※ 引述《yao1973 (更!说话是会死喔?!)》之铭言:
: ※ 引述《arpcar (鲤鱼)》之铭言:
: : 可以试试packet filter。功能强大﹐书写简便。
: : macro和table会让生活变得轻松。
: 大大你好
: 我已经装好了packet filter
: 也是着把NAT的防火墙设定 设定起来了
: 可是我在想 该如何用packet filter
: 来限制我NAT底下 某台电脑连外的session数呢?
: (我看到一些范例是在讨论 频宽设定的)
: 谢谢 :)
table <bruteforce> persist
block quick from <bruteforce>
pass inet proto tcp from $int_if:network to any port $tcp_services \
flags S/SA keep state \
(max-src-conn 100, max-src-conn-rate 15/5, \
overload <bruteforce> flush global)
max-src-conn is the number of simultaneous connections you allow from
one host. In this example, I’ve set it at 100, in your setup you may want a
slightly higher or lower value.
max-src-conn-rate is the rate of new connections allowed from any single
host, here 15 connections per 5 seconds. Again, you are the one to judge
what suits your setup.
overload <bruteforce> means that any host which exceeds these limits
gets its address added to the table bruteforce. Our rule set blocks all
traffic from addresses in the bruteforce table.
参见﹕Firewalling with OpenBSD's PF packet filter
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 159.226.100.226