LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-11-2014, 02:09 AM   #1
D0zer
Member
 
Registered: Jul 2014
Location: Johannesburg, South Africa
Distribution: Gentoo
Posts: 30

Rep: Reputation: Disabled
Blocking p2p traffic with Iptables on Gentoo


Hi All

I have been battling with slow internet at a client. At first I thought squid was the culprit, then possible the load balancing on the 2 lines. After some more research it could be p2p traffic causing issues. Bellow is the TX, RX, and Total output on jnettop for eth0 and eth2

Eth0 : TX 4.85k/s, RX 22.9k/s Total 27.8k/s
Eth2 : TX 135k/s, RX 96.3k/s Total 231k/s

Noticing lots of high numbered ports for tcp and udp. http, https, smtp, pop3 should be majority of the traffic. Any recommendations of what I can use to block traffic that should not be on the network?

Thanks

Last edited by D0zer; 08-11-2014 at 02:15 AM. Reason: Changed the Jenttop information
 
Old 08-15-2014, 09:44 AM   #2
D0zer
Member
 
Registered: Jul 2014
Location: Johannesburg, South Africa
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: Disabled
I'm still looking for ways to block peer to peer downloads, and for a way of shaping traffic for the local network. I had the adsl line fixed today and the internet is working like a dream. I updated squid and re configured it, browsing is much better now. Squid was not giving timeout errors when browsing. I suspect all the issues where because the one line was not working correctly and routing through the eth2 was not working correctly.
 
Old 08-17-2014, 05:44 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by D0zer View Post
I'm still looking for ways to block peer to peer downloads, and for a way of shaping traffic for the local network.
Did you analyse your logs / stats to find clues what to block? What research have you done wrt traffic shaping?
 
Old 08-17-2014, 05:55 PM   #4
brebs
Member
 
Registered: May 2013
Posts: 89

Rep: Reputation: Disabled
Here's some hints, at least.
 
Old 08-18-2014, 05:37 AM   #5
D0zer
Member
 
Registered: Jul 2014
Location: Johannesburg, South Africa
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thank's for the link brebs. looks like what I am looking for.
Quote:
Originally Posted by brebs View Post
Here's some hints, at least.
 
Old 08-18-2014, 05:43 AM   #6
D0zer
Member
 
Registered: Jul 2014
Location: Johannesburg, South Africa
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thank's for the reply unSpawn. I haven't done much research into traffic shaping yet. I am hoping to spend some time today on it.

I view the jnettop utility, but I am still getting use to understanding it. Have you got any suggestions what log files I should be monitoring, and if I should turn any other's on? I tried to use ntop to get an overview of things, but I see it seems to have crashed again when I went to check it.

Quote:
Originally Posted by unSpawn View Post
Did you analyse your logs / stats to find clues what to block? What research have you done wrt traffic shaping?
 
Old 08-18-2014, 05:01 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by D0zer View Post
Thank's for the reply unSpawn. I haven't done much research into traffic shaping yet. I am hoping to spend some time today on it.
If you want to go the "easy" way search for the "wonder shaper" script (should be in LARTC, IIRC), if you want to understand the whole thing search for LARTC.


Quote:
Originally Posted by D0zer View Post
I view the jnettop utility, but I am still getting use to understanding it. Have you got any suggestions what log files I should be monitoring, and if I should turn any other's on? I tried to use ntop to get an overview of things, but I see it seems to have crashed again when I went to check it.
Ntop can be somewhat unstable (I'm sure that's an understatement). It kind of depends where you check. If the gateway runs iptables you could just log new outbound connections ("-m state --state NEW") for say twentyfour hours and then see what remote ports get hit and how many times. If it doesn't run iptables but you can run tcpdump (or via SPAN) you could save packet captures and run them on your workstation through command line analysis tools or Wireshark. Do note that might take up lots of space so use a BPF filter. If it can't do none of that tell us what it can provide.
 
1 members found this post helpful.
Old 08-19-2014, 12:32 PM   #8
D0zer
Member
 
Registered: Jul 2014
Location: Johannesburg, South Africa
Distribution: Gentoo
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks for the help so far unSpawn
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IPtables seem to be blocking internal traffic hsnanua Linux - Networking 13 08-25-2011 08:25 AM
blocking traffic using iptables -easy hopefully :) fedora_user Linux - Newbie 7 03-18-2010 05:34 AM
iptables, and blocking all but non network traffic Argo Linux - Security 11 06-18-2007 07:42 PM
iptables blocking traffic JJX Linux - Networking 4 11-07-2005 05:36 AM
Iptables blocking all traffic on other NIC spede Linux - Security 3 05-05-2004 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:46 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