LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-22-2014, 12:26 AM   #1
Yehuda Katz
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Question CentOS: monitor traffic usage per IP with plain report output


Hello,

I have issue with my server. For some unknown reason, couple of users somehow manage to use up to !!!400Gb!!! traffic per DAY! iftop shows that some users cause 20-50mbit load during long time. I tried to limit speed, upload file size via nginx but nothing helped.

However dropping their connections with iptables works just fine =) So I started searching the way to monitor traffic usage per IP. The main requirement was to have some plain output, so I could write bash script which would analyze IPs and adds 'greedy' ones to blacklist for couple of hours.

So far the best way is to use iptables' counters but the problem is that they require creating rules for EACH user (IP). I can write another bash script which will parse nginx's logs for new IPs and adds them but since I have 5000 unique users per day, will not it cause a problem?

Also, what is the best and simplest way to count traffic usage per IP automatically and have plain output report.

Thanks in advance for any help

p.s. I get inspired by this article catonmat[dot]net/blog/traffic-accounting-with-iptables/

Last edited by Yehuda Katz; 08-22-2014 at 12:31 AM.
 
Old 08-22-2014, 06:08 PM   #2
Hachu
LQ Newbie
 
Registered: Aug 2014
Posts: 3

Rep: Reputation: Disabled
I was working on limiting VPN traffic and come across something might be useful for you...

check this link:
iptables-limit-rate-of-a-specific-incoming-ip

Personally, I never try it before but based on what I read, this might be what you looking for...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: LinkedIn DNS hijacked, traffic rerouted for an hour, and users’ cookies read in plain text LXer Syndicated Linux News 0 06-24-2013 01:51 AM
Can I use squid to monitor bandwith usage and web traffic baronobeefdip Linux - Server 5 02-10-2013 08:16 AM
convert cron output to plain text deesto Linux - General 5 01-09-2009 03:10 PM
Monitor bandwidth usage and attempted usage! Depressed_amphibian Linux - Networking 3 06-15-2006 07:13 AM
Lire (log analysis, log report) no report in Mandriva 2005 LE (desktop usage) Emmanuel_uk Mandriva 0 01-16-2006 02:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration