Recently I've noticed that YouTube's performance on my machines have been terrible. It's constantly buffering, or it will stop randomly in the middle of a video. I'll get a few seconds of playback and then 10-30 seconds of buffering. It's pretty terrible. On Windows I have been able to use the helpful workaround from here and performance has definitely increased. On top of that, I'm also using the SmartVideo plugin on Chrome (it's also available for FireFox). But on my Linux boxes, I'm still having the same problem in spite of having the SmartVideo plugin. There is a Linux alternative to guide from above, but it uses ipfw
program which is not natively available on Ubuntu/Linux (at least from my understanding) due to it being a BSD program. I didn't want to compile it and install it from source, so I decided to use ufw
instead, which is the "Uncomplicated Firewall" that comes with Ubuntu. It was pretty simple to convert the rules over. But first you will need to enable it (if you haven't already). You can do that with:
sudo ufw enable
Then you can enable logging also, if you want:
sudo ufw logging on
If you SSH into your machine or if you use your machine as a webserver, you will need to enable a few more rules:
sudo ufw allow ssh/tcp
sudo ufw allow http/tcp
sudo ufw allow 8080/tcp
And of course, you can add the rules that will prevent your ISP from caching YouTube:
sudo ufw deny from 173.194.55.0/24
sudo ufw deny from 206.111.0.0/16
You can then use ufw status
to verify that your rules are in place:
$ sudo ufw status
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
8080/tcp ALLOW Anywhere
Anywhere DENY 173.194.55.0/24
Anywhere DENY 206.111.0.0/16
22/tcp ALLOW Anywhere (v6)
80/tcp ALLOW Anywhere (v6)
8080/tcp ALLOW Anywhere (v6)
How to stop YouTube sucking on Ubuntu/Linux http://t.co/704XSI62xR
I tried this on windows and found that it was hit or miss (from my NYC area). I think those IP addresses likely depend on where you are regionally.
Yeah, it might not block the regional ISP caches. I’m at least able to watch videos properly now, though!
I ended up switching to a docsis 3.0 modem, that seemed to help more – although I wonder if it was getting rid of the Timewarner modem that actually fixed the problem…
I have a DOCSIS 3.0 modem as well, but it didn’t help. I have good bandwidth too. This seems to fix it for me.
good to hear
I think it’s an attempt by cable companies to make YouTube seem like it’s performing bad so that people don’t cut their cable. /conspiracy-keanu
That makes sense >.>