ip firewall filter add chain=forward p2p=all-p2p action=drop
against that you can try to use a transpartent proxy for port 80 TCP and block everything elseOh cool. Try uTorrent with Encryption turned on (Enabled) and try to download a torrent file that has many seeders for example a Lniux distro, for example SuSe distrib via BT. Test your setup against that
/ip dns static add name=".*\\(^\\|\\.\\)utorrent\\.com" address=127.0.0.1
/ip dns static add name=".*\\(^\\|\\.\\)vuze\\.com" address=127.0.0.1
/ip dns static
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)utorrent\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)vuze\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.org" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.net" ttl=1d
give him some karmaHi,
This schools policy is to allow all ports outbound except P2P and SMTP/NETBIOS(Due to virus and spam) I have also blocked DNS outbound due to P2P so they can only access DNS from the RB1000.
My current setup for this network is a different firewall from the government firewall so they are alone on this RB1000. So I don't have to worry about restricting ports for the Government offices.
dssmiktik, Thank you! That was a nice thing with the regexp. I will try it later this week or next
ip firewall layer7-protocol add comment="" name=p2p_www regexp="^.*(get|GET).+\
(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|vertor|h33t|\
zoozle|bitnova|bitsoup|meganova|fulldls|btbot|fenopy|gpirate|commonbits).*\$"
ip firewall layer7-protocol add comment="" name=p2p_dns regexp="^.+\
(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|vertor|h33t|\
zoozle|bitnova|bitsoup|meganova|fulldls|btbot|fenopy|gpirate|commonbits).*\$"
ip firewall filter add action=drop chain=forward comment="block p2p_www" disabled=no \
layer7-protocol=p2p_www
ip firewall filter add action=drop chain=forward comment="block p2p_dns" disabled=no \
dst-port=53 layer7-protocol=p2p_dns protocol=udp
Then I will kindly shut it down for him.You are very funny with your distros behind the counter
What if a businessman simply has forgotten to shutdown hist p2p application?
BT use is prohibited on our public wifi.And he needs to do some important business online? He will have to wait 30 minutes? He will probably do "business" with you
So, according to this post all is needed to define l7 filter for bit-torrent in my case, set jump rule for this filter and default p2p filter, mangle this traffic and drop it. Am I right? If yes, I don't understand if we still need dns rules listed in your post earlier?Hi,
Sorry for my late reply I am involved in a large project right now.
Here is a little how to. You have to have defined your L7 before.
Go to the Firewall Mangle.
Create a new rule
Set it as a prerouting chain and set L7 accordingly.
Set Action Jump and Jump to target lets say p2p-traffic
Do this for all the defined L7 filters and also for the default p2p-all
Create a new rule below
Set it as a p2p-traffic chain (you will have to enter it).
Set action to mark connection and set it to lets say p2p
Go to the firewall filter
I have put it on top but this is depending on your own setup.
Create new rule
Set chain to forward and connection mark to p2p, Then action to drop or if you use jump rules set it to jump and then point to the drop rule.
Try this
/ip firewall layer7-protocol
add comment="BitTorrent catch" name=torrent regexp=\
"^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add comment="" name=torrent_announce regexp=^get.+announce.
/ip firewall mangle
add action=jump chain=prerouting comment=BitTorrent disabled=no jump-target=torrent_traffic layer7-protocol=torrent
add action=jump chain=prerouting comment="" disabled=no jump-target=torrent_traffic layer7-protocol=torrent_announce
add action=jump chain=prerouting comment="" disabled=no jump-target=torrent_traffic p2p=all-p2p
add action=mark-connection chain=torrent_traffic comment="" disabled=no new-connection-mark=torrent passthrough=yes
/ip firewall filter
add action=log chain=forward comment="" connection-mark=torrent disabled=no log-prefix=test_bt_drop out-interface=!Ghost
add action=drop chain=forward comment="" connection-mark=torrent disabled=no out-interface=!Ghost
Trying to block p2p is really a waste of time. Best thing it prioritize traffic this way you can throttle any traffic you don't want through.
I would say that depends on what company you are working for. If it is a ISP that is true and I agree completely but if you deploy this in a company network or government where there is a policy to block it, it's a whole other matter.There is no 'answer' to P2P.
You might as well say "i want to block Internet".
The *only* solution is to control the user's bandwidth.
If they use it all up with their P2P, maybe their Skype calls will be flaky.
They learn quick.
When people buy "Internet", they expect it *all* to work.
If you sell an Email, Website (no videos) and maybe Skype service, it is very important that you sell it like that: Don't just call it "Internet", because that includes things like P2P and Streaming TV.
Hi,
Just tired the new version and it is still blocked phuuuu
Yes... so I combined a rules with port blocking. Catch is that I had to modify a bit of that since torrent sites must not be blocked and torrent usage is time limited to night and I really have no idea wth have I changedI will check on Monday.
Have you seen traffic not being blocked?
No, DNS is a problem since it is allowed for customers to use other DNS and torrent sites must not be blocked at all so... no DNS value added since /ip dns static add name=".*\\(^\\|\\.\\)utorrent\\.com" address=127.0.0.1 blocking all traffic from utorrent site, right? So I need more flexible rules that will allow torrent sites since torrents can be used from midnight.Hi,
I have tried with utorrent 2.2 using the 2 first top100 torrent on thepiratebay.org but it is still blocked.
Have you done all the dns blocking and L7 blocking?
Here is the config
DNS
/ip dns static
add address=127.0.0.1 disabled=no name=router.utorrent.com ttl=1d
add address=127.0.0.1 disabled=no name=dht.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vrpc.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzrpx020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzapp020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=client.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=mirror-user1.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=ip.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=jp.bitcomet.com ttl=1d
add address=127.0.0.1 disabled=no name=torrent-cache.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=inside.bitcomet.com ttl=1d
add address=127.0.0.2 disabled=no name=router.bitcomet.net ttl=1d
L7 filter
/ip firewall layer7-protocol
add comment="" name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add comment="" name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
I use the L7 in the mangel rules combined with the normal Mikrotik p2p detection and add mark them as p2p and then I have a filter that blocks it.
This disables the normal tracker and the DHT and peer exchange.
Please try it and if you can find any way to get around it please let me know
p.s
You will have to disable DNS query's outbound and only allow the DNS server in the Mikrotik.
d.s
As far as I know, Germany for example banned p2p completely. P2P on my network is blocked over the day because of the quality of the internet and other services of the other users. So torrents Vs online gaming... Who'll kill who? It's not about piracy at all. It's simply technical and nature of P2P clients and we would all like that there is no need for that. And, almost every user have it's own public IP so there are no problems with download from megaupload, rapidshare, fileserve and other file servers. And, to allow that many users suffer because of few irresponsible that simply want to get some porn movie from p2p? For other example, wow uses p2p for update. It's not forbidden to do that or to download anything else from p2p... only do that over the night so it won't affect other users.Be careful in blocking services as the new Net Neutrality bill was released in December which states we are not allowed to block services and have to allow a reasonable speed.. I disagree with it totally but not all torrent and peer-to-peer is illegal.
/ip dns static
add address=127.0.0.1 disabled=no name=router.utorrent.com ttl=1d
add address=127.0.0.1 disabled=no name=dht.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vrpc.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzrpx020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzapp020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=client.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=mirror-user1.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=ip.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=jp.bitcomet.com ttl=1d
add address=127.0.0.1 disabled=no name=torrent-cache.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=inside.bitcomet.com ttl=1d
add address=127.0.0.2 disabled=no name=router.bitcomet.net ttl=1d
L7 filter
/ip firewall layer7-protocol
add comment="" name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add comment="" name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
So, in my case, priority 1 should have online gaming (cod, cs, wow...) and voip, http and https priority 2, download priority 4 and the rest (p2p) priority 8 ?
/ip firewall mangle
add protocol=tcp dst-port=80 connection-bytes=500000-0 connection-rate=70000-10000000
action=mark-connection new-connection- mark=dowm_conn
add chain=prerouting content=.7z action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.avi action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.exe action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.f4v action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.flv action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.iso action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mov action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mp3 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mp4 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mpg action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.pdf action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rar action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rmvb action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rm action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.wav action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.wma action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.zip action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.3gp action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting protocol=tcp src-port=21 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="FTP" disabled=no
add chain=prerouting protocol=tcp src-port=22 packet-size=1400-1500 \
action=mark-connection new-connection-mark=dowm_conn passthrough=yes \
comment="SFTP" disabled=no
yes you're right. some torrent programs are working on port 80.Like Xunlei Thunder.It can not be blocked.So, in my case, priority 1 should have online gaming (cod, cs, wow...) and voip, http and https priority 2, download priority 4 and the rest (p2p) priority 8 ?
And, in case that p2p be allowed during a day with qos setting... what will prevent p2p user to set his client to try to open 100 or more connections? I am a bit a beginner but we were all learned that p2p is a killer of 2.4 ghz wifi and so far it was quite true.
Maybeyes you're right. some torrent programs are working on port 80.Like Xunlei Thunder.It can not be blocked.So, in my case, priority 1 should have online gaming (cod, cs, wow...) and voip, http and https priority 2, download priority 4 and the rest (p2p) priority 8 ?
And, in case that p2p be allowed during a day with qos setting... what will prevent p2p user to set his client to try to open 100 or more connections? I am a bit a beginner but we were all learned that p2p is a killer of 2.4 ghz wifi and so far it was quite true.
If you can not block limit that.
Prince90sCode: Select all/ip firewall mangle add protocol=tcp dst-port=80 connection-bytes=500000-0 connection-rate=70000-10000000 action=mark-connection new-connection- mark=dowm_conn add chain=prerouting content=.7z action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.avi action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.exe action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.f4v action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.flv action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.iso action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.mov action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.mp3 action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.mp4 action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.mpg action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.pdf action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.rar action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.rmvb action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.rm action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.wav action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.wma action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.zip action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting content=.3gp action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no add chain=prerouting protocol=tcp src-port=21 action=mark-connection \ new-connection-mark=dowm_conn passthrough=yes comment="FTP" disabled=no add chain=prerouting protocol=tcp src-port=22 packet-size=1400-1500 \ action=mark-connection new-connection-mark=dowm_conn passthrough=yes \ comment="SFTP" disabled=no
/ip firewall nat
add chain=dstnat dst-address=<Router LAN IP> in-interface=!ether1-WAN dst-port=53 protocol=tcp action=dst-nat to-addresses=<Router LAN IP>
add chain=dstnat dst-address=<Router LAN IP> in-interface=!ether1-WAN dst-port=53 protocol=udp action=dst-nat to-addresses=<Router LAN IP>
/ip firewall mangle
add protocol=tcp dst-port=80 connection-bytes=500000-0 connection-rate=70000-10000000
action=mark-connection new-connection- mark=dowm_conn
add chain=prerouting content=.7z action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.avi action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.exe action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.f4v action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.flv action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.iso action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mov action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mp3 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mp4 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.mpg action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.pdf action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rar action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rmvb action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.rm action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.wav action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.wma action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.zip action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting content=.3gp action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="" disabled=no
add chain=prerouting protocol=tcp src-port=21 action=mark-connection \
new-connection-mark=dowm_conn passthrough=yes comment="FTP" disabled=no
add chain=prerouting protocol=tcp src-port=22 packet-size=1400-1500 \
action=mark-connection new-connection-mark=dowm_conn passthrough=yes \
comment="SFTP" disabled=no
/ip firewall mangle
add protocol=tcp dst-port=80 connection-bytes=500000-0 connection-rate=70000-10000000 action=mark-connection new-connection-mark=heavy
Hi, I thing you are on to something here Please let us know how this is working.I am currently working on implementing a P2P throttling implementation for a school's open Wifi. Reading mves's posts got me thinking and I wanted to bounce the idea off some people while I am getting it working.
I am starting with a blacklist similar to what mves suggested. If I detect p2p traffic, they get added to a list for 30/60 minutes, which then puts them in a very very slow queue. The theory being that any false positive will quickly fall off the list, while repeat offenders will keep themselves on it. I have elected for throttling as opposed to blocking due to tracking issues. It seems that most of the P2P clients that support advanced encryption and filter bypass technologies start off with the old, easy to track, methods, then fall back to more resourceful methodologies as they get blocked. By allowing them through at a greatly reduced rate, I keep the protocols where I can find them and manage them.
This is designed to run on RB450G hardware and layer 7 filtering isn't very practical due to CPU limitations, so I have been looking for alternatives, which lead me to 2 ideas.
The first is to use TKITFrank's DNS filtering for torrent peers. I use DNS redirection to enforce it:Instead of redirecting the DNS entries to 127.0.0.1, I set them to a Bogon IP. such as 203.0.113.253, which should never generate any valid traffic on it's own.Code: Select all/ip firewall nat add chain=dstnat dst-address=<Router LAN IP> in-interface=!ether1-WAN dst-port=53 protocol=tcp action=dst-nat to-addresses=<Router LAN IP> add chain=dstnat dst-address=<Router LAN IP> in-interface=!ether1-WAN dst-port=53 protocol=udp action=dst-nat to-addresses=<Router LAN IP>
I then listen for request to 203.0.113.253, and put the source on the perpetrator list.
In my testing, uTorrent periodically checks the router servers, so even if a user managed to get an encrypted torrent stream past detection, the client will eventually try to check in again and the user will get flagged.
The second idea is a bit more theoretical at this point, or at least until i can figure out connection-limit a little better. The idea is that most p2p clients end up using a large number of UDP connections, usually involving very high port ranges, while legitimate traffic keeps relatively small numbers (less than 8 or so). If a user has something like 40 UDP streams (not including DNS), they are either hosting a game/VoIP server (something they can't really do on a public wifi anyway), or it's P2P. While this looks good on paper, I am not sure how practical it will be. If anyone with experience on connection-limit and udp would like to offer some input, I would appreciate it.
Once I get everything running, I will gladly post the config, since this thread is one of the few solid sources of p2p tracking in Mikrotik routers. It has been an invaluable resource for me while learning this. Thanks.
@CC_DKP
But guys is telling you that is almost imposible to block all torents ... unless you turn off all internet ... beacause torent can use any port like 80 ... why just make good QOS and leave it on ?lots of command lines and no absolute working command !?
i just want to drop un-encrypted torrent connections so i used the first command in the post which was :
ip firewall filter add chain=forward p2p=all-p2p action=drop
and it just adds a firewall rule that DOESN'T Work either ...
is there any clean, working command so that i could use in order to drop these TORRENT connections ?!
for your information: i'm using this routeros as a VPN Routing server which is enabled for PPTP and L2TP ....
/ip firewall layer7-protocol
add comment="eDonkey2000 - P2P filesharing" name=edonkey regexp="^[\\xc5\\xd4\
\\xe3-\\xe5].\?.\?.\?.\?([\\x01\\x02\\x05\\x14\\x15\\x16\\x18\\x19\\x1a\\x\
1b\\x1c\\x20\\x21\\x32\\x33\\x34\\x35\\x36\\x38\\x40\\x41\\x42\\x43\\x46\\\
x47\\x48\\x49\\x4a\\x4b\\x4c\\x4d\\x4e\\x4f\\x50\\x51\\x52\\x53\\x54\\x55\
\\x56\\x57\\x58[\\x60\\x81\\x82\\x90\\x91\\x93\\x96\\x97\\x98\\x99\\x9a\\x\
9b\\x9c\\x9e\\xa0\\xa1\\xa2\\xa3\\xa4]|\\x59................\?[ -~]|\\x96.\
...\$)"
add comment="" name=gnutella regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella c\
onnect/[012]\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-a\
gent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|g\
et /.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|q\
ueue [0-9a-f]* [1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-\
9]\?\\.[1-9][0-9]\?[0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*content-ty\
pe: application/x-gnutella|...................\?lime)"
add comment="CVS - Concurrent Versions System" name=cvs regexp=\
"^BEGIN (AUTH|VERIFICATION|GSSAPI) REQUEST\\x0a"
add comment="" name=nbns regexp=\
"\\x01\\x10\\x01|\\)\\x10\\x01\\x01|0\\x10\\x01"
add comment="" name=shoutcast regexp="^get /.*icy-metadata:1|icy [1-5][0-9][0-\
9] [\\x09-\\x0d -~]*(content-type:audio|icy-)"
add comment="DNS - Domain Name System - RFC 1035" name=dns regexp="^.\?.\?.\?.\
\?[\\x01\\x02].\?.\?.\?.\?.\?.\?[\\x01-\?][a-z0-9][\\x01-\?a-z]*[\\x02-\\x\
06][a-z][a-z][fglmoprstuvz]\?[aeop]\?(um)\?[\\x01-\\x10\\x1c][\\x01\\x03\\\
x04\\xFF]"
add comment="" name=quake-halflife regexp=\
"^\\xff\\xff\\xff\\xffget(info|challenge)"
add comment="" name=x11 regexp="^[lb].\?\\x0b\r\
\nuserspace pattern=^[lB].\?\\x0b\r\
\nuserspace flags=REG_NOSUB"
add comment="" name=rlogin regexp=\
"^[a-z][a-z0-9][a-z0-9]+/[1-9][0-9]\?[0-9]\?[0-9]\?00"
add comment="" name=http regexp="http/(0\\.9|1\\.0|1\\.1) [1-5][0-9][0-9] [\\x\
09-\\x0d -~]*(connection:|content-type:|content-length:|date:)|post [\\x09\
-\\x0d -~]* http/[01]\\.[019]"
add comment="" name=sip1 regexp=\
"^(invite|register|cancel) sip[\t-\r -~]*sip/[0-2]\\.[0-9]"
add comment="" name=pop3 regexp="^(\\+ok |-err )"
add comment="" name=smb regexp="\\xffsmb[\\x72\\x25]"
add comment="" name=ssh regexp="^ssh-[12]\\.[0-9]"
add comment="" name=jabber regexp=\
"<stream:stream[\t-\r ][ -~]*[\t-\r ]xmlns=['\"]jabber"
add comment="Bittorrent - P2P filesharing / publishing tool " name=bittorrent \
regexp=\
"^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=)"
add comment="" name=ncp regexp=\
"^(dmdt.*\\x01.*(\"\"|\\x11\\x11|uu)|tncp.*33)"
add comment="Direct Connect - P2P filesharing" name=directconnect regexp=\
"^(\\\$mynick |\\\$lock |\\\$key )"
add comment="" name=netbios regexp="\\x81.\?.\?.[A-P][A-P][A-P][A-P][A-P][A-P]\
[A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P\
][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-P][A-\
P][A-P][A-P][A-P][A-P]"
add comment="" name=tftp regexp="^(\\x01|\\x02)[ -~]*(netascii|octet|mail)"
add comment="" name=doom3 regexp="^\\xff\\xffchallenge"
add comment="FTP - File Transfer Protocol - RFC 959" name=ftp regexp=\
"^220[\\x09-\\x0d -~\\x80-\\xfd]*ftp"
add comment="TSP - Berkely UNIX Time Synchronization Protocol" name=tsp \
regexp="^[\\x01-\\x13\\x16-\$]\\x01.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?[ -~]+"
add comment="" name=ssdp regexp="^notify[\\x09-\\x0d ]\\*[\\x09-\\x0d ]http/1\
\\.1[\\x09-\\x0d -~]*ssdp:(alive|byebye)|^m-search[\\x09-\\x0d ]\\*[\\x09-\
\\x0d ]http/1\\.1[\\x09-\\x0d -~]*ssdp:discover"
add comment="" name=imap regexp="^(\\* ok|a[0-9]+ noop)"
add comment="Ares - P2P filesharing " name=ares regexp=\
"^\\x03[]Z].\?.\?\\x05\$"
add comment=\
"FastTrack - P2P filesharing (Kazaa, Morpheus, iMesh, Grokster, etc)" \
name=fasttrack regexp="^get (/.download/[ -~]*|/.supernode[ -~]|/.status[ \
-~]|/.network[ -~]*|/.files|/.hash=[0-9a-f]*/[ -~]*) http/1.1|user-agent: \
kazaa|x-kazaa(-username|-network|-ip|-supernodeip|-xferid|-xferuid|tag)|^g\
ive [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\?[0-9]\?[0-9]\?"
add comment="" name=qq regexp="^.\?.\?\\x02.+\\x03\$"
add comment="" name=msn-filetransfer regexp=\
"^(ver [ -~]*msnftp\\x0d\\x0aver msnftp\\x0d\\x0ausr|method msnmsgr:)"
add comment="" name=yahoo regexp=\
"^(ymsg|ypns|yhoo).\?.\?.\?.\?.\?.\?.\?[lwt].*\\xc0\\x80"
add comment="" name=ntp regexp="^([\\x13\\x1b\\x23\\xd3\\xdb\\xe3]|[\\x14\\x1c\
\$].......\?.\?.\?.\?.\?.\?.\?.\?.\?[\\xc6-\\xff])"
add comment="" name=gnucleuslan regexp="gnuclear connect/[\\x09-\\x0d -~]*user\
-agent: gnucleus [\\x09-\\x0d -~]*lan:"
add comment="" name=vnc regexp="^rfb 00[1-9]\\.00[0-9]\\x0a\$"
add comment="BGP - Border Gateway Protocol - RFC 1771" name=bgp regexp="^\\xff\
\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xf\
f..\?\\x01[\\x03\\x04]"
add comment="" name=openft regexp="x-openftalias: [-)(0-9a-z ~.]"
add comment="" name=h323 regexp=\
"^\\x03..\?\\x08...\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?\\x05"
add comment="Finger - User information server - RFC 1288" name=finger regexp="\
^[a-z][a-z0-9\\-_]+|login: [\\x09-\\x0d -~]* name: [\\x09-\\x0d -~]* Direc\
tory:"
add comment="" name=ident regexp="^[1-9][0-9]\?[0-9]\?[0-9]\?[0-9]\?[\\x09-\\x\
0d]*,[\\x09-\\x0d]*[1-9][0-9]\?[0-9]\?[0-9]\?[0-9]\?(\\x0d\\x0a|[\\x0d\\x0\
a])\?\$"
add comment="" name=gkrellm regexp="^gkrellm [23].[0-9].[0-9]\\x0a\$"
add comment="" name=hddtemp regexp=\
"^\\|/dev/[a-z][a-z][a-z]\\|[0-9a-z]*\\|[0-9][0-9]\\|[cfk]\\|"
add comment="" name=socks regexp="\\x05[\\x01-\\x08]*\\x05[\\x01-\\x08]\?.*\\x\
05[\\x01-\\x03][\\x01\\x03].*\\x05[\\x01-\\x08]\?[\\x01\\x03]"
add comment="Biff - new mail notification" name=biff regexp=\
"^[a-z][a-z0-9]+@[1-9][0-9]+\$"
add comment="DHCP - Dynamic Host Configuration Protocol - RFC 1541" name=dhcp \
regexp="^[\\x01\\x02][\\x01- ]\\x06.*c\\x82sc"
add comment="" name=ipp regexp=ipp://
add comment="" name=msnmessenger regexp="ver [0-9]+ msnp[1-9][0-9]\? [\\x09-\\\
x0d -~]*cvr0\\x0d\\x0a\$|usr 1 [!-~]+ [0-9. ]+\\x0d\\x0a\$|ans 1 [!-~]+ [0\
-9. ]+\\x0d\\x0a\$"
add comment="" name=irc regexp="^(nick[\\x09-\\x0d -~]*user[\\x09-\\x0d -~]*:|\
user[\\x09-\\x0d -~]*:[\\x02-\\x0d -~]*nick[\\x09-\\x0d -~]*\\x0d\\x0a)"
add comment="" name=gopher regexp="^[\\x09-\\x0d]*[1-9,+tgi][\\x09-\\x0d -~]*\
\\x09[\\x09-\\x0d -~]*\\x09[a-z0-9.]*\\.[a-z][a-z].\?.\?\\x09[1-9]"
add comment="" name=telnet regexp=\
"^\\xff[\\xfb-\\xfe].\\xff[\\xfb-\\xfe].\\xff[\\xfb-\\xfe]"
add comment="" name=nntp regexp=\
"^(20[01][\\x09-\\x0d -~]*AUTHINFO USER|20[01][\\x09-\\x0d -~]*news)"
add comment="" name=rtsp regexp="rtsp/1.0 200 ok"
add comment="" name=skypeout regexp="^(\\x01.\?.\?.\?.\?.\?.\?.\?.\?\\x01|\\x0\
2.\?.\?.\?.\?.\?.\?.\?.\?\\x02|\\x03.\?.\?.\?.\?.\?.\?.\?.\?\\x03|\\x04.\?\
.\?.\?.\?.\?.\?.\?.\?\\x04|\\x05.\?.\?.\?.\?.\?.\?.\?.\?\\x05|\\x06.\?.\?.\
\?.\?.\?.\?.\?.\?\\x06|\\x07.\?.\?.\?.\?.\?.\?.\?.\?\\x07|\\x08.\?.\?.\?.\
\?.\?.\?.\?.\?\\x08|\\x09.\?.\?.\?.\?.\?.\?.\?.\?\\x09|\\x0a.\?.\?.\?.\?.\
\?.\?.\?.\?\\x0a|\\x0b.\?.\?.\?.\?.\?.\?.\?.\?\\x0b|\\x0c.\?.\?.\?.\?.\?.\
\?.\?.\?\\x0c|\\x0d.\?.\?.\?.\?.\?.\?.\?.\?\\x0d|\\x0e.\?.\?.\?.\?.\?.\?.\
\?.\?\\x0e|\\x0f.\?.\?.\?.\?.\?.\?.\?.\?\\x0f|\\x10.\?.\?.\?.\?.\?.\?.\?.\
\?\\x10|\\x11.\?.\?.\?.\?.\?.\?.\?.\?\\x11|\\x12.\?.\?.\?.\?.\?.\?.\?.\?\\\
x12|\\x13.\?.\?.\?.\?.\?.\?.\?.\?\\x13|\\x14.\?.\?.\?.\?.\?.\?.\?.\?\\x14|\
\\x15.\?.\?.\?.\?.\?.\?.\?.\?\\x15|\\x16.\?.\?.\?.\?.\?.\?.\?.\?\\x16|\\x1\
7.\?.\?.\?.\?.\?.\?.\?.\?\\x17|\\x18.\?.\?.\?.\?.\?.\?.\?.\?\\x18|\\x19.\?\
.\?.\?.\?.\?.\?.\?.\?\\x19|\\x1a.\?.\?.\?.\?.\?.\?.\?.\?\\x1a|\\x1b.\?.\?.\
\?.\?.\?.\?.\?.\?\\x1b|\\x1c.\?.\?.\?.\?.\?.\?.\?.\?\\x1c|\\x1d.\?.\?.\?.\
\?.\?.\?.\?.\?\\x1d|\\x1e.\?.\?.\?.\?.\?.\?.\?.\?\\x1e|\\x1f.\?.\?.\?.\?.\
\?.\?.\?.\?\\x1f|\\x20.\?.\?.\?.\?.\?.\?.\?.\?\\x20|\\x21.\?.\?.\?.\?.\?.\
\?.\?.\?\\x21|\\x22.\?.\?.\?.\?.\?.\?.\?.\?\\x22|\\x23.\?.\?.\?.\?.\?.\?.\
\?.\?\\x23|\\\$.\?.\?.\?.\?.\?.\?.\?.\?\\\$|\\x25.\?.\?.\?.\?.\?.\?.\?.\?\
\\x25|\\x26.\?.\?.\?.\?.\?.\?.\?.\?\\x26|\\x27.\?.\?.\?.\?.\?.\?.\?.\?\\x2\
7|\\(.\?.\?.\?.\?.\?.\?.\?.\?\\(|\\).\?.\?.\?.\?.\?.\?.\?.\?\\)|\\*.\?.\?.\
\?.\?.\?.\?.\?.\?\\*|\\+.\?.\?.\?.\?.\?.\?.\?.\?\\+|\\x2c.\?.\?.\?.\?.\?.\
\?.\?.\?\\x2c|\\x2d.\?.\?.\?.\?.\?.\?.\?.\?\\x2d|\\..\?.\?.\?.\?.\?.\?.\?.\
\?\\.|\\x2f.\?.\?.\?.\?.\?.\?.\?.\?\\x2f|\\x30.\?.\?.\?.\?.\?.\?.\?.\?\\x3\
0|\\x31.\?.\?.\?.\?.\?.\?.\?.\?\\x31|\\x32.\?.\?.\?.\?.\?.\?.\?.\?\\x32|\\\
x33.\?.\?.\?.\?.\?.\?.\?.\?\\x33|\\x34.\?.\?.\?.\?.\?.\?.\?.\?\\x34|\\x35.\
\?.\?.\?.\?.\?.\?.\?.\?\\x35|\\x36.\?.\?.\?.\?.\?.\?.\?.\?\\x36|\\x37.\?.\
\?.\?.\?.\?.\?.\?.\?\\x37|\\x38.\?.\?.\?.\?.\?.\?.\?.\?\\x38|\\x39.\?.\?.\
\?.\?.\?.\?.\?.\?\\x39|\\x3a.\?.\?.\?.\?.\?.\?.\?.\?\\x3a|\\x3b.\?.\?.\?.\
\?.\?.\?.\?.\?\\x3b|\\x3c.\?.\?.\?.\?.\?.\?.\?.\?\\x3c|\\x3d.\?.\?.\?.\?.\
\?.\?.\?.\?\\x3d|\\x3e.\?.\?.\?.\?.\?.\?.\?.\?\\x3e|\\\?.\?.\?.\?.\?.\?.\?\
.\?.\?\\\?|\\x40.\?.\?.\?.\?.\?.\?.\?.\?\\x40|\\x41.\?.\?.\?.\?.\?.\?.\?.\
\?\\x41|\\x42.\?.\?.\?.\?.\?.\?.\?.\?\\x42|\\x43.\?.\?.\?.\?.\?.\?.\?.\?\\\
x43|\\x44.\?.\?.\?.\?.\?.\?.\?.\?\\x44|\\x45.\?.\?.\?.\?.\?.\?.\?.\?\\x45|\
\\x46.\?.\?.\?.\?.\?.\?.\?.\?\\x46|\\x47.\?.\?.\?.\?.\?.\?.\?.\?\\x47|\\x4\
8.\?.\?.\?.\?.\?.\?.\?.\?\\x48|\\x49.\?.\?.\?.\?.\?.\?.\?.\?\\x49|\\x4a.\?\
.\?.\?.\?.\?.\?.\?.\?\\x4a|\\x4b.\?.\?.\?.\?.\?.\?.\?.\?\\x4b|\\x4c.\?.\?.\
\?.\?.\?.\?.\?.\?\\x4c|\\x4d.\?.\?.\?.\?.\?.\?.\?.\?\\x4d|\\x4e.\?.\?.\?.\
\?.\?.\?.\?.\?\\x4e|\\x4f.\?.\?.\?.\?.\?.\?.\?.\?\\x4f|\\x50.\?.\?.\?.\?.\
\?.\?.\?.\?\\x50|\\x51.\?.\?.\?.\?.\?.\?.\?.\?\\x51|\\x52.\?.\?.\?.\?.\?.\
\?.\?.\?\\x52|\\x53.\?.\?.\?.\?.\?.\?.\?.\?\\x53|\\x54.\?.\?.\?.\?.\?.\?.\
\?.\?\\x54|\\x55.\?.\?.\?.\?.\?.\?.\?.\?\\x55|\\x56.\?.\?.\?.\?.\?.\?.\?.\
\?\\x56|\\x57.\?.\?.\?.\?.\?.\?.\?.\?\\x57|\\x58.\?.\?.\?.\?.\?.\?.\?.\?\\\
x58|\\x59.\?.\?.\?.\?.\?.\?.\?.\?\\x59|\\x5a.\?.\?.\?.\?.\?.\?.\?.\?\\x5a|\
\\[.\?.\?.\?.\?.\?.\?.\?.\?\\[|\\\\.\?.\?.\?.\?.\?.\?.\?.\?\\\\|\\].\?.\?.\
\?.\?.\?.\?.\?.\?\\]|\\^.\?.\?.\?.\?.\?.\?.\?.\?\\^|\\x5f.\?.\?.\?.\?.\?.\
\?.\?.\?\\x5f|\\x60.\?.\?.\?.\?.\?.\?.\?.\?\\x60|\\x61.\?.\?.\?.\?.\?.\?.\
\?.\?\\x61|\\x62.\?.\?.\?.\?.\?.\?.\?.\?\\x62|\\x63.\?.\?.\?.\?.\?.\?.\?.\
\?\\x63|\\x64.\?.\?.\?.\?.\?.\?.\?.\?\\x64|\\x65.\?.\?.\?.\?.\?.\?.\?.\?\\\
x65|\\x66.\?.\?.\?.\?.\?.\?.\?.\?\\x66|\\x67.\?.\?.\?.\?.\?.\?.\?.\?\\x67|\
\\x68.\?.\?.\?.\?.\?.\?.\?.\?\\x68|\\x69.\?.\?.\?.\?.\?.\?.\?.\?\\x69|\\x6\
a.\?.\?.\?.\?.\?.\?.\?.\?\\x6a|\\x6b.\?.\?.\?.\?.\?.\?.\?.\?\\x6b|\\x6c.\?\
.\?.\?.\?.\?.\?.\?.\?\\x6c|\\x6d.\?.\?.\?.\?.\?.\?.\?.\?\\x6d|\\x6e.\?.\?.\
\?.\?.\?.\?.\?.\?\\x6e|\\x6f.\?.\?.\?.\?.\?.\?.\?.\?\\x6f|\\x70.\?.\?.\?.\
\?.\?.\?.\?.\?\\x70|\\x71.\?.\?.\?.\?.\?.\?.\?.\?\\x71|\\x72.\?.\?.\?.\?.\
\?.\?.\?.\?\\x72|\\x73.\?.\?.\?.\?.\?.\?.\?.\?\\x73|\\x74.\?.\?.\?.\?.\?.\
\?.\?.\?\\x74|\\x75.\?.\?.\?.\?.\?.\?.\?.\?\\x75|\\x76.\?.\?.\?.\?.\?.\?.\
\?.\?\\x76|\\x77.\?.\?.\?.\?.\?.\?.\?.\?\\x77|\\x78.\?.\?.\?.\?.\?.\?.\?.\
\?\\x78|\\x79.\?.\?.\?.\?.\?.\?.\?.\?\\x79|\\x7a.\?.\?.\?.\?.\?.\?.\?.\?\\\
x7a|\\{.\?.\?.\?.\?.\?.\?.\?.\?\\{|\\|.\?.\?.\?.\?.\?.\?.\?.\?\\||\\}.\?.\
\?.\?.\?.\?.\?.\?.\?\\}|\\x7e.\?.\?.\?.\?.\?.\?.\?.\?\\x7e|\\x7f.\?.\?.\?.\
\?.\?.\?.\?.\?\\x7f|\\x80.\?.\?.\?.\?.\?.\?.\?.\?\\x80|\\x81.\?.\?.\?.\?.\
\?.\?.\?.\?\\x81|\\x82.\?.\?.\?.\?.\?.\?.\?.\?\\x82|\\x83.\?.\?.\?.\?.\?.\
\?.\?.\?\\x83|\\x84.\?.\?.\?.\?.\?.\?.\?.\?\\x84|\\x85.\?.\?.\?.\?.\?.\?.\
\?.\?\\x85|\\x86.\?.\?.\?.\?.\?.\?.\?.\?\\x86|\\x87.\?.\?.\?.\?.\?.\?.\?.\
\?\\x87|\\x88.\?.\?.\?.\?.\?.\?.\?.\?\\x88|\\x89.\?.\?.\?.\?.\?.\?.\?.\?\\\
x89|\\x8a.\?.\?.\?.\?.\?.\?.\?.\?\\x8a|\\x8b.\?.\?.\?.\?.\?.\?.\?.\?\\x8b|\
\\x8c.\?.\?.\?.\?.\?.\?.\?.\?\\x8c|\\x8d.\?.\?.\?.\?.\?.\?.\?.\?\\x8d|\\x8\
e.\?.\?.\?.\?.\?.\?.\?.\?\\x8e|\\x8f.\?.\?.\?.\?.\?.\?.\?.\?\\x8f|\\x90.\?\
.\?.\?.\?.\?.\?.\?.\?\\x90|\\x91.\?.\?.\?.\?.\?.\?.\?.\?\\x91|\\x92.\?.\?.\
\?.\?.\?.\?.\?.\?\\x92|\\x93.\?.\?.\?.\?.\?.\?.\?.\?\\x93|\\x94.\?.\?.\?.\
\?.\?.\?.\?.\?\\x94|\\x95.\?.\?.\?.\?.\?.\?.\?.\?\\x95|\\x96.\?.\?.\?.\?.\
\?.\?.\?.\?\\x96|\\x97.\?.\?.\?.\?.\?.\?.\?.\?\\x97|\\x98.\?.\?.\?.\?.\?.\
\?.\?.\?\\x98|\\x99.\?.\?.\?.\?.\?.\?.\?.\?\\x99|\\x9a.\?.\?.\?.\?.\?.\?.\
\?.\?\\x9a|\\x9b.\?.\?.\?.\?.\?.\?.\?.\?\\x9b|\\x9c.\?.\?.\?.\?.\?.\?.\?.\
\?\\x9c|\\x9d.\?.\?.\?.\?.\?.\?.\?.\?\\x9d|\\x9e.\?.\?.\?.\?.\?.\?.\?.\?\\\
x9e|\\x9f.\?.\?.\?.\?.\?.\?.\?.\?\\x9f|\\xa0.\?.\?.\?.\?.\?.\?.\?.\?\\xa0|\
\\xa1.\?.\?.\?.\?.\?.\?.\?.\?\\xa1|\\xa2.\?.\?.\?.\?.\?.\?.\?.\?\\xa2|\\xa\
3.\?.\?.\?.\?.\?.\?.\?.\?\\xa3|\\xa4.\?.\?.\?.\?.\?.\?.\?.\?\\xa4|\\xa5.\?\
.\?.\?.\?.\?.\?.\?.\?\\xa5|\\xa6.\?.\?.\?.\?.\?.\?.\?.\?\\xa6|\\xa7.\?.\?.\
\?.\?.\?.\?.\?.\?\\xa7|\\xa8.\?.\?.\?.\?.\?.\?.\?.\?\\xa8|\\xa9.\?.\?.\?.\
\?.\?.\?.\?.\?\\xa9|\\xaa.\?.\?.\?.\?.\?.\?.\?.\?\\xaa|\\xab.\?.\?.\?.\?.\
\?.\?.\?.\?\\xab|\\xac.\?.\?.\?.\?.\?.\?.\?.\?\\xac|\\xad.\?.\?.\?.\?.\?.\
\?.\?.\?\\xad|\\xae.\?.\?.\?.\?.\?.\?.\?.\?\\xae|\\xaf.\?.\?.\?.\?.\?.\?.\
\?.\?\\xaf|\\xb0.\?.\?.\?.\?.\?.\?.\?.\?\\xb0|\\xb1.\?.\?.\?.\?.\?.\?.\?.\
\?\\xb1|\\xb2.\?.\?.\?.\?.\?.\?.\?.\?\\xb2|\\xb3.\?.\?.\?.\?.\?.\?.\?.\?\\\
xb3|\\xb4.\?.\?.\?.\?.\?.\?.\?.\?\\xb4|\\xb5.\?.\?.\?.\?.\?.\?.\?.\?\\xb5|\
\\xb6.\?.\?.\?.\?.\?.\?.\?.\?\\xb6|\\xb7.\?.\?.\?.\?.\?.\?.\?.\?\\xb7|\\xb\
8.\?.\?.\?.\?.\?.\?.\?.\?\\xb8|\\xb9.\?.\?.\?.\?.\?.\?.\?.\?\\xb9|\\xba.\?\
.\?.\?.\?.\?.\?.\?.\?\\xba|\\xbb.\?.\?.\?.\?.\?.\?.\?.\?\\xbb|\\xbc.\?.\?.\
\?.\?.\?.\?.\?.\?\\xbc|\\xbd.\?.\?.\?.\?.\?.\?.\?.\?\\xbd|\\xbe.\?.\?.\?.\
\?.\?.\?.\?.\?\\xbe|\\xbf.\?.\?.\?.\?.\?.\?.\?.\?\\xbf|\\xc0.\?.\?.\?.\?.\
\?.\?.\?.\?\\xc0|\\xc1.\?.\?.\?.\?.\?.\?.\?.\?\\xc1|\\xc2.\?.\?.\?.\?.\?.\
\?.\?.\?\\xc2|\\xc3.\?.\?.\?.\?.\?.\?.\?.\?\\xc3|\\xc4.\?.\?.\?.\?.\?.\?.\
\?.\?\\xc4|\\xc5.\?.\?.\?.\?.\?.\?.\?.\?\\xc5|\\xc6.\?.\?.\?.\?.\?.\?.\?.\
\?\\xc6|\\xc7.\?.\?.\?.\?.\?.\?.\?.\?\\xc7|\\xc8.\?.\?.\?.\?.\?.\?.\?.\?\\\
xc8|\\xc9.\?.\?.\?.\?.\?.\?.\?.\?\\xc9|\\xca.\?.\?.\?.\?.\?.\?.\?.\?\\xca|\
\\xcb.\?.\?.\?.\?.\?.\?.\?.\?\\xcb|\\xcc.\?.\?.\?.\?.\?.\?.\?.\?\\xcc|\\xc\
d.\?.\?.\?.\?.\?.\?.\?.\?\\xcd|\\xce.\?.\?.\?.\?.\?.\?.\?.\?\\xce|\\xcf.\?\
.\?.\?.\?.\?.\?.\?.\?\\xcf|\\xd0.\?.\?.\?.\?.\?.\?.\?.\?\\xd0|\\xd1.\?.\?.\
\?.\?.\?.\?.\?.\?\\xd1|\\xd2.\?.\?.\?.\?.\?.\?.\?.\?\\xd2|\\xd3.\?.\?.\?.\
\?.\?.\?.\?.\?\\xd3|\\xd4.\?.\?.\?.\?.\?.\?.\?.\?\\xd4|\\xd5.\?.\?.\?.\?.\
\?.\?.\?.\?\\xd5|\\xd6.\?.\?.\?.\?.\?.\?.\?.\?\\xd6|\\xd7.\?.\?.\?.\?.\?.\
\?.\?.\?\\xd7|\\xd8.\?.\?.\?.\?.\?.\?.\?.\?\\xd8|\\xd9.\?.\?.\?.\?.\?.\?.\
\?.\?\\xd9|\\xda.\?.\?.\?.\?.\?.\?.\?.\?\\xda|\\xdb.\?.\?.\?.\?.\?.\?.\?.\
\?\\xdb|\\xdc.\?.\?.\?.\?.\?.\?.\?.\?\\xdc|\\xdd.\?.\?.\?.\?.\?.\?.\?.\?\\\
xdd|\\xde.\?.\?.\?.\?.\?.\?.\?.\?\\xde|\\xdf.\?.\?.\?.\?.\?.\?.\?.\?\\xdf|\
\\xe0.\?.\?.\?.\?.\?.\?.\?.\?\\xe0|\\xe1.\?.\?.\?.\?.\?.\?.\?.\?\\xe1|\\xe\
2.\?.\?.\?.\?.\?.\?.\?.\?\\xe2|\\xe3.\?.\?.\?.\?.\?.\?.\?.\?\\xe3|\\xe4.\?\
.\?.\?.\?.\?.\?.\?.\?\\xe4|\\xe5.\?.\?.\?.\?.\?.\?.\?.\?\\xe5|\\xe6.\?.\?.\
\?.\?.\?.\?.\?.\?\\xe6|\\xe7.\?.\?.\?.\?.\?.\?.\?.\?\\xe7|\\xe8.\?.\?.\?.\
\?.\?.\?.\?.\?\\xe8|\\xe9.\?.\?.\?.\?.\?.\?.\?.\?\\xe9|\\xea.\?.\?.\?.\?.\
\?.\?.\?.\?\\xea|\\xeb.\?.\?.\?.\?.\?.\?.\?.\?\\xeb|\\xec.\?.\?.\?.\?.\?.\
\?.\?.\?\\xec|\\xed.\?.\?.\?.\?.\?.\?.\?.\?\\xed|\\xee.\?.\?.\?.\?.\?.\?.\
\?.\?\\xee|\\xef.\?.\?.\?.\?.\?.\?.\?.\?\\xef|\\xf0.\?.\?.\?.\?.\?.\?.\?.\
\?\\xf0|\\xf1.\?.\?.\?.\?.\?.\?.\?.\?\\xf1|\\xf2.\?.\?.\?.\?.\?.\?.\?.\?\\\
xf2|\\xf3.\?.\?.\?.\?.\?.\?.\?.\?\\xf3|\\xf4.\?.\?.\?.\?.\?.\?.\?.\?\\xf4|\
\\xf5.\?.\?.\?.\?.\?.\?.\?.\?\\xf5|\\xf6.\?.\?.\?.\?.\?.\?.\?.\?\\xf6|\\xf\
7.\?.\?.\?.\?.\?.\?.\?.\?\\xf7|\\xf8.\?.\?.\?.\?.\?.\?.\?.\?\\xf8|\\xf9.\?\
.\?.\?.\?.\?.\?.\?.\?\\xf9|\\xfa.\?.\?.\?.\?.\?.\?.\?.\?\\xfa|\\xfb.\?.\?.\
\?.\?.\?.\?.\?.\?\\xfb|\\xfc.\?.\?.\?.\?.\?.\?.\?.\?\\xfc|\\xfd.\?.\?.\?.\
\?.\?.\?.\?.\?\\xfd|\\xfe.\?.\?.\?.\?.\?.\?.\?.\?\\xfe|\\xff.\?.\?.\?.\?.\
\?.\?.\?.\?\\xff)"
add comment="" name=skypetoskype regexp="^..\\x02............."
add comment="" name=counterstrike-source regexp=\
"^\\xff\\xff\\xff\\xff.*cstrikeCounter-Strike"
add comment="" name=halflife2-deathmatch regexp=\
"^\\xff\\xff\\xff\\xff.*hl2mpDeathmatch"
add comment="" name=soulseek regexp=\
"^(\\x05..\?|.\\x01.[ -~]+\\x01F..\?.\?.\?.\?.\?.\?.\?)\$"
add comment="" name=ssl regexp=\
"^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)"
add comment="" name=whois regexp="^[ !-~]+\\x0d\\x0a\$"
add comment="" name=dayofdefeat-source regexp=\
"^\\xff\\xff\\xff\\xff.*dodDay of Defeat"
add comment="" name=teamspeak regexp="^\\xf4\\xbe\\x03.*teamspeak"
add comment="" name=ventrilo regexp="^..\?v\\\$\\xcf"
add comment="" name=http-rtsp regexp="^(get[\\x09-\\x0d -~]* Accept: applicati\
on/x-rtsp-tunnelled|http/(0\\.9|1\\.0|1\\.1) [1-5][0-9][0-9] [\\x09-\\x0d \
-~]*a=control:rtsp://)"
add comment="" name=pcanywhere regexp="^(nq|st)\$"
add comment="" name=subversion regexp="^\\( success \\( 1 2 \\("
add comment=\
"Computer Interface to Message Distribution, an SMSC protocol by Nokia" \
name=cimd regexp="\\x02[0-4][0-9]:[0-9]+.*\\x03\$"
add comment="" name=mohaa regexp="^\\xff\\xff\\xff\\xffgetstatus\\x0a"
add comment="" name=radmin regexp="^\\x01\\x01(\\x08\\x08|\\x1b\\x1b)\$"
add comment="Chikka - SMS service which can be used without phones- http://chi\
kka.com" name=chikka regexp="^CTPv1\\.[123] Kamusta.*\\x0d\\x0a\$"
add comment="" name=replaytv-ivs regexp="^(get /ivs-IVSGetFileChunk|http/(0\\.\
9|1\\.0|1\\.1) [1-5][0-9][0-9] [\\x09-\\x0d -~]*\\x23\\x23\\x23\\x23\\x23R\
EPLAY_CHUNK_START\\x23\\x23\\x23\\x23\\x23)"
add comment=\
"Armagetron Advanced - open source Tron/snake based multiplayer game" \
name=armagetron regexp=YCLC_E|CYEL
add comment="" name=https regexp=\
"^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)"
add comment="" name=bittorrent2 regexp="^(\\x13bittorrent protocol|azver\\x01\
\$|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcom\
et/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]\r\
\n"
add comment="" name=bittorrent_ANNOUNCE regexp=^get.+announce.
add comment="" name=sip regexp="^(invite|register|cancel|message|subscribe|not\
ify) sip[\\x09-\\x0d -~]*sip/[0-2]\\.[0-9]"
add comment="" name=smtp regexp="^220[\\x09-\\x0d -~]* (e\?smtp|simple mail)\r\
\nuserspace pattern=^220[\\x09-\\x0d -~]* (E\?SMTP|[Ss]imple [Mm]ail)\r\
\nuserspace flags=REG_NOSUB REG_EXTENDED"
/ip firewall mangle
add action=mark-packet chain=prerouting comment="" disabled=no \
dst-address-list=rapidshare-host new-packet-mark=rapid passthrough=no \
protocol=tcp
add action=mark-packet chain=prerouting comment="" disabled=no \
dst-address-list=rapidshare-host-script new-packet-mark=rapid \
passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="" disabled=no \
dst-address-list=Youtube new-packet-mark=youtube passthrough=no protocol=\
tcp
add action=mark-packet chain=prerouting comment="WAN1 down QoS_1 DNS" \
disabled=no in-interface=wan1 new-packet-mark=QoS_1_Down-UDP passthrough=\
no protocol=udp src-port=53,123
add action=mark-packet chain=prerouting comment="QoS_1 ping" disabled=no \
in-interface=wan1 new-packet-mark=QoS_1_Down-ICMP passthrough=no \
protocol=icmp
add action=mark-packet chain=prerouting comment="QoS_1 syn 0-200" disabled=no \
in-interface=wan1 new-packet-mark=QoS_1_Down packet-size=0-200 \
passthrough=no protocol=tcp src-port=80,443 tcp-flags=syn
add action=mark-packet chain=prerouting comment="QoS_1 ack 0-200" disabled=no \
in-interface=wan1 new-packet-mark=QoS_1_Down packet-size=0-200 \
passthrough=no protocol=tcp src-port=80,443 tcp-flags=ack
add action=mark-packet chain=prerouting comment=\
"QoS_1- SIP - Layer7 Session Initiation Protocol - Internet telephony " \
disabled=no in-interface=wan1 layer7-protocol=sip new-packet-mark=\
QoS_1_Down passthrough=no
add action=mark-packet chain=prerouting comment="QoS_1- SIP - Layer7 Session I\
nitiation Protocol - Internet telephony sip1" disabled=no in-interface=\
wan1 layer7-protocol=sip1 new-packet-mark=QoS_1_Down passthrough=no
add action=mark-packet chain=prerouting comment="QoS_2 syn 0-666" disabled=no \
in-interface=wan1 new-packet-mark=QoS_2_Down packet-size=0-666 \
passthrough=no protocol=tcp src-port=110,995,143,993,25,20,21 tcp-flags=\
syn
add action=mark-packet chain=prerouting comment="QoS_2 ack 0-666" disabled=no \
in-interface=wan1 new-packet-mark=QoS_2_Down packet-size=0-666 \
passthrough=no protocol=tcp src-port=110,995,143,993,25,20,21 tcp-flags=\
ack
add action=mark-packet chain=prerouting comment="QoS_3 syn 0-666" disabled=no \
in-interface=wan1 new-packet-mark=QoS_3_Down packet-size=0-666 \
passthrough=no protocol=tcp tcp-flags=syn
add action=mark-packet chain=prerouting comment="QoS_3 ack 0-666" disabled=no \
in-interface=wan1 new-packet-mark=QoS_3_Down packet-size=0-666 \
passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=prerouting comment=\
"QoS_4 (small-files) supose surfing web" connection-bytes=0-1000000 \
disabled=no in-interface=wan1 new-packet-mark=QoS_4_Down passthrough=no \
protocol=tcp src-port=80,443
add action=mark-packet chain=prerouting comment="QoS_5 news" disabled=no \
in-interface=wan1 new-packet-mark=QoS_5_Down passthrough=no protocol=tcp \
src-port=119
add action=mark-packet chain=prerouting comment=\
"QoS_6 (big-files) supose download files" connection-bytes=1000000-0 \
disabled=no in-interface=wan1 new-packet-mark=QoS_6_Down passthrough=no \
protocol=tcp src-port=80,443
add action=mark-packet chain=prerouting comment="QoS_7 p2p" disabled=no \
in-interface=wan1 new-packet-mark=QoS_7_Down_torrent_in p2p=all-p2p \
passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="QoS_7 p2p via L7 bittorrent" \
disabled=no in-interface=wan1 layer7-protocol=bittorrent new-packet-mark=\
QoS_7_Down_torrent_in passthrough=no
add action=mark-packet chain=prerouting comment=\
"QoS_7 p2p via L7 bittorrent2" disabled=no in-interface=wan1 \
layer7-protocol=bittorrent2 new-packet-mark=QoS_7_Down_torrent_in \
passthrough=no
add action=mark-packet chain=prerouting comment="QoS_7 p2p via L7 edonkey" \
disabled=no in-interface=wan1 layer7-protocol=edonkey new-packet-mark=\
QoS_7_Down_torrent_in passthrough=no
add action=mark-packet chain=prerouting comment="QoS_7 p2p via L7 fasttrack" \
disabled=no in-interface=wan1 layer7-protocol=fasttrack new-packet-mark=\
QoS_7_Down_torrent_in passthrough=no
add action=mark-packet chain=prerouting comment=\
"QoS_7 p2p via L7 directconnect" disabled=no in-interface=wan1 \
layer7-protocol=directconnect new-packet-mark=QoS_7_Down_torrent_in \
passthrough=no
add action=mark-packet chain=prerouting comment="QoS_8 other" disabled=no \
in-interface=wan1 new-packet-mark=QoS_8_Down passthrough=no
add action=mark-packet chain=postrouting comment="QoS UP wan1" disabled=no \
dst-port=80,443 new-packet-mark=QoS_1_Up out-interface=wan1 packet-size=\
0-666 passthrough=no protocol=tcp tcp-flags=syn
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=\
80,443 new-packet-mark=QoS_1_Up out-interface=wan1 packet-size=0-666 \
passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting comment="ICMP UP" disabled=no \
new-packet-mark=QoS_1_Up-ICMP out-interface=wan1 passthrough=no protocol=\
icmp
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=\
53,123 new-packet-mark=QoS_1_Up-UDP out-interface=wan1 passthrough=no \
protocol=udp
add action=mark-packet chain=postrouting comment="" connection-bytes=\
0-1000000 disabled=no dst-port=80,443 new-packet-mark=QoS_2_Up \
out-interface=wan1 passthrough=no protocol=tcp
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=\
110,995,143,993,25,20,21 new-packet-mark=QoS_2_Up out-interface=wan1 \
packet-size=0-666 passthrough=no protocol=tcp tcp-flags=syn
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=\
110,995,143,993,25,20,21 new-packet-mark=QoS_2_Up out-interface=wan1 \
packet-size=0-666 passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting comment="" disabled=no \
new-packet-mark=QoS_3_Up out-interface=wan1 packet-size=0-666 \
passthrough=no protocol=tcp tcp-flags=syn
add action=mark-packet chain=postrouting comment="" disabled=no \
new-packet-mark=QoS_3_Up out-interface=wan1 packet-size=0-666 \
passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=\
110,995,143,993,25,20,21 new-packet-mark=QoS_4_Up out-interface=wan1 \
passthrough=no protocol=tcp
add action=mark-packet chain=postrouting comment=\
"QoS_8 p2p via L7 bittorrent2" disabled=no layer7-protocol=bittorrent2 \
new-packet-mark=QoS_8_Up out-interface=wan1 passthrough=no
add action=mark-packet chain=postrouting comment="QoS_8 p2p via mikrotik" \
disabled=no new-packet-mark=QoS_8_Up out-interface=wan1 p2p=all-p2p \
passthrough=no
add action=mark-packet chain=postrouting comment="QoS_7 other" disabled=no \
new-packet-mark=QoS_7_Up out-interface=wan1 passthrough=no
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=200k \
max-limit=650k name=QoS_wan1_Up parent=global-out priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=4M \
max-limit=8800k name=QoS_wan1_DOWN parent=global-in priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1 packet-mark=QoS_1_Up parent=QoS_wan1_Up priority=1 \
queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_2 packet-mark=QoS_2_Up parent=QoS_wan1_Up priority=2 \
queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_3 packet-mark=QoS_3_Up parent=QoS_wan1_Up priority=3 \
queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_7 packet-mark=QoS_7_Up parent=QoS_wan1_Up priority=7 \
queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_8 torrent" packet-mark=QoS_8_Up parent=QoS_wan1_Up \
priority=8 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_4 packet-mark=QoS_4_Up parent=QoS_wan1_Up priority=4 \
queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1_down packet-mark=QoS_1_Down parent=QoS_wan1_DOWN \
priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_3_down packet-mark=QoS_3_Down parent=QoS_wan1_DOWN \
priority=3 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_2_down packet-mark=QoS_2_Down parent=QoS_wan1_DOWN \
priority=2 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_4_down(small-files)" packet-mark=QoS_4_Down parent=\
QoS_wan1_DOWN priority=4 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=5M name="QoS_5_down(news)" packet-mark=QoS_5_Down parent=\
QoS_wan1_DOWN priority=5 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_6_down(big-files)" packet-mark=QoS_6_Down parent=\
QoS_wan1_DOWN priority=6 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_7_down(torrent)" packet-mark=QoS_7_Down_torrent_in \
parent=QoS_wan1_DOWN priority=7 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_8_down packet-mark=QoS_8_Down parent=QoS_wan1_DOWN \
priority=8 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_5_down(youtube)" packet-mark=youtube parent=\
QoS_wan1_DOWN priority=5 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name="QoS_5_down(rapid)" packet-mark=rapid parent=\
QoS_wan1_DOWN priority=5 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1_down-UDP packet-mark=QoS_1_Down-UDP parent=\
QoS_wan1_DOWN priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1-UDP packet-mark=QoS_1_Up-UDP parent=QoS_wan1_Up \
priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1_down-ICMP packet-mark=QoS_1_Down-ICMP parent=\
QoS_wan1_DOWN priority=1 queue=default-small
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=QoS_1-ICMP packet-mark=QoS_1_Up-ICMP parent=QoS_wan1_Up \
priority=1 queue=default-small
p2p is working ... it is not the point ... point i to make p2p with lower priority so what is hapening ... example: torrent is working with full speed when not browsing web ... but when start browsing web torent automatic get slower speed ... and browsing is normal ... also all other trafic with higher priority is normal ...@bax
Nice... I'll update my traffic rules for p2p protocols since I see new stuff here. But also, what will happen if someone turn on torrent encryption and use a https tracker? Where would that priority end up?
Also, can you do a little update on that codes? \ on the end of each line is a bit confusing.
Unregistered traffic end with all other traficc - which is in this example QoS_8_down with priority 8. ... see it on picture.@bax
You misunderstood my question... I asked on what queue will end up unregistered traffic like encrypted p2p?
And bax, don't worry about your English... we can easily understood each other neighbor
To cut down download speed on torrent usage? That's even worst than just simply block them. It could do for a few days but then users would figure that out and you'd had a bunch of angry mob on your back. Let's take for compare action of some world wide ISP's and their throttling speed on p2p and other downloads... People got furious because they pay for certain download rate (often quite expensive) and they found out that their download rate is useless or you have it at least on a long period contract because they can use it only for browsing web and downloading e-mailThanks mves ... nice advice.
But did you try in wirelles part (2.4 ghz) to change to some fixed slower rate ?
It may be helpfull .
Unfortunately I havenot so loaded node to test by myself.
/ip firewall layer7-protocol
add comment="" name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
add comment="" name=BITTORENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|\
get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/\
|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]\\r\\n"
/ip firewall filter
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (UDP)" disabled=no dst-port=\
27000-27050,28960 protocol=udp
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (TCP)" disabled=no dst-port=\
27000-27050,28960 protocol=tcp
add action=add-src-to-address-list address-list=Torrent address-list-timeout=\
1h30m chain=forward comment=" ______Bittorent_____" disabled=no \
layer7-protocol=BITTORENT src-address=192.168.xx.10-192.168.xx.249 time=\
9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no layer7-protocol=\
BITTORENT reject-with=icmp-network-unreachable time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent Announce" \
address-list-timeout=1h30m chain=forward comment=______Announce____ \
disabled=no layer7-protocol=BITTORRENT_ANNOUNCE src-address=\
192.168.xx.10-192.168.xx.249 time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no layer7-protocol=\
BITTORRENT_ANNOUNCE reject-with=icmp-network-unreachable time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent udp" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 udp___" \
disabled=no dst-port=6881-6999 protocol=udp src-address=\
192.168.xx.10-192.168.xx.249 time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=6881-6999 \
protocol=udp reject-with=icmp-network-unreachable time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent tcp" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 tcp___" \
disabled=no dst-port=6881-6999 protocol=tcp src-address=\
192.168.xx.10-192.168.xx.249 time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=6881-6999 \
protocol=tcp reject-with=icmp-network-unreachable time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent all-p2p" \
address-list-timeout=1h30m chain=forward comment=\
__________All-p2p__________ disabled=no p2p=all-p2p src-address=\
192.168.xx.10-192.168.xx.249 time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no p2p=all-p2p \
reject-with=icmp-network-unreachable time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="Torrent cleaning" disabled=no \
dst-port=10000-65500 protocol=tcp reject-with=icmp-network-unreachable \
src-address-list=Torrent src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
Torrent src-port=10000-65500 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
Torrent src-port=1000-5000 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=1000-5000 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=1000-5000 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=1000-5000 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent all-p2p" src-port=1000-5000 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
In my example I was just cut out bandwith on my news server.To cut down download speed on torrent usage?
happy to fight windmillsI'll make an update of my ways of p2p blocking. Well, as soon as I figure how to get list of rules out of terminal window so it can be copy/paste
So far... windmills are loosing. This don Quijote won this battle. Windmills get heavy defeat so I guess it will take some time for them to get recovered. War however is not over, but this battle ishappy to fight windmills
My Windmills have been loosing for more then a yearhappy to fight windmills
/ip firewall mangle
add action=mark-connection chain=prerouting layer7-protocol=BITTORRENT new-connection-mark=p2p passthrough=yes protocol=tcp src-address-list=p2p_user
add action=mark-connection chain=prerouting connection-state=new layer7-protocol=BITTORRENT new-connection-mark=p2p passthrough=yes protocol=udp src-address-list=p2p_user
add action=mark-connection chain=prerouting layer7-protocol=BITTORRENT_ANNOUNCE new-connection-mark=p2pa passthrough=yes protocol=tcp src-address-list=HotSpot dst-address-list=!p2p_announcers
add action=add-dst-to-address-list address-list=p2p_announcers chain=prerouting connection-mark=p2pa src-address-list=HotSpot
add action=add-src-to-address-list address-list=p2p_user chain=prerouting connection-state=new dst-address-list=p2p_announcers src-address-list=HotSpot
I also put in the DNS 127.0.0.1 entries by TKITFrank/ip firewall filter
add action=drop chain=forward comment="Drop p2p" connection-mark=p2p
add action=drop chain=forward dst-address-list=p2p_announcers src-address-list=HotSpot
What do you guys think?/ip proxy access
add action=deny disabled=no path=*.torrent
L7 matcher is collecting first 10 packets of connection or first 2KB of connection and searches for pattern in collected data. If pattern is not found in collected data, matcher is not inspecting further. Allocated memory is freed and protocol is considered as unknown. You should take into account that a lot of connections will significantly increase memory usage. To avoid it add regular firewall matchers to reduce amount of data passed to layer-7 filters.
its counted as an abuse for our ip addresses, so we have to prevent that.Why block if they are paying ? Upgrade your network and let them download
Are you a cop and government in same time?its counted as an abuse for our ip addresses, so we have to prevent that.Why block if they are paying ? Upgrade your network and let them download
Are you a cop and government in same time?its counted as an abuse for our ip addresses, so we have to prevent that.Why block if they are paying ? Upgrade your network and let them download
Don't be please.
Invest in network, not in stupidity to make a client to leave your service.
But for admins of office networks ... aren't they give port by exception and anything else blocked
Possibly is more important Mikrotik team to add a option connections limit
Not? I used once a command promt and telnet from windows xp to connect to the router where I accidentally killed winbox access for myself. Copy/paste worked... I mean cmd promt way (edit => mark => (select) Enter, edit => paste) if you were referring to this.sorry for asking such a stupid question but how to put all of this commands together ? should i type all of this ?! SSH and TELNET does not support PASTE function as far as i know.
Oh... well, they have to be more generous to have p2p allowed 24/7. You see, many of them want to have a cheap equipment, cheap internet and all benefits of the internet. To have p2p over a day on 2.4 Ghz... no wayWhy block if they are paying ? Upgrade your network and let them download
I have the first revision up and running and in-place, and it is working fantastically. The only false positive I have found is simply having uTorrent/bittorrent/Vuze open and not actively downloading something will still trip the filter, due to the active participation in uTP/DHT even when idle. The forthcoming hotspot page will explain this to the users. Keep in mind that this is targeted at a wireless hotspot & student internet access at a local community college, so we can be a bit more aggressive than, say, an ISP.Hi, I thing you are on to something here Please let us know how this is working.
I would however skip the static ports for torrents and go with the all-p2p and the L7 filter to add them in a address list. To me static ports is to unreliable. The 450G is pretty fast and you can run it @800Mhz? Have you tried it @ that speed and seen how much it uses the CPU?
Anyhow as I said before let us know how it is working.
/ip firewall nat
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=53 protocol=udp src-address-list=!whitelist to-ports=53
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=53 protocol=tcp src-address-list=!whitelist to-ports=53
/ip dns static
add address=203.0.113.111 disabled=no name=router.utorrent.com ttl=1d
add address=203.0.113.111 disabled=no name=dht.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vrpc.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vzrpx020.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vzapp020.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=client.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=mirror-user1.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=ip.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=jp.bitcomet.com ttl=1d
add address=203.0.113.111 disabled=no name=torrent-cache.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=inside.bitcomet.com ttl=1d
add address=203.0.113.111 disabled=no name=router.bitcomet.net ttl=1d
add address=203.0.113.111 disabled=no name=router.bittorrent.com ttl=1d
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
/ip firewall filter
add action=jump chain=forward comment="P2P-All detection" disabled=no jump-target=p2p_chain p2p=all-p2p
add action=jump chain=forward comment="P2P DNS block hit" disabled=no dst-address=203.0.113.111 jump-target=p2p_chain
add action=jump chain=forward comment=Bittorrent disabled=no jump-target=p2p_chain layer7-protocol=BITTORRENT
add action=log chain=p2p_chain comment="P2P Debug" disabled=yes log-prefix=P2P-Debug
add action=accept chain=p2p_chain comment="Whitelist Bypass" disabled=no src-address-list=whitelist
add action=accept chain=p2p_chain comment="Whitelist Bypass" disabled=no dst-address-list=whitelist
add action=jump chain=p2p_chain comment="Greylist Src: bypass log, just drop" disabled=no jump-target=p2p_block src-address-list=greylist
add action=jump chain=p2p_chain comment="Greylist Dst: bypass log, just drop" disabled=no dst-address-list=greylist jump-target=p2p_block
add action=log chain=p2p_chain disabled=no dst-address-list=!blacklist log-prefix=P2P-Detection-New src-address-list=!blacklist
add action=add-src-to-address-list address-list=blacklist address-list-timeout=45m chain=p2p_chain comment="Blacklist P2P upload" disabled=no src-address=<LAN SUBNET>
add action=add-dst-to-address-list address-list=blacklist address-list-timeout=45m chain=p2p_chain comment="Blacklist P2P download" disabled=no dst-address=<LAN SUBNET>
add action=jump chain=p2p_chain comment="Jump Block" disabled=no jump-target=p2p_block
add action=drop chain=p2p_block comment="Drop P2P" disabled=no
/queue type
add kind=pcq name=whitelist_queue_upload pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=10 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=200
add kind=pcq name=whitelist_queue_download pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=10 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=200
add kind=pcq name=blacklist_queue_upload pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=10 pcq-rate=14k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=200
add kind=pcq name=blacklist_queue_download pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=10 pcq-rate=29k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=200
add kind=pcq name=student_queue_upload pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=256k pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=student_queue_download pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=8M pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=2M name=upload_root parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=30M name=download_root parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=download_whitelist_leaf packet-mark=whitelist_download_packet parent=download_root priority=4 queue=whitelist_queue_download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=upload_whitelist_leaf packet-mark=whitelist_upload_packet parent=upload_root priority=4 queue=whitelist_queue_upload
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=25M name=download_student_leaf packet-mark=student_download_packet parent=download_root priority=5 queue=student_queue_download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=1500k name=upload_student_leaf packet-mark=student_upload_packet parent=upload_root priority=5 queue=student_queue_upload
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=1M name=download_blacklist_leaf packet-mark=blacklist_download_packet parent=download_root priority=8 queue=blacklist_queue_download
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=128k name=upload_blacklist_leaf packet-mark=blacklist_upload_packet parent=upload_root priority=8 queue=blacklist_queue_upload
/ip firewall mangle
add action=mark-packet chain=postrouting comment="Whitelist Download" disabled=no dst-address-list=whitelist new-packet-mark=whitelist_download_packet passthrough=no
add action=mark-packet chain=postrouting comment="Whitelist Upload" disabled=no new-packet-mark=whitelist_upload_packet passthrough=no src-address-list=whitelist
add action=mark-packet chain=postrouting comment="Greylist Upload (whitelist queue)" disabled=no new-packet-mark=whitelist_upload_packet passthrough=no src-address-list=greylist
add action=mark-packet chain=postrouting comment="Greylist Download (whitelist queue)" disabled=no dst-address-list=greylist new-packet-mark=whitelist_download_packet passthrough=no
add action=mark-packet chain=postrouting comment="Blacklist Download" disabled=no dst-address-list=blacklist new-packet-mark=blacklist_download_packet passthrough=no
add action=mark-packet chain=postrouting comment="Blacklist Upload" disabled=no new-packet-mark=blacklist_upload_packet passthrough=no src-address-list=blacklist
add action=mark-packet chain=postrouting comment="Student Upload" disabled=no new-packet-mark=student_upload_packet out-interface=ether1-WAN passthrough=no
add action=mark-packet chain=postrouting comment="Student Download" disabled=no new-packet-mark=student_download_packet passthrough=no
torrent technology is nothing illegal in itself. we offer RouterOS downloads via torrent, and many companies do the same.if u are working with datacenters u would know that downloading torrent, sending spam is counted as an abuse and they will grant a payment for this abuse which is nearly 15$ for each one !
/ip firewall nat
add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=tcp src-address-list=!whitelist to-addresses=<ROUTER LAN IP>
add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=udp src-address-list=!whitelist to-addresses=<ROUTER LAN IP>
/ip firewall filter
add action=jump chain=forward comment="P2P DNS block hit" disabled=no dst-address=203.0.113.111 jump-target=p2p_chain
The QoS stage can not "drop" traffic directly, it can only slow it down. The problem with tracking by source-port is that in an RFC compliant NAT router, each person behind it typically has all their traffic come out a single port. If someone were running a NAT router on their own, inside your network, you would end up totally blocking individuals.Can you use a p2p block on a QoS stage and get traffic get dropped by PCQ setting on let's say source port classification? So let's say, everything that uses more that 10 connections per source port in a current queue? So, will it work that way?
The NAT code redirects all TCP and UDP traffic destined for port 53 (DNS) to the local router. This prevents users from simply setting a static DNS and bypassing your DNS control.Also,And, how to get dns static on/off through a scheduler? Or I'll have to only get "P2P DNS block hit" time limited to allow p2p over allowed time? Also, IP firewall nat setting, I can simply add interface or tracking IP range instead of "!whitelist", right? And can you explain to me what ip firewall nat code do... I'm a bit lost on that oneCode: Select all/ip firewall nat add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=tcp src-address-list=!whitelist to-addresses=<ROUTER LAN IP> add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=udp src-address-list=!whitelist to-addresses=<ROUTER LAN IP> /ip firewall filter add action=jump chain=forward comment="P2P DNS block hit" disabled=no dst-address=203.0.113.111 jump-target=p2p_chain
Hmmm... let's see if I'm getting this right. On my network there are 4 DNS entries used. 2 internal most commonly used and other two are openDNS. Will this affect those users?The NAT code redirects all TCP and UDP traffic destined for port 53 (DNS) to the local router. This prevents users from simply setting a static DNS and bypassing your DNS control.
Maybe, but my mikrotik scripting stopped on scheduled reboot routers and emergency mass bandwidth change for users so I guess that I have no idea where to start on that oneScheduling should be simple enough with a couple of scripts. Set the "enable" script to create all the static DNS entries mentioned above, then flush the DNS cache. Then create a "disable" script that deletes the static entries and flushes the cache again. The NAT rules and the "P2P DNS block hit" rules could be left in place.
Perhaps this caused internet blackout on some routers on a last attempt for implementing static DNS entries. Well, maybe in this case even 30 seconds or less could do a trick since it needs only to block attempt, right? Beside, all of them would end up on a p2p user list for some time.By default, static DNS entries have a 24hour TTL. To prevent client-side caching from causing trouble, I would suggest setting them for a maybe a 15 minute TTL instead.
Enabling the DNS redirection would prevent customers from directly using OpenDNS. If you just wanted the basic OpenDNS spyware filtering and not any of the advanced content filters, (or if you are running a hotspot like myself and want to use OpenDNS as a method for additional content filtering), then you can simply point the RouterOS's DNS server to the OpenDNS servers and use them.Hmmm... let's see if I'm getting this right. On my network there are 4 DNS entries used. 2 internal most commonly used and other two are openDNS. Will this affect those users?
/system scheduler add name=Enable_P2P_DNS_Filter interval=24h start-time=7:00:00 \
on-event="/ip dns static enable 0,1,2,3,4,5,6,7,8,9,10,11,12; /ip dns cache flush"
/system scheduler add name=Disable_P2P_DNS_Filter interval=24h start-time=7:00:00 \
on-event="/ip dns static disable 0,1,2,3,4,5,6,7,8,9,10,11,12; /ip dns cache flush"
:foreach i in [/ip dns static find] do={
/ip dns static disable $i
}
add address=203.0.113.111 disabled=no name=dht.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vrpc.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vzrpx020.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vzapp020.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=client.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=ip.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=jp.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=torrent-cache.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=inside.bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=router.bitcomet.net ttl=15m
add address=203.0.113.111 disabled=no name=router.bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=router.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=tracker.publicbt.com ttl=15m
add address=203.0.113.111 disabled=no name=utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns1.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns2.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns3.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=istole.it ttl=15m
add address=203.0.113.111 disabled=no name=thepiratebay.org ttl=15m
add address=203.0.113.111 disabled=no name=1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=mininova.org ttl=15m
add address=203.0.113.111 disabled=no name=bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=publicbt.com ttl=15m
add address=203.0.113.111 disabled=no name=openbittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=pow7.com ttl=15m
add address=203.0.113.111 disabled=no name=vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=llnwd.net ttl=15m
add address=203.0.113.111 disabled=no name=ns1.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=ns2.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=genesis.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=exodus.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=nemesis.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=tracker.openbittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=bittorrent.vo.llnwd.net ttl=15m
add address=203.0.113.111 disabled=no name=apps.bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=10.rarbg.com ttl=15m
add address=203.0.113.111 disabled=no name=ns1.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ns2.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ns3.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ens-**bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).pow7.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).vuze.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).publicbt.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bitcomet.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).utorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).1337x.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).thepiratebay.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).llnwd.net" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).mininova.org" ttl=15m
I believe you are missing the intention of the DNS blocking. The entries TKITFrank and I have listed are not torrent trackers. There are far too many trackers to block them via DNS (since almost anyone can run a tracker). Blocking of tracker activity is controlled by the L7 filters TKITFrank provided.Also, that DNS list are quite outdated. There are also 1337.org, pow7.com, torrentz.com, istole.it and some others. Just look at a common tracker list in a torrent from piratebay for example.
Hope this helps. The DNS settings are vital for this to work.Thx for answer!
Ok, here what I have done:
1) Made 2 L7 protocols that I copied from this thread (called them BITTORRENT and BITTORRENT_ANNOUNCE).
OK
2) In mangle made 4 rules: 3 of them have same configurations... Chain - prerouting, action - jump, jump target - p2p-traffic. The first one has L7 - BITTORRENT, and the second BITTORRENT_ANNOUNCE. The third one has just P2P - all-p2p! (none of them dosent mark packets, should they, or something else? I should mark them and call like what?). I see u said there need to mark all that packets and send them to p2p-traffic chain and then there mark connection like p2p. So, if I am right, I should at those 3 rules set Packet Mark and call it ie p2p-packets.? 4th rule is made for marking connection, chain - p2p-traffic, action - mark connection, new connection mark - p2p (no any other changes made).
Sorry for my bad choice of words, Just make a rule in prerouting-chain where you use your L7 and the default rule for p2p and choose action jump and target p2p-chain. In the new chain called p2p-chain set action to new-connction mark and mark it to p2p.
3) Filter rule made like this: chain - forward, connection mark - p2p, action - drop. Thats it.
OK
4) Added those static DNS entries... But dunno how to make it work... Where should I set my primary dns disabled (or just make mikrotik be primary one) or what actually I should do, that is little unclear to me! If I disable that, would everyone be able surf the net at all?
Create a new rule in forward chain and set UDP/TCP protocol and dest port 53 (depending on server you might want to have source port 53 in a new rule as well) and set action to drop.
In the DNS server set primary and secondary server to you own DNS server or an ISP dns server and activate allow remote requests. Make sure only your own network can access it (The mikrotik). Announce this settings via DHCP or what ever you use
There settings should point to the mikrotik router as DNS server.
Regards,
Milan.
He didn't say it was illegal.torrent technology is nothing illegal in itself. we offer RouterOS downloads via torrent, and many companies do the same.if u are working with datacenters u would know that downloading torrent, sending spam is counted as an abuse and they will grant a payment for this abuse which is nearly 15$ for each one !
/ip firewall layer7-protocol
add comment="" name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
add comment="" name=BITTORENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|\
get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/\
|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]\\r\\n"
/ip firewall filter
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (UDP)" disabled=no dst-port=\
27000-27050,28960 protocol=udp
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (TCP)" disabled=no dst-port=\
27000-27050,28960 protocol=tcp
add action=add-src-to-address-list address-list=Torrent address-list-timeout=\
1h30m chain=forward comment=" ______Bittorent_____" disabled=no \
layer7-protocol=BITTORENT
add action=reject chain=forward comment="" disabled=no layer7-protocol=\
BITTORENT reject-with=icmp-network-unreachable
add action=add-src-to-address-list address-list="Torrent Announce" \
address-list-timeout=1h30m chain=forward comment=______Announce____ \
disabled=no layer7-protocol=BITTORRENT_ANNOUNCE
add action=reject chain=forward comment="" disabled=no layer7-protocol=\
BITTORRENT_ANNOUNCE reject-with=icmp-network-unreachable
add action=add-src-to-address-list address-list="Torrent udp" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 udp___" \
disabled=no dst-port=6881-6999 protocol=udp
add action=reject chain=forward comment="" disabled=no dst-port=6881-6999 \
protocol=udp reject-with=icmp-network-unreachable
add action=add-src-to-address-list address-list="Torrent tcp" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 tcp___" \
disabled=no dst-port=6881-6999 protocol=tcp
add action=reject chain=forward comment="" disabled=no dst-port=6881-6999 \
protocol=tcp reject-with=icmp-network-unreachable
add action=add-src-to-address-list address-list="Torrent all-p2p" \
address-list-timeout=1h30m chain=forward comment=\
__________All-p2p__________ disabled=no p2p=all-p2p
add action=reject chain=forward comment="" disabled=no p2p=all-p2p \
reject-with=icmp-network-unreachable
add action=drop chain=forward comment=_____1337_____ disabled=no dst-port=\
1337 protocol=udp
add action=drop chain=forward comment="" disabled=no dst-port=1337 \
protocol=tcp
add action=reject chain=forward comment="Torrent cleaning" disabled=no \
dst-port=10000-65500 protocol=tcp reject-with=icmp-network-unreachable \
src-address-list=Torrent src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
Torrent src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent all-p2p" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=udp reject-with=icmp-network-unreachable src-address-list=\
"Torrent all-p2p" src-port=10000-65500
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
Torrent src-port=1000-5000
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent Announce" src-port=1000-5000
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent udp" src-port=1000-5000
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent tcp" src-port=1000-5000
add action=reject chain=forward comment="" disabled=no dst-port=10000-65500 \
protocol=tcp reject-with=icmp-network-unreachable src-address-list=\
"Torrent all-p2p" src-port=1000-5000
add address=203.0.113.111 disabled=no name=dht.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vrpc.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vzrpx020.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=vzapp020.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=client.vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=ip.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=jp.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=torrent-cache.bitcomet.org ttl=15m
add address=203.0.113.111 disabled=no name=inside.bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=router.bitcomet.net ttl=15m
add address=203.0.113.111 disabled=no name=router.bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=router.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=tracker.publicbt.com ttl=15m
add address=203.0.113.111 disabled=no name=utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns1.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns2.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=ns3.utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=istole.it ttl=15m
add address=203.0.113.111 disabled=no name=thepiratebay.org ttl=15m
add address=203.0.113.111 disabled=no name=1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=mininova.org ttl=15m
add address=203.0.113.111 disabled=no name=bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=publicbt.com ttl=15m
add address=203.0.113.111 disabled=no name=openbittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=pow7.com ttl=15m
add address=203.0.113.111 disabled=no name=vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=llnwd.net ttl=15m
add address=203.0.113.111 disabled=no name=ns1.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=ns2.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=genesis.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=exodus.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=nemesis.1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=tracker.openbittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=bittorrent.vo.llnwd.net ttl=15m
add address=203.0.113.111 disabled=no name=apps.bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=10.rarbg.com ttl=15m
add address=203.0.113.111 disabled=no name=ns1.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ns2.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ns3.torrentz.com ttl=15m
add address=203.0.113.111 disabled=no name=ens-**bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).pow7.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).vuze.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).publicbt.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bitcomet.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).utorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).1337x.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).thepiratebay.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).llnwd.net" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).mininova.org" ttl=15m
/ip dns cache flush
/ip firewall nat
add action=dst-nat chain=dstnat comment="Capture p2p DNS" disabled=no \
dst-address=!<ROUTER LAN IP> dst-port=53 protocol=udp \
to-addresses=<ROUTER LAN IP>
add action=dst-nat chain=dstnat comment="Capture p2p DNS" disabled=no \
dst-address=!<ROUTER LAN IP> dst-port=53 protocol=tcp \
to-addresses=<ROUTER LAN IP>
/ip firewall filter
add action=add-src-to-address-list address-list="Torrent DNS" \
address-list-timeout=1h30m chain=forward comment="p2p DNS" disabled=no \
dst-address=203.0.113.111
add action=drop chain=forward comment="" disabled=no dst-address=\
203.0.113.111
Wireless internetOk, I'll try those things and say if helped me...
Where u implemented those config? I see u'r from Serbia, so it's skola, igraona, ili nesto slicno?
Hvala!
/ip firewall layer7-protocol
add comment="" name=torrent-wwws regexp="^.*(get|GET).+(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|torrentz|vertor|h33t|btscene|bitunity|bittoxic|thunderbytes|entertane|zoozle|vcdq|bitnova|bitsoup|meganova|fulldls|btbot|flixflux|seedpeer|fenopy|gpirate|commonbits).*$"
/ip firewall filter
add action=drop chain=forward comment="block torrent wwws" disabled=no layer7-protocol=\
torrent-wwws
/ip firewall layer7-protocol
add comment="" name=torrent-dns regexp="^.+(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|torrentz|vertor|h33t|btscene|bitunity|bittoxic|thunderbytes|entertane|zoozle|vcdq|bitnova|bitsoup|meganova|fulldls|btbot|flixflux|seedpeer|fenopy|gpirate|commonbits).*\$"
/ip firewall filter
add action=drop chain=forward comment="block torrent dns" disabled=no dst-port=53 \
layer7-protocol=torrent-dns protocol=udp
/ip firewall nat
add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=tcp src-address-list=!whitelist to-addresses=<ROUTER LAN IP>
add action=dst-nat chain=dstnat comment="Capture DNS" disabled=no dst-address=!<ROUTER LAN IP> dst-port=53 protocol=udp src-address-list=!whitelist to-addresses=<ROUTER LAN IP>
/ip firewall filter
add action=jump chain=forward comment="P2P DNS block hit" disabled=no dst-address=203.0.113.111 jump-target=p2p_chain
add address=203.0.113.111 disabled=no name=utorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=istole.it ttl=15m
add address=203.0.113.111 disabled=no name=thepiratebay.org ttl=15m
add address=203.0.113.111 disabled=no name=1337x.org ttl=15m
add address=203.0.113.111 disabled=no name=mininova.org ttl=15m
add address=203.0.113.111 disabled=no name=bittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=publicbt.com ttl=15m
add address=203.0.113.111 disabled=no name=openbittorrent.com ttl=15m
add address=203.0.113.111 disabled=no name=pow7.com ttl=15m
add address=203.0.113.111 disabled=no name=vuze.com ttl=15m
add address=203.0.113.111 disabled=no name=bitcomet.com ttl=15m
add address=203.0.113.111 disabled=no name=llnwd.net ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).pow7.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).vuze.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).publicbt.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bitcomet.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).utorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.com" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).bittorrent.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).1337x.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).thepiratebay.org" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).llnwd.net" ttl=15m
add address=203.0.113.111 disabled=no name=".*\\\\(^\\\\|\\\\.\\\\).mininova.org" ttl=15m
/ip dns static
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)utorrent\\.com" ttl=1d
Yes it is DNS that will kill this.EDIT:
DHT: Waiting to log in
The beast is killed... but I'm not cleared with what... is this DNS kill?
Yes that is why you want to keep it to a minimum. Also L7 DNS rules will consume more CPU.Also, this is overkill for me... it's blocking access to those sites completely
/ip firewall nat
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=\
53 protocol=tcp src-address-list=!whitelist to-ports=53
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=\
53 protocol=udp src-address-list=!whitelist to-ports=53
That is easily adjusted by adding in-interface=<filtered interface> or in-interface=!<allowed interface> in the firewall NAT code.CCDKP, I wonder, what if I have a multiple interfaces? Will this work like that or I have to add interface there? Same with that if I want to allow p2p on some interface?
That is because you are blocking WAY too much. you are missing the point of the DNS blacklist and the filter itself.Also, this is overkill for me... it's blocking access to those sites completely
/ip dns static
add address=203.0.113.111 disabled=no name=router.utorrent.com ttl=1d
add address=203.0.113.111 disabled=no name=dht.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vrpc.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vzrpx020.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=vzapp020.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=client.vuze.com ttl=1d
add address=203.0.113.111 disabled=no name=mirror-user1.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=ip.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=jp.bitcomet.com ttl=1d
add address=203.0.113.111 disabled=no name=torrent-cache.bitcomet.org ttl=1d
add address=203.0.113.111 disabled=no name=inside.bitcomet.com ttl=1d
add address=203.0.113.111 disabled=no name=router.bitcomet.net ttl=1d
add address=203.0.113.111 disabled=no name=router.bittorrent.com ttl=1d
The problem is that DHT/uTP is an encrypted channel specifically designed to avoid filters and detection by ISP's. Attacking DNS is currently the only weak point we have been able to identify in that system.We are missing code that blocks new udp announcer from working. We can't be slaves to DNS "definitions".
thepiratebay org has torrents that use udp announcersIf you could provide a link to a working UDP announce torrent, I would be glad to take a look into it and see what I can come up with.
I have not found a good working UDP L7 for that yet.
If anyone can find it please do post that info
There are legal problems here in Germany for prof. services "tolerating" violation of copyrights.Why would it affect other users if you have normal QoS set up? If one guy has 1Mbit, let him use it however he wants, even if it's all 1Mbit with P2P other users will not be affected.
Hi reinerotto,There are legal problems here in Germany for prof. services "tolerating" violation of copyrights.Why would it affect other users if you have normal QoS set up? If one guy has 1Mbit, let him use it however he wants, even if it's all 1Mbit with P2P other users will not be affected.
Or, in other words, the WISP could be held responsible for a user of the hotspot, for example, who downloads copyrighted material, in case, the access to this copyrighted material is not secured as much as possible.
Blocking P2P is one method to make violation of copyrights more difficult.
Not yet implemented. But definitely I will try.Hi reinerotto,There are legal problems here in Germany for prof. services "tolerating" violation of copyrights.Why would it affect other users if you have normal QoS set up? If one guy has 1Mbit, let him use it however he wants, even if it's all 1Mbit with P2P other users will not be affected.
Or, in other words, the WISP could be held responsible for a user of the hotspot, for example, who downloads copyrighted material, in case, the access to this copyrighted material is not secured as much as possible.
Blocking P2P is one method to make violation of copyrights more difficult.
Have you tried my approach? If so is it not working?
/Frank
EDIT: These queues will not restrict BitTorrent Traffic, but will still throttle any traffic picked up by the P2P filter. See my post below for a better explanation.Dear Guys!
I have just tried to configure mikrotik transparent traffic shaping for limit P2P traffic but without success.
I have used TKITFrank configuration to mark P2P traffic then I have created queue tree for limit bandwidth but P2P traffic goes through router without any limit.
Could you check my configuration and tell me where are errors?
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=<max upload> name=upload_root parent=<upstream interface (ether1?)> priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=<max down> name=download_root parent=<downstream interface (etherX?)> priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=128k name=P2P_Down packet-mark=p2p parent=download_root priority=8 queue=pcq_down_p2p
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=1M name=P2P_Up packet-mark=p2p parent=upload_root priority=8 queue=pcq_up_p2p
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=<max upload> name=upload_root parent=<upstream interface (ether1?)> priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=<max down> name=download_root parent=<downstream interface (etherX?)> priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=128k name=P2P_Down packet-mark=p2p_download parent=download_root priority=8 queue=pcq_down_p2p
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=1M name=P2P_Up packet-mark=p2p_upload parent=upload_root priority=8 queue=pcq_up_p2p
/ip firewall mangle
add action=mark-packet chain=prerouting comment=LIMIT_P2P_DROP disabled=no \
new-packet-mark=p2p_upload p2p=all-p2p passthrough=no src-address-list=P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT new-packet-mark=p2p_download p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting disabled=no layer7-protocol=\
BITTORRENT new-packet-mark=p2p_upload passthrough=no src-address-list=P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT layer7-protocol=BITTORRENT new-packet-mark=p2p_download passthrough=no
add action=mark-packet chain=prerouting disabled=no layer7-protocol=\
BITTORRENT_ANNOUNCE new-packet-mark=p2p_upload passthrough=no src-address-list=P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT layer7-protocol=BITTORRENT_ANNOUNCE new-packet-mark=p2p_download passthrough=no
add action=accept chain=prerouting disabled=no passthrough=no src-address-list=!P2P_LIMIT dst-address-list=!P2P_LIMIT
Dear Guys!
I have just tried to configure mikrotik transparent traffic shaping for limit P2P traffic but without success.
I have used TKITFrank configuration to mark P2P traffic then I have created queue tree for limit bandwidth but P2P traffic goes through router without any limit.
Could you check my configuration and tell me where are errors?
/interface bridge
add admin-mac=00:00:00:00:00:00 ageing-time=5m arp=enabled auto-mac=yes \
disabled=no forward-delay=15s l2mtu=1522 max-message-age=20s mtu=1500 \
name=bridge1 priority=0x8000 protocol-mode=none transmit-hold-count=6
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrap\
e\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\
\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 \
max-limit=1M name=download_blacklist_leaf packet-mark=\
blacklist_download_packet parent=download_root priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 \
max-limit=128k name=upload_blacklist_leaf packet-mark=\
blacklist_upload_packet parent=upload_root priority=8
/queue type
set default kind=pfifo name=default pfifo-limit=50
set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50
set wireless-default kind=sfq name=wireless-default sfq-allot=1514 \
sfq-perturb=5
set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \
red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10
set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=\
5
add kind=pcq name=pcq_down_p2p pcq-burst-rate=0 pcq-burst-threshold=0 \
pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 \
pcq-dst-address6-mask=128 pcq-limit=40 pcq-rate=0 pcq-src-address-mask=32 \
pcq-src-address6-mask=128 pcq-total-limit=14000
add kind=pcq name=pcq_up_p2p pcq-burst-rate=0 pcq-burst-threshold=0 \
pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 \
pcq-dst-address6-mask=128 pcq-limit=40 pcq-rate=0 pcq-src-address-mask=32 \
pcq-src-address6-mask=128 pcq-total-limit=14000
set default-small kind=pfifo name=default-small pfifo-limit=10
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=128k name=P2P_Down packet-mark=p2p parent=global-out priority=8 \
queue=pcq_down_p2p
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=1M name=P2P_Up packet-mark=p2p parent=global-in priority=8 \
queue=pcq_up_p2p
/interface bridge port
add bridge=bridge1 disabled=no edge=auto external-fdb=auto horizon=none \
interface=ether2 path-cost=10 point-to-point=auto priority=0x80
add bridge=bridge1 disabled=no edge=auto external-fdb=auto horizon=none \
interface=ether3 path-cost=10 point-to-point=auto priority=0x80
/interface bridge settings
set use-ip-firewall=yes use-ip-firewall-for-pppoe=no \
use-ip-firewall-for-vlan=no
/ip dns static
add address=127.0.0.1 disabled=no name=router.utorrent.com ttl=1d
add address=127.0.0.1 disabled=no name=dht.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vrpc.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzrpx020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=vzapp020.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=client.vuze.com ttl=1d
add address=127.0.0.1 disabled=no name=mirror-user1.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=ip.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=jp.bitcomet.com ttl=1d
add address=127.0.0.1 disabled=no name=torrent-cache.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=no name=inside.bitcomet.com ttl=1d
add address=127.0.0.1 disabled=no name=router.bitcomet.net ttl=1d
add address=127.0.0.1 disabled=no name=router.bittorrent.com ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)utorrent\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)vuze\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.org" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.com" ttl=1d
add address=127.0.0.1 disabled=no name=".*\\(^\\|\\.\\)bitcomet\\.net" ttl=1d
/ip firewall address-list
add address=193.238.77.80 disabled=no list=P2P_LIMIT
/ip firewall connection tracking
set enabled=yes generic-timeout=10m icmp-timeout=10s tcp-close-timeout=10s \
tcp-close-wait-timeout=10s tcp-established-timeout=1d \
tcp-fin-wait-timeout=10s tcp-last-ack-timeout=10s \
tcp-syn-received-timeout=5s tcp-syn-sent-timeout=5s tcp-syncookie=no \
tcp-time-wait-timeout=10s udp-stream-timeout=3m udp-timeout=10s
/ip firewall mangle
add action=mark-packet chain=prerouting comment=LIMIT_P2P_DROP disabled=no \
new-packet-mark=p2p p2p=all-p2p passthrough=no src-address-list=P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT new-packet-mark=p2p p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting disabled=no layer7-protocol=\
BITTORRENT new-packet-mark=p2p passthrough=no src-address-list=P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT layer7-protocol=BITTORRENT new-packet-mark=p2p passthrough=no
add action=mark-packet chain=prerouting disabled=no layer7-protocol=\
BITTORRENT_ANNOUNCE new-packet-mark=p2p passthrough=no src-address-list=\
P2P_LIMIT
add action=mark-packet chain=postrouting disabled=no dst-address-list=\
P2P_LIMIT layer7-protocol=BITTORRENT_ANNOUNCE new-packet-mark=p2p \
passthrough=no
Thanks in advance
Best regards
Dear Guys!
I have just tried to configure mikrotik transparent traffic shaping for limit P2P traffic but without success.
I have used TKITFrank configuration to mark P2P traffic then I have created queue tree for limit bandwidth but P2P traffic goes through router without any limit.
Could you check my configuration and tell me where are errors?
After reading TKITFrank's note, I realized I made a big blunder. I got a little wrapped up in fixing the Queue's, I didn't think about the end goal of the project. The QoS Example I helped with above will not shape bittorrent traffic.Just a note... don't use the DNS entries if you just want to traffic shape. They will ONLY block.
/ip firewall layer7-protocol
add comment="" name=bittorrent regexp="^(\\x13bittorrent protocol|azver\\x01\$\
|get /scrape\\\?info_hash=get /announce\\\?info_hash=|get /client/bitcomet\
/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
\x13bittorrent protocol
azver\x01$
get /scrape\?info_hash=get /announce\?info_hash=
get /client/bitcomet/
GET /data\?fid=
d1:ad2:id20:
\x08'7P\)[RP]
/ip firewall layer7-protocol
add comment="" name=bittorrent regexp="^(\\x13bittorrent protocol|azver\\x01\$\
|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet\
/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add comment="" name=BITTORRENT_SCRAPE regexp=^get.+scrape.
You shouldn't need a separate scrape rule anymore, either. If you look at the original rule that was screwed up:Hi guys... I'm back
CCDKP, I replaced that rule and so far it's possibly brought some change. At least, less false positive hits and I've seen much less hits on ports 6881-6999 so I guess you are on a right track but I tested it for a short period of time. However, it looks like a correct change. I'm also keeping BITTORRENT_ANNOUNCE part for compare.I've also added this rule some time ago because no one considered tracker scrapping.Code: Select alladd comment="" name=BITTORRENT_SCRAPE regexp=^get.+scrape.
get /scrape\?info_hash=get /announce\?info_hash=
get /scrape\?info_hash=
get /announce\?info_hash=
/ip firewall mangle
add action=mark-packet chain=prerouting comment=\
"_____________P2P - Upload_______________" disabled=no dst-port=10000-65535 \
new-packet-mark=P2P passthrough=yes protocol=tcp src-address=xx.xx.xx.xx \
src-port=10000-65535
add action=mark-packet chain=prerouting disabled=no dst-port=10000-65535 \
new-packet-mark=P2P passthrough=yes protocol=udp src-address=xx.xx.xx.xx \
src-port=10000-65535
add action=mark-packet chain=prerouting disabled=no dst-port=10000-65535 \
new-packet-mark=P2P passthrough=yes protocol=tcp src-address=xx.xx.xx.xx \
src-port=1000-5000
add action=mark-packet chain=prerouting comment="Other - Upload" disabled=no \
new-packet-mark=Other passthrough=yes src-address=xx.xx.xx.xx
add action=mark-connection chain=prerouting comment=\
"_____________P2P - Download_____________" disabled=no new-connection-mark=\
P2P p2p=all-p2p passthrough=no src-address=xx.xx.xx.xx
add action=mark-connection chain=prerouting disabled=no layer7-protocol=\
BITTORRENT new-connection-mark=P2P passthrough=no src-address=xx.xx.xx.xx
add action=mark-connection chain=prerouting disabled=no dst-port=10000-65535 \
new-connection-mark=P2P passthrough=no protocol=tcp src-address=\
xx.xx.xx.xx src-port=10000-65535
add action=mark-connection chain=prerouting disabled=no dst-port=10000-65535 \
new-connection-mark=P2P passthrough=no protocol=udp src-address=\
xx.xx.xx.xx src-port=10000-65535
add action=mark-connection chain=prerouting disabled=no dst-port=10000-65535 \
new-connection-mark=P2P passthrough=no protocol=tcp src-address=\
xx.xx.xx.xx src-port=1000-5000
add action=mark-connection chain=prerouting disabled=no dst-port=6881-6999 \
new-connection-mark=P2P passthrough=no protocol=udp src-address=\
xx.xx.xx.xx
add action=mark-connection chain=prerouting disabled=no dst-port=6881-6999 \
new-connection-mark=P2P passthrough=no protocol=tcp src-address=\
xx.xx.xx.xx
add action=mark-packet chain=prerouting connection-mark=P2P disabled=no \
new-packet-mark=P2P passthrough=no
add action=mark-connection chain=prerouting comment=\
"____________Other - Download____________" disabled=no \
new-connection-mark=Other passthrough=no src-address=xx.xx.xx.xx
add action=mark-packet chain=prerouting connection-mark=Other disabled=no \
new-packet-mark=Other passthrough=no
A couple things to note:Yes... thanks for that one
And for queue tree for P2P catch I used this because I could not manage this to work otherwise... So, it's working on me... don't ask how and why
I've striped everything but P2P. If you guys find some other less stupid way THAT WORK to capture this, please let me know.
add action=drop chain=forward connection-limit=16,32 disabled=no dst-port=!53 protocol=udp
In 5.7 they finally added the ability to use connection-limit to track UDP streams. I am still doing some testing, but initially it looks promising.This limits each IP to 16 non-DNS UDP streams. 16 should be enough that skype and other non-p2p applications shouldn't get impacted, but you may need to tweak them for your network.Code: Select alladd action=drop chain=forward connection-limit=16,32 disabled=no dst-port=!53 protocol=tcp
Again, it's not a magic bullet, but it can help when combined with various other methods described within this post.
/ip firewall layer7-protocol
add name=Skype regexp="^..\\x02............."
/ip firewall filter
add action=accept chain=forward disabled=no layer7-protocol=Skype
add action=accept chain=forward disabled=no dst-port=53 protocol=udp
add action=drop chain=forward connection-limit=16,32 disabled=no protocol=udp
I just set the UDP to something reasonable. I haven't seen skype hold open more than 8-9 simultaneous udp streams on a group call. I don't like relying on L7 filters for whitelisting, because if skype changes the signature then everything starts getting blocked. I prefer to "fail open" and let p2p traffic through, since I will see a spike in bandwidth and know to go fix it.Yes, it looks very promising. Router on my link is upgraded to 5.7 so testing is started on myself and unadjusted torrent client. Perhaps allow skype through L7 before dropping udp.
...
Also, adding udp line with connection limit is possible only through terminal, not over winbox since connection limit gets grey. So, is this some kind of bug?
add action=drop chain=forward connection-limit=16,32 disabled=no dst-port=!53 protocol=udp
In 5.7 they finally added the ability to use connection-limit to track UDP streams. I am still doing some testing, but initially it looks promising.This limits each IP to 16 non-DNS UDP streams. 16 should be enough that skype and other non-p2p applications shouldn't get impacted, but you may need to tweak them for your network.Code: Select alladd action=drop chain=forward connection-limit=16,32 disabled=no dst-port=!53 protocol=udp
Again, it's not a magic bullet, but it can help when combined with various other methods described within this post.
Edit: Corrected typo, Thanks mves
Bittorrent can use both TCP and UDP connections. Connection limiting on TCP is a bit touchier since so many things rely on it. The point of restricting the number of UDP connections isn't to completely kill Bittorrent, nothing can. The point of it is to move more connections over into TCP where they can be managed a little easier.and did small test with bit torrent and its getting much more them limit
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrap\
e\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /dat\
a\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
/ip firewall filter
add action=accept chain=forward comment=Skype disabled=no dst-port=12350 \
protocol=tcp
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (UDP)" disabled=no dst-port=\
27000-27050,28960 protocol=udp
add action=accept chain=forward comment=\
"Online games - CS, COD, Steam server (TCP)" disabled=no dst-port=\
27000-27050,28960 protocol=tcp
add action=accept chain=forward comment=\
"Online Igre - Battlefield : Bad Company 2" disabled=no dst-port=\
11050-11070,18181-18186,19567-19587 protocol=udp
add action=accept chain=forward comment=\
"Online Igre - Battlefield : Bad Company 2" disabled=no dst-port=\
13505,18390,18395 protocol=tcp
add action=add-src-to-address-list address-list=Torrent address-list-timeout=\
1h30m chain=forward comment=__________All-p2p__________ disabled=no \
in-interface=XXXXXXXXXX p2p=all-p2p src-address=\
xx.xx.xx.xx-xx.xx.xx.xx time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no in-interface=XXXXXXXXXX p2p=\
all-p2p reject-with=icmp-network-unreachable src-address=\
xx.xx.xx.xx-xx.xx.xx.xx time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list=Torrent address-list-timeout=\
1h30m chain=forward comment=" ______Bittorrent_____" disabled=no \
in-interface=XXXXXXXXXX layer7-protocol=BITTORRENT src-address=\
xx.xx.xx.xx-xx.xx.xx.xx time=9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no in-interface=XXXXXXXXXX \
layer7-protocol=BITTORRENT reject-with=icmp-network-unreachable \
src-address=xx.xx.xx.xx-xx.xx.xx.xx time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent 6881" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 udp___" \
disabled=no dst-port=6881-6999 in-interface=XXXXXXXXXX protocol=udp \
src-address=xx.xx.xx.xx-xx.xx.xx.xx time=\
9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=6881-6999 in-interface=\
cortanovci protocol=udp reject-with=icmp-network-unreachable src-address=\
xx.xx.xx.xx-xx.xx.xx.xx time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=add-src-to-address-list address-list="Torrent 6881" \
address-list-timeout=1h30m chain=forward comment="____6881-6999 tcp___" \
disabled=no dst-port=6881-6999 in-interface=XXXXXXXXXX protocol=tcp \
src-address=xx.xx.xx.xx-xx.xx.xx.xx time=\
9h-23h55m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=6881-6999 in-interface=\
cortanovci protocol=tcp reject-with=icmp-network-unreachable src-address=\
xx.xx.xx.xx-xx.xx.xx.xx time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward comment="House cleaning" disabled=no \
dst-port=10000-65500 protocol=tcp reject-with=icmp-network-unreachable \
src-address-list=Torrent src-port=10000-65500 time=\
9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=10000-65500 protocol=udp \
reject-with=icmp-network-unreachable src-address-list=Torrent src-port=\
10000-65500 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=10000-65500 protocol=tcp \
reject-with=icmp-network-unreachable src-address-list=Torrent src-port=\
1000-5000 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=10000-65500 protocol=tcp \
reject-with=icmp-network-unreachable src-address-list="Torrent 6881" \
src-port=10000-65500 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=10000-65500 protocol=udp \
reject-with=icmp-network-unreachable src-address-list="Torrent 6881" \
src-port=10000-65500 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
add action=reject chain=forward disabled=no dst-port=10000-65500 protocol=tcp \
reject-with=icmp-network-unreachable src-address-list="Torrent 6881" \
src-port=1000-5000 time=9h-23h59m,sun,mon,tue,wed,thu,fri,sat
/ip firewall filter
add action=accept chain=forward disabled=yes dst-port=53 protocol=udp
add action=drop chain=forward connection-limit=16,32 disabled=yes dst-port=10000-65500 protocol=tcp src-address-list=Torrent
add action=drop chain=forward connection-limit=16,32 disabled=yes protocol=udp src-address-list=Torrent
add action=drop chain=forward connection-limit=16,32 disabled=yes dst-port=10000-65500 protocol=tcp src-address-list="Torrent 6881"
add action=drop chain=forward connection-limit=16,32 disabled=yes protocol=udp src-address-list="Torrent 6881"
[otgonkhuu@MOBINET] /ip firewall mangle export
#RouterOS P2P matcher and L7-filters can`t block torrent client, which supports encryption.
#But it can catch even 1 connection. So source addresses of those connections are the TORRENTUSERS.
#The advantage is it can list my office torrent trackers also it can list peers of external network.
#TorrentExc is my address list of allowed torrent trackers. It is exclusion list.
add action=add-src-to-address-list address-list=TorrentUsers \
address-list-timeout=10m chain=forward comment=\
"Add Bit torrent announcer to TorrentUsers" disabled=no layer7-protocol=\
BITTORRENT_ANNOUNCE src-address-list=!TorrentExc
add action=add-src-to-address-list address-list=TorrentUsers \
address-list-timeout=10m chain=forward comment=\
"Add Bit torrenter to TorrentUsers" disabled=no layer7-protocol=BITTORENT \
src-address-list=!TorrentExc
add action=add-src-to-address-list address-list=TorrentUsers \
address-list-timeout=10m chain=forward comment=\
"Add all torrenter to TorrentUsers" disabled=no p2p=all-p2p \
src-address-list=!TorrentExc
#This is the all connections, which are might be torrent traffics.
add action=mark-connection chain=prerouting disabled=no dst-port=10000-65000 \
new-connection-mark=Torr passthrough=yes protocol=tcp \
src-port=10000-65000
add action=mark-connection chain=prerouting disabled=no dst-port=10000-65000 \
new-connection-mark=Torr passthrough=yes protocol=udp \
src-port=10000-65000
add action=mark-connection chain=prerouting comment=P2P disabled=no \
new-connection-mark=Torr p2p=all-p2p passthrough=yes src-address-list=\
!TorrentExc
[otgonkhuu@MOBINET] > ip firewall filter export
#Filter rule drops all high port peer to peer connections sourced from address list "TorrentUsers"
add action=drop chain=forward comment="Block P2P-Manual" connection-mark=Torr \
disabled=no dst-address-list=!TorrentExc src-address-list=TorrentUsers
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrap\
e\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /dat\
a\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrap\
e\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /dat\
a\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
Could you get me an example of websites this blocks or captures of traffic it is flagging on? After fixing it, I have had an EXTREMELY low false-positive rate. Again, this is only for flagging tracker and peer exchange traffic, not data transfer. If there is a case for false positives, I would really like to be on top of it and see if we can tune the rules down better to clear it up.I've found that method also blocks users HTTP traffic and various other applications so its not 100% reliable,as stated previously policy based routing is currently the best way of doing it
no problemo amigo,i will build up a list tonight and post in the morningCould you get me an example of websites this blocks or captures of traffic it is flagging on? After fixing it, I have had an EXTREMELY low false-positive rate. Again, this is only for flagging tracker and peer exchange traffic, not data transfer. If there is a case for false positives, I would really like to be on top of it and see if we can tune the rules down better to clear it up.I've found that method also blocks users HTTP traffic and various other applications so its not 100% reliable,as stated previously policy based routing is currently the best way of doing it
It's good to hear you aren't seeing any false positives. If something comes up, please let me know.Ok so i have been running that filter rule overnight and this time i havn't had issues with sites being blocked but it doesn't dent p2p,still runs at full speed
Does the throttle effect all connections or just the p2p connections?Yeah a while ago i added a bunch of dns addresses of the common trackers which just points to a loopback IP,sometimes i have luck with that and other times not,its a hit or miss sometimes with p2p.Quite some time ago i created rules whereby if a user is downloading p2p at certain rates for a certain period of time it adds them to a p2p address list which i throttle quite badly and after 5 or 10 minutes it removes them from the address list.This seemed to work quite well but since then i have upgraded bandwidth,so i dont have contention issues.Until such time i'll let the suckers have their full line speed.
As i stated above i still firmly believe in policy based routing,create one gateway which is the primary and a secondary gateway which you route important traffic through such as mail and http etc and let torrents fight each-other through the primary gateway
:local temp;
:local temp2;
:local temp3;
:foreach i in=[/ip firewall connection find p2p!="none"] do={
:set temp3 [/ip firewall connection get $i src-address];
:set temp2 [:find $temp3 ":" -1];
:set temp3 [:pick $temp3 0 $temp2];
:foreach j in=[/ppp active find address=$temp3] do={
/ppp active remove $j;
}
}
Hi,TKITFrank, did you try your rules with the last version of utorrent client(3.0 and above).Asking about it, because you rules, posted earlier in this topic, seems to work for me. But now, with the last version of utorrent, they don't. Neither with ssl encryption turned on or off.
May be you can tell me, where to do it?Try to block clients from using "multicast peer communication" Unless you use Multicast in your network for video and so on it could be a good idea to block it.
Perhaps this will help.
You are right. Ok, I disabled bittorrent_announce now (btw, can you explain in detail, what does this rule do, and why does yahoo start page correspond to it?), but it seems like nothing is changed.You don't need the "bittorrent_announce" rule as it is covered by the "Bittorrent" rule. Anything the Announce rule is flagging is a false positive (yahoo.com's front page will get flagged).
All clients in my network uses mikrotik DNS as their primary and the only one DNS server. They can not change it (have no permissions). Also, I have a rule in Mikrotik, that deny all DNS traffic going through the router (so, no other server can be used).Also, do you have rules to redirect all DNS traffic to the mikrotik? If you don't, a client can just use their own DNS server (google, opendns, etc) and bypass the filter.
The two biggest flags for bittorrent are the scrape and announce commands sent to the trackers. For a long while, the Bittorrent rule on the wiki that everyone used had a typo in it that disabled it's ability to detect scrapes and announces. This lead to someone (TKITFrank?) making the bittorrent_announce rule to capture them.Ok, I disabled bittorrent_announce now (btw, can you explain in detail, what does this rule do, and why does yahoo start page correspond to it?), but it seems like nothing is changed.
get /announce\?info_hash=
add name=BITTORRENT_ANNOUNCE regexp=^get.+announce.
First, remember that DNS can use TCP in addition to UDP. Any response over 512 bytes requires TCP to be used. With DNS Sec, DNS over TCP is becoming more common.ll clients in my network uses mikrotik DNS as their primary and the only one DNS server. They can not change it (have no permissions). Also, I have a rule in Mikrotik, that deny all DNS traffic going through the router (so, no other server can be used).
/ip firewall nat
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=53 protocol=udp to-ports=53
add action=redirect chain=dstnat comment="Capture DNS" disabled=no dst-port=53 protocol=tcp to-ports=53
Not Working. Can't catch announce.So to summarize, both of the existing Bittorrent and Bittorrent_announce L7 filters should be removed in favor of:--@CC_DKPCode: Select all/ip firewall layer7-protocol add comment="" name=bittorrent regexp="^(\\x13bittorrent protocol|azver\\x01\$\ |get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet\ /|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
Could you please provide a link to the torrent file & what tracker was used, or a packet capture of the announces not getting flagged so I can work on getting the filter updated? My understanding is there is a new wave of encrypted UDP and HTTPS encrypted trackers, which this rule will not be able to catch, but if this is the case I would still like to look at the traffic and see if we can find *something*.Not Working. Can't catch announce.So to summarize, both of the existing Bittorrent and Bittorrent_announce L7 filters should be removed in favor of:--@CC_DKPCode: Select all/ip firewall layer7-protocol add comment="" name=bittorrent regexp="^(\\x13bittorrent protocol|azver\\x01\$\ |get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet\ /|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
^get.+announce\?info
/ip firewall mangle
add action=jump chain=prerouting comment="Common P2P-Blocking" disabled=no dst-address-list=!dns-externt jump-target=p2p-service p2p=all-p2p
add action=jump chain=prerouting disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=BITTORRENT
add action=jump chain=prerouting disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=BITTORRENT_DHT
add action=jump chain=prerouting disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=DIRECTCONNECT
add action=jump chain=prerouting disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=GNUTELLA
add action=mark-connection chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 new-connection-mark=suspicious packet-size=62-500 passthrough=no protocol=udp src-port=!53
add action=mark-connection chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=10000-65535 new-connection-mark=suspicious packet-size=100-500 passthrough=no protocol=tcp src-port=1024-65535 tcp-flags=psh,ack
add action=jump chain=prerouting connection-state=new disabled=no dst-port=443 jump-target=tcp-services protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no dst-address-list=!dns-externt dst-port=!443 jump-target=p2p-service layer7-protocol=HTTPS protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=tcp-services protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=udp-services protocol=udp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=other-services
add action=mark-connection chain=p2p-service disabled=no new-connection-mark=p2p passthrough=no
/ip firewall filter
add action=add-src-to-address-list address-list=p2p-users address-list-timeout=10m chain=forward comment="Drop and log all P2P" connection-mark=p2p disabled=no src-address-list=local-addr
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=forward connection-mark=suspicious disabled=no src-address-list=local-addr
add action=log chain=forward connection-mark=p2p disabled=no log-prefix=P2P src-address-list=local-addr
add action=jump chain=forward connection-mark=p2p disabled=no jump-target=drop src-address-list=local-addr
add action=jump chain=forward disabled=no dst-address-list=p2p-users-ext jump-target=drop src-address-list=p2p-users
add action=jump chain=forward disabled=no dst-address-list=p2p-users jump-target=drop src-address-list=p2p-users-ext
/ip firewall layer7-protocol
add name=HTTPS regexp="^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)"
add name=GNUTELLA regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella connect/[012]\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get\
\_/.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*co\
ntent-type: application/x-gnutella|...................\?lime)"
add name=DIRECTCONNECT regexp="^(\\\$mynick |\\\$lock |\\\$key )"
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
add name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
# jan/02/1970 00:02:47 by RouterOS 5.12
# software id = 8952-JWTY
#
/interface bridge
add l2mtu=1520 name=bridge1
/interface ethernet
set 0 name=Eth1_WAN
set 1 name=Eth2_LAN
set 2 name=Eth3
set 3 name=Eth4
set 4 name=Eth5
/ip firewall layer7-protocol
add name=HTTPS regexp=\
"^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)"
add name=GNUTELLA regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella connect/[012]\
\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-agent: (gtk-gnu\
tella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get /.*content-ty\
pe: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-\
9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[\
0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*content-type: application/x-gnut\
ella|...................\?lime)"
add name=DIRECTCONNECT regexp="^(\\\$mynick |\\\$lock |\\\$key )"
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\
\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\
\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
add name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
/queue tree
add max-limit=1M name=IN parent=global-in
add max-limit=1M name=OUT parent=global-out
add max-limit=10k name=p2p_in packet-mark=P2P_PacketMark parent=IN
add max-limit=10k name=p2p_out packet-mark=P2P_PacketMark parent=OUT
/interface bridge port
add bridge=bridge1 interface=Eth1_WAN
add bridge=bridge1 interface=Eth2_LAN
/interface bridge settings
set use-ip-firewall=yes
/ip dhcp-client
add disabled=no interface=bridge1
/ip dns
set max-udp-packet-size=512 servers=192.168.19.1,195.67.199.24
/ip firewall filter
add action=add-src-to-address-list address-list=p2p-users address-list-timeout=\
10m chain=forward comment="Drop and log all P2P" connection-mark=p2p \
src-address-list=local-addr
add action=add-dst-to-address-list address-list=p2p-users-ext \
address-list-timeout=10m chain=forward connection-mark=suspicious \
src-address-list=local-addr
add action=log chain=forward connection-mark=p2p log-prefix=P2P \
src-address-list=local-addr
add action=jump chain=forward connection-mark=p2p jump-target=drop \
src-address-list=local-addr
add action=jump chain=forward dst-address-list=p2p-users-ext jump-target=drop \
src-address-list=p2p-users
add action=jump chain=forward dst-address-list=p2p-users jump-target=drop \
src-address-list=p2p-users-ext
/ip firewall mangle
add action=jump chain=prerouting comment="Common P2P-Blocking" \
dst-address-list=!dns-externt jump-target=p2p-service p2p=all-p2p
add action=jump chain=prerouting dst-address-list=!dns-externt jump-target=\
p2p-service layer7-protocol=BITTORRENT
add action=jump chain=prerouting dst-address-list=!dns-externt jump-target=\
p2p-service layer7-protocol=BITTORRENT_DHT
add action=jump chain=prerouting dst-address-list=!dns-externt jump-target=\
p2p-service layer7-protocol=DIRECTCONNECT
add action=jump chain=prerouting dst-address-list=!dns-externt jump-target=\
p2p-service layer7-protocol=GNUTELLA
add action=mark-connection chain=prerouting comment="UDP-Bittorrent blocking" \
dst-address-list=!dns-externt dst-port=1024-65535 new-connection-mark=\
suspicious packet-size=62-500 passthrough=no protocol=udp src-port=!53
add action=mark-connection chain=prerouting comment="TCP-Tracker blocking" \
connection-type=!ftp dst-address-list=!dns-externt dst-port=10000-65535 \
new-connection-mark=suspicious packet-size=100-500 passthrough=no protocol=\
tcp src-port=1024-65535
add action=jump chain=prerouting connection-state=new dst-port=443 jump-target=\
tcp-services protocol=tcp
add action=jump chain=prerouting connection-state=new dst-address-list=\
!dns-externt dst-port=!443 jump-target=p2p-service layer7-protocol=HTTPS \
protocol=tcp
add action=jump chain=prerouting connection-state=new jump-target=tcp-services \
protocol=tcp
add action=jump chain=prerouting connection-state=new jump-target=udp-services \
protocol=udp
add action=jump chain=prerouting connection-state=new jump-target=\
other-services
add action=mark-connection chain=p2p-service new-connection-mark=p2p \
passthrough=no
add action=mark-packet chain=postrouting connection-mark=p2p new-packet-mark=\
P2P_PacketMark
/ip smb shares
set [ find default=yes ] directory=/pub
/queue interface
set Eth1_WAN queue=ethernet-default
set Eth2_LAN queue=ethernet-default
set Eth3 queue=ethernet-default
set Eth4 queue=ethernet-default
set Eth5 queue=ethernet-default
That is correct. The "Encrypt" option in a torrent client only covers client to client communications. The L7 filter is designed to prevent tracker communication, while the DNS is designed to prevent DHT/UTP from bootstrapping. With these methods blocked, the clients never learn about other clients, so in theory we don't have to worry about inter-client communication being encrypted.CCDKP, do I understand right, these rules above work with encrypted option in torrent client enforced too? I suppose, their blocking effect comes at announce blocking level (where we use dns block) and doesn't depend on all other options?
TKITFrank : I think you have a typo in the last 2 line of the L7 rules. E.g. you have:Code: Select all/ip firewall layer7-protocol add name=HTTPS regexp="^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)" add name=GNUTELLA regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella connect/[012]\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get\ \_/.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*co\ ntent-type: application/x-gnutella|...................\?lime)" add name=DIRECTCONNECT regexp="^(\\\$mynick |\\\$lock |\\\$key )" add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]" add name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
add name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
add name=BITTORRENT_DHT regexp="^d1\\:ad2\\:id20\\:"
No the line is correct. I have found that the "A" sometimes becomes a "R". So to be sure I have made it a wildcard. I have also made the DHT rule merge in to the BITTORRENT rule. They seem to overlap.TKITFrank : I think you have a typo in the last 2 line of the L7 rules. E.g. you have:Code: Select all/ip firewall layer7-protocol add name=HTTPS regexp="^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)" add name=GNUTELLA regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella connect/[012]\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get\ \_/.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*co\ ntent-type: application/x-gnutella|...................\?lime)" add name=DIRECTCONNECT regexp="^(\\\$mynick |\\\$lock |\\\$key )" add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]" add name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
Should it not be that the "." is an "a" on those two lines?Code: Select alladd name=BITTORRENT_DHT regexp="^d1\\:.d2\\:id20\\:"
Also, what is in your dns-externt address-list?Code: Select alladd name=BITTORRENT_DHT regexp="^d1\\:ad2\\:id20\\:"
/ip firewall mangle
add action=jump chain=prerouting comment="Common P2P-Blocking" disabled=no dst-address-list=!dns-externt jump-target=p2p-service p2p=all-p2p
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=BITTORRENT
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=DIRECTCONNECT
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=GNUTELLA
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=p2p-users src-port=!53
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack
add action=add-src-to-address-list address-list=p2p-users address-list-timeout=2m chain=p2p-service comment="" disabled=no src-address-list=local-addr
add action=mark-connection chain=p2p-service comment="" disabled=no new-connection-mark=p2p passthrough=no
/ip firewall filter
add action=jump chain=forward comment="" connection-mark=p2p disabled=no jump-target=drop
add action=jump chain=forward comment="" disabled=no dst-address-list=p2p-users-ext jump-target=drop-no-log src-address-list=p2p-users
add action=jump chain=forward comment="" disabled=no dst-address-list=p2p-users jump-target=drop-no-log src-address-list=p2p-users-ext
Hi,TKITFrank,
While testing out some of the new rules, I hit a very interesting discovery. uTorrent 3.0 will try to established UTP connections over Teredo IPv6 tunnels, which are on by default on Windows Vista & Windows 7. If you fire up a decent sized torrent on a Windows 7 machine and look under "peers" you may notices some valid IPv6 peers show up.
Due to the Teredo encapsulation, the DHT rules had a difficult time flagging those connections. If you look at logs or packet captures, look for traffic destined for UDP 3544.
/ip dns static
add address=127.0.0.1 disabled=yes name=router.utorrent.com ttl=1d
add address=127.0.0.1 disabled=yes name=dht.vuze.com ttl=1d
add address=127.0.0.1 disabled=yes name=vrpc.vuze.com ttl=1d
add address=127.0.0.1 disabled=yes name=vzrpx020.vuze.com ttl=1d
add address=127.0.0.1 disabled=yes name=vzapp020.vuze.com ttl=1d
add address=127.0.0.1 disabled=yes name=client.vuze.com ttl=1d
add address=127.0.0.1 disabled=yes name=mirror-user1.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=yes name=ip.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=yes name=jp.bitcomet.com ttl=1d
add address=127.0.0.1 disabled=yes name=torrent-cache.bitcomet.org ttl=1d
add address=127.0.0.1 disabled=yes name=inside.bitcomet.com ttl=1d
add address=127.0.0.2 disabled=yes name=router.bitcomet.net ttl=1d
/ip firewall layer7-protocol
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
add name=GNUTELLA regexp="^(gnd[\\x01\\x02]\?.\?.\?\\x01|gnutella connect/[012]\\.[0-9]\\x0d\\x0a|get /uri-res/n2r\\\?urn:sha1:|get /.*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get\
\_/.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?\\.[1-9][0-9]\?[0-9]\?:[1-9][0-9]\?[0-9]\?[0-9]\?|gnutella.*co\
ntent-type: application/x-gnutella|...................\?lime)"
add name=DIRECTCONNECT regexp="^(\\\$mynick |\\\$lock |\\\$key )"
add name=HTTPS regexp="^(.\?.\?\\x16\\x03.*\\x16\\x03|.\?.\?\\x01\\x03\\x01\?.*\\x0b)"
/ip firewall address-list
add address=xxx.xxx.xxx.xxx comment=DNS-servers disabled=no list=dns-externt
add address=xxx.xxx.xxx.xxx disabled=no list=dns-externt
add address=78.31.0.0/16 comment=Spotify disabled=no list=spotify
add address=xxx.xxx.xxx.xxx disabled=no list=local-addr
/ip firewall mangle
add action=jump chain=prerouting comment="Common P2P-Blocking" disabled=no dst-address-list=!dns-externt jump-target=p2p-service p2p=all-p2p
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=BITTORRENT
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=DIRECTCONNECT
add action=jump chain=prerouting comment="" disabled=no dst-address-list=!dns-externt jump-target=p2p-service layer7-protocol=GNUTELLA
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\
62-500 protocol=udp src-address-list=p2p-users src-port=!53
add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\
!dns-externt src-port=!53
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\
1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack
add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \
src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
add action=jump chain=prerouting connection-state=new disabled=no dst-port=443 jump-target=tcp-services protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no dst-address-list=!dns-externt dst-port=!443 jump-target=p2p-service layer7-protocol=HTTPS protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=tcp-services protocol=tcp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=udp-services protocol=udp
add action=jump chain=prerouting connection-state=new disabled=no jump-target=other-services
add action=add-src-to-address-list address-list=p2p-users address-list-timeout=2m chain=p2p-service disabled=no src-address-list=local-addr
add action=mark-connection chain=p2p-service disabled=no new-connection-mark=p2p passthrough=no
add action=mark-connection chain=tcp-services disabled=no dst-port=20-21 new-connection-mark=ftp passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=22 new-connection-mark=ssh passthrough=no protocol=tcp src-port=513-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=23 new-connection-mark=telnet passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=25 new-connection-mark=smtp passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=53 new-connection-mark=dns passthrough=no protocol=tcp src-port=53
add action=mark-connection chain=tcp-services disabled=no dst-port=53 new-connection-mark=dns passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=80 new-connection-mark=http passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=110 new-connection-mark=pop3 passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=113 new-connection-mark=auth passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=119 new-connection-mark=nntp passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=137-139 new-connection-mark=netbios passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=143 new-connection-mark=imap passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=161-162 new-connection-mark=snmp passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-address-list=spotify dst-port=443 new-connection-mark=spotify passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-address-list=!spotify dst-port=443 new-connection-mark=https passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=445 new-connection-mark=ms-ds passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=465 new-connection-mark=smtps passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=990 new-connection-mark=ftps passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=993 new-connection-mark=imaps passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=995 new-connection-mark=pop3s passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=1080 new-connection-mark=socks passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=1723 new-connection-mark=pptp passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=1863 new-connection-mark=msn passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=2379 new-connection-mark=kgs passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=3128 new-connection-mark=squid-proxy passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=3389 new-connection-mark=win-ts passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=3845 new-connection-mark=smartpass passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=4070 new-connection-mark=spotify passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=2000-3000 new-connection-mark=bwtest passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=4242-4243 new-connection-mark=emule passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=1024-65535 new-connection-mark=overnet passthrough=no protocol=tcp src-port=4661-4662
add action=mark-connection chain=tcp-services disabled=no dst-port=1024-65535 new-connection-mark=emule passthrough=no protocol=tcp src-port=4711
add action=mark-connection chain=tcp-services disabled=no dst-port=5900-5901 new-connection-mark=vnc passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=6667-6669 new-connection-mark=irc passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=8080 new-connection-mark=http-proxy passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=8291 new-connection-mark=winbox passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=42041-42052 new-connection-mark=voddler passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no dst-port=55536-55663 new-connection-mark=ftp-passive passthrough=no protocol=tcp src-port=1024-65535
add action=mark-connection chain=tcp-services disabled=no new-connection-mark=other-tcp passthrough=no protocol=tcp
add action=mark-connection chain=udp-services disabled=no dst-port=53 new-connection-mark=dns passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=67 new-connection-mark=dhcp passthrough=no protocol=udp src-port=67-68
add action=mark-connection chain=udp-services disabled=no dst-port=123 new-connection-mark=ntp passthrough=no protocol=udp src-port=123
add action=mark-connection chain=udp-services disabled=no dst-port=123 new-connection-mark=ntp passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=137-139 new-connection-mark=netbios passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=161-162 new-connection-mark=snmp passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=514 new-connection-mark=syslog passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=1701 new-connection-mark=l2tp passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=3544 new-connection-mark=ms-ipv6 passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=4665 new-connection-mark=emule passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=4672 new-connection-mark=emule passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=2000-3000 new-connection-mark=bwtest passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=1024-65535 new-connection-mark=emule passthrough=no protocol=udp src-port=4672
add action=mark-connection chain=udp-services disabled=no dst-port=12053 new-connection-mark=overnet passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=20561 new-connection-mark=mac-winbox passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=42041-42052 new-connection-mark=voddler passthrough=no protocol=udp src-port=1024-65535
add action=mark-connection chain=udp-services disabled=no dst-port=1024-65535 new-connection-mark=overnet passthrough=no protocol=udp src-port=12053
add action=mark-connection chain=udp-services disabled=no dst-port=1024-65535 new-connection-mark=skype passthrough=no protocol=udp src-port=36725
add action=mark-connection chain=udp-services disabled=no new-connection-mark=other-udp passthrough=no protocol=udp
add action=mark-connection chain=other-services disabled=no icmp-options=8:0-255 new-connection-mark=ping passthrough=no protocol=icmp
add action=mark-connection chain=other-services disabled=no new-connection-mark=gre passthrough=no protocol=gre
add action=mark-connection chain=other-services disabled=no new-connection-mark=other passthrough=no
/ip firewall filter
add action=drop chain=forward comment="Block Teredo IPv6-tunnel" disabled=no dst-port=3544 protocol=udp src-port=1024-65535
add action=drop chain=forward comment="Drop all P2P" connection-mark=p2p disabled=no
add action=drop chain=forward comment="" disabled=no dst-address-list=p2p-users-ext src-address-list=p2p-users
add action=drop chain=forward comment="" disabled=no dst-address-list=p2p-users src-address-list=p2p-users-ext
Since you are operating a free hotspot instead of a fixed ISP with paying customers, you may wish to consider something like I implemented way back on page 3 (http://forum.mikrotik.com/viewtopic.php ... 83#p249583). The problem with trying to block p2p is it is very aggressive at finding any hole it can to get out. If you don't stay on top of new changes, the filter looses effectiveness fairly quickly.Hi all: I am new to Mikrotik. I have an RB450G that I am planning to use as a router/hotspot in a free wireless environment.
That is the same technique I use and it was his Idea (Thanks CCDKP), I just took it one step furtherThis is because bittorrent tends to try the obvious methods of connection before getting "sneaky" about getting out.
My main problem has been and there by the many revisions... That the UDP and TCP blocking rules that cripple the encrypted traffic where like a broad sword. I needed to find a way to only use the broad sword on people that use P2P and then as soon as the shut down the P2P program open up the connection again. That took a lot of my time and some thinking to make (Love Wireshark...). But I have been running it for a week or two now and I have constant communication with the IT representative at the schools. They have yet not made any remarks on it.With all the revisions TKIT has needed to make on the blocking side to stop Toredo tunnels and updated DHT connections, my original hotspot is still running fine.
add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
[admin@RB1100] /ip firewall layer7-protocol> add name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\
?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
[admin@RB1100] /ip firewall layer7-protocol>
Tell me, please, how to configure this section correctly. My external DNS server is 80.233.238.254 and Googles one - 8.8.8.8. My local network is 172.16.10.1/27 and internal DNS server - 172.16.10.1.Note you have to enter your external DNS servers here and also the local networks.Code: Select all/ip firewall address-list add address=xxx.xxx.xxx.xxx comment=DNS-servers disabled=no list=dns-externt add address=xxx.xxx.xxx.xxx disabled=no list=dns-externt add address=78.31.0.0/16 comment=Spotify disabled=no list=spotify add address=xxx.xxx.xxx.xxx disabled=no list=local-addr
It is a mangle, i think?
And other simple question - how I can add an exception for 1 IP address?
My rules kills all. So the DMZ idea will not work. But if you add this it might work. I have not tested them I am @ work right now. But give it a try...Add an address in "DMZ" is no good idea, right? Or it is not possible for those complicated rules?
EDITED: Your rules works like a charm! Down/Up speed=ZERO!
P.S. But adding one IP to exclusions after two hours headacke - w/o success... Google hide answer for me. (I mean - your firewall rules is very strong )
Have not tried. I use it @ my main firewall. But if the AP has the DNS entries it should work. As long as the clients can't use another dns other then the one with the block in it is fine. Also the MS-Teredo block is necessary.@TKITFrank
Will your filter work on a CPE using PPPoE where it gets it's DNS from AP and the AP DNS entries are using a private IP address pointing back to load balancer and this in turn is getting it's DNS from ISP
Have I exclude address 172.16.10.1? See-Now make sure the client uses the google/other dns servers directly and not the DNS server in the Mikrotik. Then it should work.. So if you use a DNS ridirect you have to exclude it as well.
/ip dns> print
servers: 80.233.238.254,8.8.8.8,8.8.4.4
dynamic-servers:
allow-remote-requests: yes
max-udp-packet-size: 512
cache-size: 512KiB
cache-max-ttl: 1w
cache-used: 44KiB
/ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
# NAME ADDRESS TTL
0 RouterOS 172.16.10.1 3d
with chain=forward connections marks fine. Not with tcp-services, other-services.Also try the basic to add a new connection mark that is simple at the top in mangle. If it works or not.
/ip firewall address-list
add address=10.150.0.1 comment=DNS-servers disabled=no list=dns-externt
add address=10.150.0.34 disabled=no list=dns-externt
add address=172.16.10.1/27 disabled=no list=local-addr
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
max-udp-packet-size=512 servers=10.150.0.1,10.150.0.34,172.16.10.1
/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=pppoe-out1 \
to-addresses=0.0.0.0
The test setup is on a CPE using PPPoE on the wlan and my guess is if i could have the filter on ether interface only it may work so if i could advice on setting up the filter for ether. how do i check that prerouting rules work and as regards "Does any traffic get cough?" in testing I open a torrent which starts to download and reboot the pc and cpe with the filter enabled but the torrents resume downloading.@n21roadie
Does any traffic get cough?
Does the prerouting rules work?
Perhaps you can post your complete config and we can look at it
Also please in more detail tell us about you finding where it is not working.
...........................
@TKITFrank
your setting are perfect for blocking P2p. but i have a problem with chinese program Xunlei. With your firewall it not be able to block it at all.
I am currently setup internet for a guesthouse. Everything work find , but when those chinese guest open up Xunlei the internet are just dead. Our speed is 9mbps down and 1mbps up. even i have set a speed limit for each user for 1mbps/256k up it still kill the internet when Xunlei start. Is there a way to block Xunlei? thank in advance.
Hi Powergent,@TKITFrank
Info about the software
Xunlei is a chinese p2p software using http port
The software fake the header and signature of IE and Firefox
There are 2 versions of xunlei.
One is the web xunlei, the web xunlei download the file into the web. Then make the file as an php?attachment, so it allows the file to pass the isa, then lets people download it
The second version is the the xunlei software that used in the computer. This version fake the signature and header of IE and Firefox.
The homepage of this software is xunlei.com.
The port the xunlei is using tcp: 80, 8080, 443, 1080, 3076-3078, 5200, 6200; udp: 3076. The software randomly open ports and fake the header and signature of IE & Firefox
I cannot block these ports, 80, 8080, 443 because these ports need to be openned.
this program really suck it will use port 80 for download if other port are block and yes it have encryption that what i found on the internet information.
I have been trying many router , DDWRT, Dlink, TPlink, Draytek and so on not a single able to stop this program .
My current setting are 2 line PCC load balance which i have from this link ( http://www.youtube.com/watch?v=ECqntLlhaz8 ) pls note i not here to advertise the link as it not my video or to promote . but it just what i follow as i am also a beginner for MIkrotik. And with your firewall 100% blocking torrent . But not Xunlei
Thank you.
Hi jasgotThank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
I have installed the scripts from this post in this thread: http://forum.mikrotik.com/viewtopic.php ... 00#p303639
Everything seemed to go in smoothly (I did find that "/ip firewall layer7-protocol" was missing from the first bit of code).
I was wondering, How do I know if it is working? Is there some place specifically to look to see the results?
If I look at Firewall Connections, I did see two p2p entries in the list, but other than the mark, they looked just like all of the other entries.
Thanks!
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\
62-500 protocol=udp src-address-list=p2p-users src-port=!53
add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\
!dns-externt src-port=!53
add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\
1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack
add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \
src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
Thanks Frank. Should this code go to the top of the Firefall Filters?Hi jasgotThank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
I have installed the scripts from this post in this thread: http://forum.mikrotik.com/viewtopic.php ... 00#p303639
Everything seemed to go in smoothly (I did find that "/ip firewall layer7-protocol" was missing from the first bit of code).
I was wondering, How do I know if it is working? Is there some place specifically to look to see the results?
If I look at Firewall Connections, I did see two p2p entries in the list, but other than the mark, they looked just like all of the other entries.
Thanks!
Sorry to hear about that gram from them. Never nice...
The most simple thing to do is to try to download something your self's. The thing is that you will see the connections but they will be dropped in the filter and then they will die out. The other that have no mark should be killed by this.Try the pirate bay and download a popular torrent and activate encryption and so on. It should block it after a couple of seconds at max. If it is possible to connect, Normally they will not be able to connect.Code: Select alladd action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\ 62-500 protocol=udp src-address-list=p2p-users src-port=!53 add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\ !dns-externt src-port=!53 add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\ 1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \ src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
Thank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
RIAA sent the letter to the ISP, who intern forwarded it to the end user who is a business account customer offering free WiFi to guests. The account with the ISP allows the end user to offer free WiFi to the guests. (but not paid access).Thank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
Are you responsible, as an ISP, for users actions? Which country is that?
...perhaps you're using residential internet access and RIAA thinks you're individual...
It should be a part of the mangle. But if you have done according to the post you should already have thisThanks Frank. Should this code go to the top of the Firefall Filters?Hi jasgotThank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
I have installed the scripts from this post in this thread: http://forum.mikrotik.com/viewtopic.php ... 00#p303639
Everything seemed to go in smoothly (I did find that "/ip firewall layer7-protocol" was missing from the first bit of code).
I was wondering, How do I know if it is working? Is there some place specifically to look to see the results?
If I look at Firewall Connections, I did see two p2p entries in the list, but other than the mark, they looked just like all of the other entries.
Thanks!
Sorry to hear about that gram from them. Never nice...
The most simple thing to do is to try to download something your self's. The thing is that you will see the connections but they will be dropped in the filter and then they will die out. The other that have no mark should be killed by this.Try the pirate bay and download a popular torrent and activate encryption and so on. It should block it after a couple of seconds at max. If it is possible to connect, Normally they will not be able to connect.Code: Select alladd action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\ 62-500 protocol=udp src-address-list=p2p-users src-port=!53 add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\ !dns-externt src-port=!53 add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\ 1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \ src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
And if I read it correctly, it'll show the P2P user in a list for 10 minutes?
Is this some sort of new ISP and RIAA cooperation as discribed in this article:RIAA sent the letter to the ISP, who intern forwarded it to the end user who is a business account customer offering free WiFi to guests. The account with the ISP allows the end user to offer free WiFi to the guests. (but not paid access).Thank you very much for all of your effort on this code. We got a nasty gram from the Recording Industry Association of America (RIAA) yesterday and are trying to prevent all P2P. (we offer free WiFi to guests)
Are you responsible, as an ISP, for users actions? Which country is that?
...perhaps you're using residential internet access and RIAA thinks you're individual...
I'm happy to share the letter, it doesn't really threaten anything. It's just got that "scary official" feel to it. But I'd prefer to do it in another thread as this thread is more about the filtering.Is this some sort of new ISP and RIAA cooperation as discribed in this article:
"Verizon, TWC, and Comcast to Play "Copyright Cop" for the RIAA"
http://www.dailytech.com/Verizon+TWC+an ... e24244.htm
That's probably not it since you said the letter was from RIAA and not the ISP...would you mind sharing what was that they were threatening with (disconnection, damages etc)?
Is it possible to add any offending users to a list (like a log) that includes their IP, MAC and the time and date? Perhaps even the ports they were using?Hi jasgot
Sorry to hear about that gram from them. Never nice...
The most simple thing to do is to try to download something your self's. The thing is that you will see the connections but they will be dropped in the filter and then they will die out. The other that have no mark should be killed by this.Try the pirate bay and download a popular torrent and activate encryption and so on. It should block it after a couple of seconds at max. If it is possible to connect, Normally they will not be able to connect.Code: Select alladd action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\ 62-500 protocol=udp src-address-list=p2p-users src-port=!53 add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\ !dns-externt src-port=!53 add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\ 1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \ src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
Have a look at this address list "p2p-users"Is it possible to add any offending users to a list (like a log) that includes their IP, MAC and the time and date? Perhaps even the ports they were using?Hi jasgot
Sorry to hear about that gram from them. Never nice...
The most simple thing to do is to try to download something your self's. The thing is that you will see the connections but they will be dropped in the filter and then they will die out. The other that have no mark should be killed by this.Try the pirate bay and download a popular torrent and activate encryption and so on. It should block it after a couple of seconds at max. If it is possible to connect, Normally they will not be able to connect.Code: Select alladd action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\ 62-500 protocol=udp src-address-list=p2p-users src-port=!53 add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\ !dns-externt src-port=!53 add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\ 1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \ src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
I'd like to track this for a few days to gain further understanding.
I guess that's where I'm missing something. I have those "add dst to address list" entries in the Mangle, and I have seen a few connections that appear to be block, but I have not seen any sign of the Address lists. Does the list disappear when it becomes emtpy?Have a look at this address list "p2p-users"Is it possible to add any offending users to a list (like a log) that includes their IP, MAC and the time and date? Perhaps even the ports they were using?Hi jasgot
Sorry to hear about that gram from them. Never nice...
The most simple thing to do is to try to download something your self's. The thing is that you will see the connections but they will be dropped in the filter and then they will die out. The other that have no mark should be killed by this.Try the pirate bay and download a popular torrent and activate encryption and so on. It should block it after a couple of seconds at max. If it is possible to connect, Normally they will not be able to connect.Code: Select alladd action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="UDP-Bittorrent blocking" disabled=no dst-address-list=!dns-externt dst-port=1024-65535 packet-size=\ 62-500 protocol=udp src-address-list=p2p-users src-port=!53 add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=62-500 protocol=udp src-address-list=\ !dns-externt src-port=!53 add action=add-dst-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting comment="TCP-Tracker blocking" connection-type=!ftp disabled=no dst-address-list=!dns-externt dst-port=\ 1024-65535 packet-size=100-500 protocol=tcp src-address-list=p2p-users src-port=1024-65535 tcp-flags=psh,ack add action=add-src-to-address-list address-list=p2p-users-ext address-list-timeout=10m chain=prerouting connection-type=!ftp disabled=no dst-address-list=p2p-users dst-port=1024-65535 packet-size=100-500 protocol=tcp \ src-address-list=!dns-externt src-port=1024-65535 tcp-flags=psh,ack
I'd like to track this for a few days to gain further understanding.
It is however dynamic but it would not be a difficult task to create a new list based on this list. That have a longer timeout.
when i try to ad this in l7 then it gave me error likeCode: Select alladd name=BITTORRENT regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?info_hash=|get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:.d2:id20:|\\x08'7P\\)[RP]"
coudnt add new l7 protocol, bad regexp unmatched()(6)
See post@TKITFrank
Hi, can you please export the settings for blocking the p2p traffic and post it here?
- under the required folder 'export compact filename=myrules'
Tnx in advance.
See post@TKITFrank
Hi, can you please export the settings for blocking the p2p traffic and post it here?
- under the required folder 'export compact filename=myrules'
Tnx in advance.
http://forum.mikrotik.com/viewtopic.php ... 00#p303639
Hi, The code in this post is exported an should be okay to import. Read the post and adapt it to your settings.Hi
how do I ad all this to my router? by script? Its alot of code =)
since the code is rewritten and some has been quoted, where can I find the most updated code?
I use google DNS ServersDo you use the build in DNS server to forward requests?
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 servers=\
8.8.8.8,8.8.4.4
Then add them here.I use google DNS ServersDo you use the build in DNS server to forward requests?Code: Select all/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 servers=\ 8.8.8.8,8.8.4.4
chain=forward action=drop p2p=all-p2p log=no log-prefix=""
Any ideas/pointers on how to do this? I would like not to block completely p2p traffic but to give it the lesser priority and if possible, traffic shape the encrypted traffic.Please note that this also opens up for just not blocking but also for marking packets to allow you to trafficshape encrypted torrent traffic.
I have not tried it but it should with some modifications work.
add action=jump chain=to-wan comment=fishy jump-target=fishy
add action=drop chain=fishy connection-mark=p2p
add action=drop chain=fishy p2p=all-p2p
add action=drop chain=fishy layer7-protocol=torrentsites
add action=drop chain=fishy dst-port=53 layer7-protocol=torrentsites protocol=udp
add action=drop chain=fishy content=d1:ad2:id20: dst-port=1025-65535 packet-size=95-190 protocol=udp
add action=drop chain=fishy content="info_hash=" dst-port=2710,80 protocol=tcp
add action=drop chain=fishy content="\r\
\nContent-Type: application/x-bittorrent" protocol=tcp src-port=80
add action=drop chain=fishy content="\r\
\nInfohash:" dst-port=6771 protocol=udp
add action=drop chain=fishy content="\r\
\n\r\
\nd8:announce" protocol=tcp src-port=80
add action=drop chain=fishy layer7-protocol=torrent
add action=drop chain=fishy layer7-protocol=torrent-announce
add action=drop chain=fishy layer7-protocol=direct
add action=drop chain=fishy layer7-protocol=gnutella
add action=drop chain=fishy dst-port=!443 layer7-protocol=https protocol=tcp
add action=return chain=fishy