<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Bandwidth_Shaping%3A_Throttling_eth0_upload%2Fdownload_speeds</id>
	<title>Bandwidth Shaping: Throttling eth0 upload/download speeds - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Bandwidth_Shaping%3A_Throttling_eth0_upload%2Fdownload_speeds"/>
	<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Bandwidth_Shaping:_Throttling_eth0_upload/download_speeds&amp;action=history"/>
	<updated>2026-05-04T22:58:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Bandwidth_Shaping:_Throttling_eth0_upload/download_speeds&amp;diff=1026&amp;oldid=prev</id>
		<title>David at 16:29, 24 September 2012</title>
		<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Bandwidth_Shaping:_Throttling_eth0_upload/download_speeds&amp;diff=1026&amp;oldid=prev"/>
		<updated>2012-09-24T16:29:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:29, 24 September 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Use the tool &amp;lt;tt&amp;gt;tc&amp;lt;/tt&amp;gt; to control the network bandwidth&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Show any restrictions already in place ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[root@amdquad scratch]# tc qdisc list&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;qdisc mq 0: dev eth0 root &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;qdisc mq 0: dev eth1 root &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sample Script to start/stop Bandwidth Shaping ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sample Script to start/stop Bandwidth Shaping ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script restricts eth0 on 172.28.0.1 to 250KB/s or 2mbits upload/download speeds&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This script restricts eth0 on 172.28.0.1 to 250KB/s or 2mbits upload/download speeds&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>David</name></author>
	</entry>
	<entry>
		<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Bandwidth_Shaping:_Throttling_eth0_upload/download_speeds&amp;diff=1025&amp;oldid=prev</id>
		<title>David: Created page with &quot;== Sample Script to start/stop Bandwidth Shaping == This script restricts eth0 on 172.28.0.1 to 250KB/s or 2mbits upload/download speeds &lt;syntaxhighlight&gt; #!/bin/bash # #  tc uses the fo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Bandwidth_Shaping:_Throttling_eth0_upload/download_speeds&amp;diff=1025&amp;oldid=prev"/>
		<updated>2012-09-24T16:26:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Sample Script to start/stop Bandwidth Shaping == This script restricts eth0 on 172.28.0.1 to 250KB/s or 2mbits upload/download speeds &amp;lt;syntaxhighlight&amp;gt; #!/bin/bash # #  tc uses the fo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Sample Script to start/stop Bandwidth Shaping ==&lt;br /&gt;
This script restricts eth0 on 172.28.0.1 to 250KB/s or 2mbits upload/download speeds&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
#  tc uses the following units when passed as a parameter.&lt;br /&gt;
#  kbps: Kilobytes per second &lt;br /&gt;
#  mbps: Megabytes per second&lt;br /&gt;
#  kbit: Kilobits per second&lt;br /&gt;
#  mbit: Megabits per second&lt;br /&gt;
#  bps: Bytes per second &lt;br /&gt;
#       Amounts of data can be specified in:&lt;br /&gt;
#       kb or k: Kilobytes&lt;br /&gt;
#       mb or m: Megabytes&lt;br /&gt;
#       mbit: Megabits&lt;br /&gt;
#       kbit: Kilobits&lt;br /&gt;
#  To get the byte figure from bits, divide the number by 8 bit&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Name of the traffic control command.&lt;br /&gt;
TC=/sbin/tc&lt;br /&gt;
&lt;br /&gt;
# The network interface we&amp;#039;re planning on limiting bandwidth.&lt;br /&gt;
IF=eth0             # Interface&lt;br /&gt;
&lt;br /&gt;
# Download limit (in mega bits)&lt;br /&gt;
DNLD=2mbit          # DOWNLOAD Limit&lt;br /&gt;
&lt;br /&gt;
# Upload limit (in mega bits)&lt;br /&gt;
UPLD=2mbit          # UPLOAD Limit&lt;br /&gt;
&lt;br /&gt;
# IP address of the machine we are controlling&lt;br /&gt;
IP=172.28.0.1     # Host IP&lt;br /&gt;
&lt;br /&gt;
# Filter options for limiting the intended interface.&lt;br /&gt;
U32=&amp;quot;$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32&amp;quot;&lt;br /&gt;
&lt;br /&gt;
start() {&lt;br /&gt;
&lt;br /&gt;
# We&amp;#039;ll use Hierarchical Token Bucket (HTB) to shape bandwidth.&lt;br /&gt;
# For detailed configuration options, please consult Linux man&lt;br /&gt;
# page.&lt;br /&gt;
&lt;br /&gt;
    $TC qdisc add dev $IF root handle 1: htb default 30&lt;br /&gt;
    $TC class add dev $IF parent 1: classid 1:1 htb rate $DNLD&lt;br /&gt;
    $TC class add dev $IF parent 1: classid 1:2 htb rate $UPLD&lt;br /&gt;
    $U32 match ip dst $IP/32 flowid 1:1&lt;br /&gt;
    $U32 match ip src $IP/32 flowid 1:2&lt;br /&gt;
&lt;br /&gt;
# The first line creates the root qdisc, and the next two lines&lt;br /&gt;
# create two child qdisc that are to be used to shape download &lt;br /&gt;
# and upload bandwidth.&lt;br /&gt;
#&lt;br /&gt;
# The 4th and 5th line creates the filter to match the interface.&lt;br /&gt;
# The &amp;#039;dst&amp;#039; IP address is used to limit download speed, and the &lt;br /&gt;
# &amp;#039;src&amp;#039; IP address is used to limit upload speed.&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stop() {&lt;br /&gt;
&lt;br /&gt;
# Stop the bandwidth shaping.&lt;br /&gt;
    $TC qdisc del dev $IF root&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
restart() {&lt;br /&gt;
&lt;br /&gt;
# Self-explanatory.&lt;br /&gt;
    stop&lt;br /&gt;
    sleep 1&lt;br /&gt;
    start&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show() {&lt;br /&gt;
&lt;br /&gt;
# Display status of traffic control status.&lt;br /&gt;
    $TC -s qdisc ls dev $IF&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
&lt;br /&gt;
  start)&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;Starting bandwidth shaping: &amp;quot;&lt;br /&gt;
    start&lt;br /&gt;
    echo &amp;quot;done&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
&lt;br /&gt;
  stop)&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;Stopping bandwidth shaping: &amp;quot;&lt;br /&gt;
    stop&lt;br /&gt;
    echo &amp;quot;done&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
&lt;br /&gt;
  restart)&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;Restarting bandwidth shaping: &amp;quot;&lt;br /&gt;
    restart&lt;br /&gt;
    echo &amp;quot;done&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
&lt;br /&gt;
  show)&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Bandwidth shaping status for $IF:&amp;quot;&lt;br /&gt;
    show&lt;br /&gt;
    echo &amp;quot;&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
&lt;br /&gt;
  *)&lt;br /&gt;
&lt;br /&gt;
    pwd=$(pwd)&lt;br /&gt;
    echo &amp;quot;Usage: tc.bash {start|stop|restart|show}&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>David</name></author>
	</entry>
</feed>