Skip to contentSkip to conversation

how to block p2p

DISCUSSION Tomasz Macioszek 9 participants 14 messages Mar 11, 2004 – Apr 5, 2004 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

Thanks for your help
Tomek

#2 lore raw
In reply to Ray Leach
Quoted 7 lines · Ray Leach
Quoted 4 lines · Tomasz Macioszek

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

iptables -P FORWARD DROP

Great answer :)

Antony.

Signature · 5 lines
The difference between theory and practice is that in theory there is no 
difference, whereas in practice there is.

                                                     Please reply to the list;
                                                           please don't CC me.
#1 lore raw
In reply to Tomasz Macioszek
Quoted 4 lines · Tomasz Macioszek

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

iptables -P FORWARD DROP

Quoted 2 lines

Thanks for your help
Tomek

Signature · 7 lines
--
Raymond Leach <[email protected]>
Network Support Specialist
http://www.knowledgefactory.co.za
"lynx -source http://www.rchq.co.za/raymondl.asc | gpg --import"
Key fingerprint = 7209 A695 9EE0 E971 A9AD  00EE 8757 EE47 F06F FB28
--
#8 lore raw
Quoted 7 lines · Ray Leach
Quoted 4 lines · Tomasz Macioszek

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

iptables -P FORWARD DROP

I would perhaps add:
iptables -F FORWARD
just to make sure they don't sneak through on any existing rules :)

Antony.

Signature · 6 lines
The truth is rarely pure, and never simple.

 - Oscar Wilde

                                                     Please reply to the list;
                                                           please don't CC me.
#5 lore raw
In reply to a message not in the archive
Quoted 5 lines · Tomasz Macioszek
Quoted 2 lines
Quoted 1 line

iptables -P FORWARD DROP

iptables -F FORWARD

I know but I would like to block only p2p traffic?? Is patch which blocks only p2p??

I do not know of a way to block p2p without blocking other protocols.

However, does not mean there isn't one, just that I don't know about it.

Regards,

Antony.

Signature · 6 lines
There's no such thing as bad weather - only the wrong clothes.

 - Billy Connolly

                                                     Please reply to the list;
                                                           please don't CC me.
#9 lore raw
In reply to Antony Stone
Quoted 8 lines · Antony Stone
Quoted 6 lines · Ray Leach
Quoted 4 lines · Tomasz Macioszek

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

Quoted 5 lines
Quoted 1 line

iptables -P FORWARD DROP

I would perhaps add:
iptables -F FORWARD
just to make sure they don't sneak through on any existing rules :)

sysctl -w net.ipv4.ip_forward = 0

Quoted 13 lines

Antony.

Signature · 6 lines
The truth is rarely pure, and never simple.

 - Oscar Wilde

                                                     Please reply to the list;
                                                           please don't CC me.
#6 lore raw
In reply to Antony Stone
Quoted 9 lines · Antony Stone
Quoted 5 lines · Tomasz Macioszek
Quoted 2 lines
Quoted 1 line

iptables -P FORWARD DROP

iptables -F FORWARD

I know but I would like to block only p2p traffic?? Is patch which blocks only p2p??

I do not know of a way to block p2p without blocking other protocols.

From memory MSN can use http, i block it in squid as well as netfilter.

Quoted 17 lines

However, does not mean there isn't one, just that I don't know about it.

Regards,

Antony.

Signature · 6 lines
There's no such thing as bad weather - only the wrong clothes.

 - Billy Connolly

                                                     Please reply to the list;
                                                           please don't CC me.
#7 lore raw

I use FTwall(P2Pwall) to block Kazaa. Works quite well. http://www.lowth.com/p2pwall/ftwall/
Furthermore in our dormitories firewall I added blocking of the standard ports for P2P programs. Edonkey = 4662 and so on. The traffic went from top to zero nearly instant.

It was then added to the dormitory rules that use of programs like Kazaa, Edonkey and other filesharing programs were against normal use. Snort has been installed to check weither a person is using a P2P program or not and they are then warned before disconnected from the Internet for life.

Still people who download, however they do not generate very much traffic, since most people on the Internet use the standard ports, which are blocked.

regards
Kristian Hald

#10 lore raw
In reply to Tomasz Macioszek
Quoted 8 lines · Tomasz Macioszek

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

Thanks for your help
Tomek

maybe ill write some tutorial :D

protecting from P2P is difficult, all depends on you users skillz :)
couple things I do:
- dont block normal P2P ports. it wont solve much becouse the user or the program (kazaa automaticly) changes ports to avoid such block. besides if you dont block the port you can easily spot P2P connections in program like IPTRAF(which helps diagnosing)
- do QoS on your router forcing every packet from HTTP.. to have prioroty over nonstandart ports.
- to filter connections on normal ports(HTTPS) use layer-7 filters like squid (for http,ftp and https), for other programs (SMTP,POP3,NEWS...) user layer-7 filters
- this should help you squash around 95% of downloaders. the other 5% you r going to slay using IPTRAF+normal user punishing :D

