티스토리 뷰

Security

iptables limit 모듈

CHOMAN 2015. 6. 4. 17:46
limit
       This  module  matches  at  a limited rate using a token bucket filter.  A rule using this extension will match until this limit is reached (unless the ‘!’ flag is used).  It can be
       used in combination with the LOG target to give limited logging, for example.

       [!] --limit rate[/second|/minute|/hour|/day]
              Maximum average matching rate: specified as a number, with an optional ‘/second’, ‘/minute’, ‘/hour’, or ‘/day’ suffix; the default is 3/hour.

       --limit-burst number
              Maximum initial number of packets to match: this number gets recharged by one every time the limit specified above is not reached, up to this number; the default is 5.


limit 모듈

아래 옵션을 주었을시는때 100/min 이란뜻은

-s : any 0.0.0.0

-d : any 0.0.0.0 


각 아이피당 초당 100개의 패킷이 아니라 모든 패킷합이 100개라는 뜻임

ex)
-m limit --limit 50/min --limit-burst 50 -j DROP
분당 패킷 1-50번재 패킷까지 DROP한다
분당 패킷 51번째 패킷 부터는 DROP 되지 않는다

-m limit --limit 100/sec --limit-burst 100 -j DROP
초당 1-100번째 패킷은 DROP한다
초당 101번번째 패킷 부터는 DROP 되지 않는다

burst 는 매칭시킬 패킷의 최대값 Max : 10000 가량 되는듯 함)

burst 는 시간 옵션에서 아래와 같이 초기화 됨

sec 
1초 마다 초기화

min
1분마다 초기화

hour
1시간마다 초기화

day

24시간마다 초기화 



댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함