我运行了一个VPN服务,我一直在试图找到一种方法来阻止流经服务器的torrent流量,这样客户就不会使用VPN服务进行torrent。起初,我尝试使用iptables来阻止用于torrenting和字符串匹配的公共端口,但最终做的唯一一件事就是减慢了连接到对等体的启动过程。这是因为torrent客户端将进行端口跳转,直到它们找到可用的端口。
在网上看了看后,我得出的结论是,唯一可靠地阻止torrent流量的方法是通过深度包检测。
我在其中一个VPN服务器上安装了一个由ndpi和内核模块组成的服务,以便ndpi检测到torrent协议后,可以将其传递到Iptables进行丢弃。
点击此处:https://github.com/betolj/ndpi-netfilter
通过ntopng web界面,它可以正确地检测torrent流量,但iptables似乎没有丢弃数据包,因为torrent流量仍然能够完全正常通过。
我做错了什么吗,或者有没有更好的方法/软件来执行流量整形?
发布于 2014-12-04 04:44:30
#Block Torrent
iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "peer_id=" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string ".torrent" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "torrent" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "announce" -j LOGDROP
iptables -A FORWARD -m string --algo bm --string "info_hash" -j LOGDROP
来源:http://www.unixmen.com/how-to-block-bittorrent-traffic-on-your-linux-firewall/
https://stackoverflow.com/questions/27279561
复制相似问题