One more thing which is the good. P2P programs like to use a lot of connections. Limit number of connections per user to lets say 20-30 (im guessing here :). this is the easyiest to do with a proper Iptables filter :)

p.s.
sorry for my english

Krystian Antoni Szybis
tez Polak :D

#11 lore raw

Hello,

Quoted 10 lines

- dont block normal P2P ports. it wont solve much becouse the user or
the program (kazaa automaticly) changes ports to avoid such block. besides if you dont block the port you can easily spot P2P connections in program like IPTRAF(which helps diagnosing)
- do QoS on your router forcing every packet from HTTP.. to have
prioroty over nonstandart ports.
- to filter connections on normal ports(HTTPS) use layer-7 filters
like squid (for http,ftp and https), for other programs (SMTP,POP3,NEWS...) user layer-7 filters
- this should help you squash around 95% of downloaders. the other 5%
you r going to slay using IPTRAF+normal user punishing :D

One more thing which is the good. P2P programs like to use a lot of connections. Limit number of connections per user to lets say 20-30 (im guessing here :). this is the easyiest to do with a proper Iptables filter :)

I'm more for blocking P2P standard ports, but remember to log information on those ports, since Edonkey and other try to connect to other users who use standard ports. These are then registered and blocked, so you are both able to log and secure that they can't use any Bandwidth. Specifically with Kazaa I'm using the FTwall(P2PWall) from sourceforge. It blocks Kazaa quite well.
The user can offcourse change the port, but I would recommend blocking connections going to standard P2P ports(Blocking both src and dest ports). That way alot of connections are denied, thereby not using Bandwidth.

QoS is a good idea if there are services you know you'll need, like mail, SSH, HTTP and so on. (Going to do that in the next firewall update)

Best regards
Kristian Hald

#12 lore raw
In reply to Krystian

It's amazing how many people seem so anxious to block p2p. They have this idea that nothing but mp3s of madonna and metallica are on it. Far from the case.

Wouldn't it be better to just make sure that traffic is prioritized and handled accordingly? for instance, dns traffic highest, followed by ssh traffic, etc. lowest being the bulk fiel transfers of p2p, ftp, and large http transfers.

I know of several ways to detect p2p transfers, but I am not going to tell you, because I don't want to find some overzealous ISP administrator blocking my Debian updates.

oh, by the way, http://xa.net/p2ping

#13 lore raw

Hello,

Are you sure it has nothing to do with work vs play well you are at work ? I
have worked for companies where MSN Messenger was widely used it was disrupting work.

Projects where not getting done, some people actually asked managers to "hold on a sec" so they could finish their messages.

What about the cost of bandwidth ? If your company has to pay X number of dollars a month because your employee are downloading music from kaza -- which may be illegal depending on where you work and against company policy.

Plus there are ways of allowing needed work related p2p connections after blocking the rest.

Michael.

Quoted 20 lines · On Thu, 11 Mar 2004 13:00:45 -0500 (EST) Bob Keyes <[email protected]> wrote:

It's amazing how many people seem so anxious to block p2p. They have this idea that nothing but mp3s of madonna and metallica are on it. Far from the case.

Wouldn't it be better to just make sure that traffic is prioritized and handled accordingly? for instance, dns traffic highest, followed by ssh traffic, etc. lowest being the bulk fiel transfers of p2p, ftp, and large http transfers.

I know of several ways to detect p2p transfers, but I am not going to tell you, because I don't want to find some overzealous ISP administrator blocking my Debian updates.

oh, by the way, http://xa.net/p2ping

Signature · 3 lines
Michael Gale
Network Administrator
Utilitran Corporation
#14 lore raw
In reply to Tomasz Macioszek

Hello,

From my experience and depending on how anal you would like to get. I setup a
firewall with IPTABLES blocking all connections / traffic types and then allowed:

port 22 out
port 21 out
connections made by the squid UID

I then used squid to block almost all traffic except for http. No MSN, AOL, ICQ ,... over http. No streaming audio, video (except for Microsoft training).

It cut our bandwidth usage is have which saved the company over $400 a month.

Michael.

Quoted 12 lines · On Thu, 11 Mar 2004 09:37:42 +0100 "Tomasz Macioszek" <[email protected]> wrote:

Hello!!
I would like to block all known p2p program ( Kazaa, eDonkey, ...). I would like to find patch of iptables (p-o-m) which blocks all this programs??

Thanks for your help
Tomek

Signature · 3 lines
Michael Gale
Network Administrator
Utilitran Corporation