<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AHMED OSAMA</title>
    <description>The latest articles on DEV Community by AHMED OSAMA (@egyleader).</description>
    <link>https://dev.to/egyleader</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F503365%2F122b7566-168e-42c9-8785-ac762dc21741.jpeg</url>
      <title>DEV Community: AHMED OSAMA</title>
      <link>https://dev.to/egyleader</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/egyleader"/>
    <language>en</language>
    <item>
      <title>How to control [limit] network bandwidth in linux 🐢</title>
      <dc:creator>AHMED OSAMA</dc:creator>
      <pubDate>Wed, 23 Mar 2022 13:13:30 +0000</pubDate>
      <link>https://dev.to/egyleader/how-to-control-limit-network-bandwidth-in-linux-70k</link>
      <guid>https://dev.to/egyleader/how-to-control-limit-network-bandwidth-in-linux-70k</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.pexels.com%2Fphotos%2F3799830%2Fpexels-photo-3799830.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D750%26w%3D1260" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.pexels.com%2Fphotos%2F3799830%2Fpexels-photo-3799830.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D750%26w%3D1260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this article will help you limit your network bandwidth using &lt;a href="https://github.com/magnific0/wondershaper" rel="noopener noreferrer"&gt;wondershaper&lt;/a&gt; tool !!&lt;/p&gt;

&lt;h2&gt;
  
  
  Why to limit bandwidth?
&lt;/h2&gt;

&lt;p&gt;there are a lot of reasons you would do that,&lt;br&gt;
it is very useful when you are trying to :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;control your internet quota or&lt;/li&gt;
&lt;li&gt;throttle internet connection to know how certain app or service work on slow connections .&lt;/li&gt;
&lt;li&gt;have more than one wifi adapter and need to control the speed each one connects to internet &lt;/li&gt;
&lt;li&gt;any other reason IDK about 🤷🏻‍♂ !
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;so here we go &lt;/p&gt;

&lt;h2&gt;
  
  
  1. install wonder shaper tool
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;wondershaper  &lt;span class="o"&gt;[&lt;/span&gt;On Debian/Ubuntu]
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;wondershaper  &lt;span class="o"&gt;[&lt;/span&gt;On CentOS/RHEL]
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;wondershaper  &lt;span class="o"&gt;[&lt;/span&gt;On Fedora 22+]
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; wondershaper &lt;span class="o"&gt;[&lt;/span&gt; on Archlinux and based systems]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  2. find your interface name
&lt;/h2&gt;

&lt;p&gt;you need to find your wifi card id that you will limit by running this command &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ifconfig


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;output will be like &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

br-85a34b55f6de: flags=4099&amp;lt;UP,BROADCAST,MULTICAST&amp;gt;  mtu 1500
... other stuff 

lo: flags=73&amp;lt;UP,LOOPBACK,RUNNING&amp;gt;  mtu 65536
... other stuff 


wlp2s0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1500
... other stuff 



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;so here my wifi adapter name is 'wlp2s0' and lo is wired ethernet , you should know the one you need by other info like the ip or data usage , but if you have one wifi adapter it is usually wlp2s0.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. run this command with your adapter name
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;wondershaper &lt;span class="nt"&gt;-a&lt;/span&gt; wlp2s0 &lt;span class="nt"&gt;-d&lt;/span&gt; 4000 &lt;span class="nt"&gt;-u&lt;/span&gt; 1024


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;with the -d argument represents download speed in kb and -u represents upload speed in kb&lt;/p&gt;

&lt;h2&gt;
  
  
  4. to clear the limit and have full internet speed you run
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;wondershaper &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; wlp2s0


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;you also need to run this command before applying any new limit on the same adapter &lt;/p&gt;

&lt;h2&gt;
  
  
  5. I've made shell scripts to help you switch easily between high speed and low speed
&lt;/h2&gt;

&lt;p&gt;you can find them in 👉🏻 &lt;a href="https://gist.github.com/egyleader/ef17e951014f5236bf9f6c3dba665863" rel="noopener noreferrer"&gt;this gist&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bash</category>
      <category>network</category>
    </item>
  </channel>
</rss>
