<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=How_to_Block_Bittorrent_Traffic_with_IPtables</id>
		<title>How to Block Bittorrent Traffic with IPtables - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=How_to_Block_Bittorrent_Traffic_with_IPtables"/>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=How_to_Block_Bittorrent_Traffic_with_IPtables&amp;action=history"/>
		<updated>2026-06-04T07:59:51Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://briansnelson.com/index.php?title=How_to_Block_Bittorrent_Traffic_with_IPtables&amp;diff=816&amp;oldid=prev</id>
		<title>Brian: /* Setup the IPtables Rules */</title>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=How_to_Block_Bittorrent_Traffic_with_IPtables&amp;diff=816&amp;oldid=prev"/>
				<updated>2015-01-22T13:40:39Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Setup the IPtables Rules&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:40, 22 January 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;IPTABLES is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;IPTABLES is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Setup the IPtables Rules==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;==Setup the IPtables Rules&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To block Bittorrent traffic with IPTABLES you can edit /etc/sysconfig/iptables (CentOS) and include the following:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To block Bittorrent traffic with IPTABLES you can edit /etc/sysconfig/iptables (CentOS) and include the following:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key briansne_wiki-wiki_:diff:version:1.11a:oldid:815:newid:816 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>https://briansnelson.com/index.php?title=How_to_Block_Bittorrent_Traffic_with_IPtables&amp;diff=815&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;==How to Block Bittorrent Traffic with IPtables==  IPTABLES is a user-space application program that allows a system administrator to configure the tables provided by the Linu...&quot;</title>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=How_to_Block_Bittorrent_Traffic_with_IPtables&amp;diff=815&amp;oldid=prev"/>
				<updated>2015-01-22T13:40:05Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==How to Block Bittorrent Traffic with IPtables==  IPTABLES is a user-space application program that allows a system administrator to configure the tables provided by the Linu...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==How to Block Bittorrent Traffic with IPtables==&lt;br /&gt;
&lt;br /&gt;
IPTABLES is a user-space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores.&lt;br /&gt;
&lt;br /&gt;
==Setup the IPtables Rules==&lt;br /&gt;
To block Bittorrent traffic with IPTABLES you can edit /etc/sysconfig/iptables (CentOS) and include the following:&lt;br /&gt;
&lt;br /&gt;
 vim /etc/sysconfig/iptables&lt;br /&gt;
&lt;br /&gt;
First you will want to add the chain right above the first rules&lt;br /&gt;
&lt;br /&gt;
 :RH-Firewall-1-INPUT - [0:0]&lt;br /&gt;
&lt;br /&gt;
Then add the following above the '''COMMIT''' line&lt;br /&gt;
&lt;br /&gt;
 # Torrent ALGO Strings using Boyer-Moore&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;BitTorrent&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;BitTorrent protocol&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;peer_id=&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;.torrent&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;announce.php?passkey=&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;torrent&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;announce&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;info_hash&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;/default.ida?&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;.exe?/c+dir&amp;quot; -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --algo bm --string &amp;quot;.exe?/c_tftp&amp;quot; -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # Torrent Keys&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;peer_id&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;BitTorrent&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;BitTorrent protocol&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;bittorrent-announce&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;announce.php?passkey=&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # Distributed Hash Table (DHT) Keywords&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;find_node&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;info_hash&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;get_peers&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;announce&amp;quot; --algo kmp -j DROP&lt;br /&gt;
 -A RH-Firewall-1-INPUT -m string --string &amp;quot;announce_peers&amp;quot; --algo kmp -j DROP &lt;br /&gt;
&lt;br /&gt;
===Restart IPtables===&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables restart&lt;br /&gt;
&lt;br /&gt;
===View IPtables/Verify the Rules===&lt;br /&gt;
&lt;br /&gt;
 iptables -L&lt;br /&gt;
&lt;br /&gt;
===Sample Output===&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 Chain RH-Firewall-1-INPUT (0 references)&lt;br /&gt;
 target     prot opt source               destination         &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;BitTorrent&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;BitTorrent protocol&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;peer_id=&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;.torrent&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;announce.php?passkey=&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;torrent&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;announce&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;info_hash&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;/default.ida?&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;.exe?/c+dir&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;.exe?/c_tftp&amp;quot; ALGO name bm TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;peer_id&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;BitTorrent&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;BitTorrent protocol&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;bittorrent-announce&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;announce.php?passkey=&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;find_node&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;info_hash&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;get_peers&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;announce&amp;quot; ALGO name kmp TO 65535 &lt;br /&gt;
 DROP       all  --  anywhere             anywhere            STRING match &amp;quot;announce_peers&amp;quot; ALGO name kmp TO 65535&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>