Skip to content

shifuture/iftop_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IFTOP Helper

General

By IFTOP log, limit ip by iptables

CONFIG

# iftop log path
LOG_FILE="/var/log/iftop.log"

# log lines to check
LOG_LINES=2000

# to block ip prefix
BLOCK_PREFIX=['172.172.']

# skip ip for VERY IMPORTANT GUY
BLOCK_SKIP_IP=['172.172.0.1', '172.172.0.50']

# limit thresh hold
BLOCK_IF_OVER=1024*1024*10 # over 10M

USAGE

Run IFTOP Firstly

[root@server ~]# nohup iftop -c iftoprc -t > /var/log/iftop.log &

Run iftopHelper

[root@server ~]# iftopHelper.py 
usage: iftopHelper [-b <ip>] [-l list] [-a auto block] [-h help]

options:
  -h, --help   show this help message and exit
  -b BLOCK_IP  block the ip provided
  -l           list all ip traffic info
  -a, --auto   auto block the ip(s) which traffic is over limit

Contribute

You are welcome to contribute.

License

MIT

About

Block ip by iftop log

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages