close

1.  manual load pf

# kldload pf.ko

==>  pfctl  -e    or  pfctl  -d    enable/disable 

 

2. make in kernel

device pf
device pflog
device pfsync

make ALTQ 

options         ALTQ
options         ALTQ_CBQ        # Class Based Queuing (CBQ)
options         ALTQ_RED        # Random Early Detection (RED)
options         ALTQ_RIO        # RED In/Out
options         ALTQ_HFSC       # Hierarchical Packet Scheduler (HFSC)
options         ALTQ_PRIQ       # Priority Queuing (PRIQ)
options         ALTQ_NOPCC      # Required for SMP build

3. cd ../compile/GENER   ,  make depend ; make ; make install   ,  reboot 

 

4.  block  ssh attack  

First, set up the table. In the tables section, add

table <bruteforce> persist

Then somewhere fairly early in the rule set, add a rule to block the bruteforcers:

block quick from <bruteforce>

And finally, the pass rule.

pass inet proto tcp from any to $localnet port $tcp_services \
    flags S/SA keep state \
    (max-src-conn 100, max-src-conn-rate 15/5, \
    overload <bruteforce> flush global)

 

 

 

reference :http://www.freebsd.org/doc/handbook/firewalls-pf.html

 

 

 

 

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 yves2005 的頭像
    yves2005

    YvEs2005

    yves2005 發表在 痞客邦 留言(0) 人氣()