^get.+announce\?info
^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 firewall100% 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