Internet is the most important and one of the basic amenities in today’s world. Sharing internet using WiFi router with slow speeds having low bandwidth is a real pain. Plus if you end up working from home and taking Skype for Business (formerly Lync) calls then you’ll be virtually fighting with your kids & wife. They’ll be using the same internet to browse youtube, shopping sites etc which are bandwidth hungry apps.
I was aware of Squid proxy but never explored it to use it for throttling bandwidth for clients. I followed this guide to install squid on my Raspberry Pi and modified configuration file according to my requirements. Below is the configuration file of squid proxy which will throttle the internet speed / bandwidth for the clients like laptop, android phones and tablets.
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl localhost src 127.0.0.1/32
acl localnet src 192.168.2.0/24
acl clientpc src 192.168.2.90-192.168.2.100/24
delay_class 1 1
delay_parameters 1 64000/64000
delay_access 1 allow clientpc
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localnet #!clientpc
http_access allow localhost
http_access deny all
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
I’ve highlighted important lines in RED color above. I’ve created an acl called “clientpc” for the local network having IP address starting from 192.168.2.90 to .100. Created a default pool ‘1’ and class ‘1’. ‘delay_parameters’ for pool ‘1’ set to 64000 bytes (512KB). We can increase or decrease depending on the internet speed or bandwidth.
Enabled proxy in firefox. If you’re in stone age and still use ‘IE’ then go search for ‘proxy settings for IE’ in search engines 😛
- Click the Firefox menu. Select Options from the submenu.
- Open the Advanced category. It is on the right end of the category list. …
- Click the Settings button. This will open the Connection Settings window.
- Choose “Manual proxy configuration”. …
- Enter your proxy information.
Enabled proxy on the android phones and tablets by referring to this link.
Tested internet speed via speedof.me Below screenshot shows that the download speed was successfully throttled by Squid whereas my internet connection speed is 2 Mbps. Now I can work from home with peace of mind and grabbing a largest piece of “internet” pie.
It was time consuming and eaten up my Sunday but worth to spend the time as I don’t have to crib in future about internet speed or poor voice / audio issues.
Let me know your queries using below ‘reply’ button…