How to stop TWC ISPs sucking at Youtube

slow-funny

I’ve had TWC for over a year and have been frustrated at the shockingly crap Youtube performance. I never had issues with other web browsing, downloads, or Netflix, so I simply shrugged it off and continued with life. A few days ago I came across this video and some discussions on Reddit which prompted me to explore further.

A few terminal commands later to reject certain IP addresses and I was back to blazingly fast Youtube streaming (and Twitch.tv). Doing this will cause the stream to take 1-2 seconds to start because of the IP rejection handling, but then you are greeted with a silky smooth, ultra fast experience.

Open up your terminal and run these commands (you will be prompted for the admin password):

sudo ipfw add reject src-ip 173.194.55.0/24 in
sudo ipfw add reject src-ip 206.111.0.0/16 in

You can check the rules were added by using this command:

sudo ipfw list

Need to delete these rules? No problem, just run the ‘sudo ipfw list’ command again. Next to each rule is a reference number, so take the number of the rule you want to delete and replace the ‘X’ in this command with that number:

sudo ipfw delete X

Why do these commands create a better streaming experience? TWC is throttling downloads from servers (CDN) that host cached videos. By rejecting these IP address ranges you will force the video to be served to you directly. This harnesses the full download speed of your internet connection. Other people can dive into the complexity much better than I ever could, but that’s the overall theme.

If you’re not using a Mac, here’s some tips to make this work:

  • Linux – instead of ipfw use iptables command
  • Windows – check out this guide
  • Multiple computers – configure the IP blocks via your router.

Did this trick work for you? Let me know in the comments below.

EDIT (Feb 25, 2013): After some great discussion on HN, I wanted to address that before posting I did test a number of ISPs, and also I read various on message boards, that complained about speed, appeared to be overwhelmingly TWC. That’s not ideal proof, but this was just intended to be a share of a personal quick fix. I’ve modified the title to reflect that is not specific to TWC. Enjoy the hack!

Run an online business? Increase conversions with smarter lifecycle emails. Get Vero.

Sponsored

222 Comments How to stop TWC ISPs sucking at Youtube

  1. mnb22

    for those using ipfw on a mac, you have to open a command shell via “terminal” app and run these commands with the appropriate sudo permissions. I added this but got zero hits on the rule *counters* using verizon so i can only assume these subnets do not apply here – was worth a go at it.

    For those interested, if you issue –> sudo ipfw -a list you’ll see something like this:

    mbp:~ op$ sudo ipfw -a list
    00100 0 0 reject ip from 173.194.55.0/24 to any in
    00200 0 0 reject ip from 206.111.0.0/24 to any in
    65535 27599 19819261 allow ip from any to any

    Lines 00100 + 00200 are the newly added rules…

    Reply
  2. Nick

    I keep getting an Invalid Argument when I go to delete these… it seems to have made things way worse. How can I fix this? Is there something I’m missing?

    Reply
    1. P

      It’s not the IP you want to delete, it’s the list number. Use the list command, and it’ll show you (likely) two entries. The entry # at the beginning is what you want to tell it to delete.

      Reply
  3. Jason Martin

    Mitch – I was shocked when I heard about this and would explain all the issues I’ve had with streaming video. I have “business class” TWC, 15 Mbps down. I tried this fix on my MacBook Pro with OS X 10.8.3, but when I try playing YouTube videos in Chrome, the YouTube pages load, but the video don’t even load at all. Eventually in the video window, it says “An error occurred, please try again later.” Any suggestions on how to troubleshoot or do you know the reason?

    Reply
    1. s.melmoth

      Same issue here. I’m on TWC in NYC. Sometimes it work, sometimes it doesn’t. I tried on cross plafrom Chome, Firefox, Safari and the result is the same. It’s a real shame and I’m sure a class-actions will emerge soon because it’s a TWC Scam policy

      Reply
  4. David

    Thanks, this worked on Telstra’s ADSL2+ in Australia. Went from not being able to watch long videos to them playing perfectly. Great work.

    Reply
  5. Jared Anson

    This doesn’t seem to be working for me, I did all the instructions as they said for Macs. Recently my ISP got bought out by Time Warner, and now my internet sucks. Before I could instantly load 1080p youtube videos, now even on 240 they won’t even load half the time.

    Reply
  6. Humberto

    For anyone in Brazil trying this, what seems to have worked for me is: sudo ipfw add reject src-ip 189.123.228.0/24 in.

    Reply
  7. Anthony

    worked like a charm for me. As of May 1st, 2013, my youtube has been very fast and ive even been able to watch videos in 1080p with no buffering. THANKS FOR THIS

    Reply
  8. Mike

    Hold a newbie’s hand… what do you mean by “open your terminal?” Not sure what that means. FYI, I’m on a Mac.

    Reply
  9. Richard W

    This doesnt seem to work for me. The video plays right away, but the freezes @ 0:02 and loads nothing. i have the 50/25 fios deal, and these videos are in 240p, not loading. Vimeo however will load the 1280p instantly.

    Reply
    1. Richard Smith

      Verizon’s TOS says that they don’t throttle or limit any internet usage, a vast departure from the TOS of Time Warner. I wouldn’t worry about throttling.

      Reply
  10. NOC

    All I can say is after hours of discussions with FiOS tech support, 3 routers, and months of brain blowing frustration, THANK YOU LORDY JESUS! The IP blocking through my router fixed this problem on all of my devices. YOU F-ING ROCK MAN!

    Reply
  11. zeroryoko1974

    I wonder if phone companies do this on cell phones. This worked great for me on youtube. Hopefully it works with Crunchyroll to

    Reply
  12. Derek

    This appears to have worked for me. I entered the two lines on my mac mini. Prior to entering them i couldnt really even watch a youtube video. Afterwards I can watch 1080p youtube video easily.

    BTW I am on Time Warner Cable in South Carolina. I have the standard 15Mdown 1M up connection and usually get REALLY good speedtest results. So, youtube not working is completely because of TWC throttling those CDN servers.

    Why in the freaking world would they do that? Isnt that a violation of FCC Net Neutrality rules?

    Reply
  13. scifisaint

    This worked for me! I love you man! However, can TWC do something similar to a game like Battlefield 3? I’ve been having horrible lag in BF3 for the same time as I’ve had problems with twitch and youtube. Thought maybe there was a connection there.

    Reply
  14. Leon

    Ok so I copied both the commands under “Open up your terminal and run these commands (you will be prompted for the admin password):” – I pasted them in my terminal and was asked to input a admin password – I typed in the password (100% sure its correct even though I cant see any characters pop up when i type) – Hit enter and it gives me the “Wrong Password”. I don’t know what is wrong can somebody please help me. Youtube is extremely annoying atm

    Reply
  15. Krista Tissot

    Any way you can leave the exact command for undoing everything? It ended up making my youtube slower and I’m confused on how to undo it! Thank you.

    Reply
    1. Mark

      Actually, Mitch’s post provided an example that is about as close to exactly the command to use as is possible. It’s not possible to give the completely exact command because that requires the reference numbers for the rules you created earlier and these numbers can be different on each computer. This is why it is necessary to:

      1. Run “sudo ipfw list”
      2. Read the list and determine the reference numbers for the two rules you created earlier
      3. Run “sudo ipfw delete [reference number 1]” (replace [reference number 1] with the actual reference number)
      4. Run “sudo ipfw delete [reference number 2]” (replace [reference number 2] with the actual reference number)

      Hopefully this helps elaborate further on Mitch’s already excellent explanation. I’d provide an example of the output of the list command but I don’t have a Mac, yet this is much like techniques required in the Linux environment.

      Reply
  16. Jeff

    These commands worked very well, unfortunately they caused YouTube’s full screen option to glitch up. Has anyone had a similar issue?

    Reply
  17. Alex Miller

    Can you publish a guide to how you found these two specific hosts to block? And what you hypothesize they do? I am in China and would like to follow your steps to find the hosts I should block, if possible.

    Reply
    1. Mark

      Yes, a guide on this would be much appreciated. I’m not sure how likely it is that TWC will setup more of these servers in IP ranges not in the above blocks but it would be nice to know how to find this out should that happen in the future.

      Reply
          1. Mitch

            Sure, I can do a basic post on how to dig up the IP addresses, but I’ll be keeping it short and sweet, simply focusing on finding the IP address you want to block. I’ll leave out all the theory behind it for another day.

            Reply
  18. clintus

    Does this work for uploads? I’m having an issue with my upload speeds going up and down and never stabilizing. I monitor my speeds with an application and I used to get a consistant upload speed the entire duration. now it goes up and down looking like the heart beat monitor of someone running. And it’s only YouTube. Vimeo and Blip.tv I get a constant speed of what I’m suppose to be getting.

    If this won’t fix this issue, any ideas what could?

    Reply
  19. jeff

    what worked for me was internet protocol version; won’t reveal that here but whatever version you have, you can change DNS server to a faster one; change both, to include the alternate to a faster DNS; I switched, speed is better, even at 1080p, load time suped up drastically; also blocked the infamous address known used via Google/YouTube for cache load; you can also change Windows computer system file, where it might be programmed as a text; reconfigure it as an ini file, where it will work to include desktop under protocol as a main load in from computer fire up, rather than a log load and/or a file load to folder; it will see the browser as a priority same as any other file at desktop as an ini process; I didn’t need to do that but will if problems still occur for load in such as YouTube browser loads for their system(s)

    Reply
  20. ALok

    This explanation appears to be wrong by my tests, not everyone should be blocking the same servers since these connections depend on the ISP and the region.

    But most of the time these servers will be slow probably because the traceroutes seem to point to them being inside Google’s datacenter, they are more likely the original source, rather than the caching CDNs that peer directly with each ISP. So it seems the problem is that many times youtube will prefer going to the original google source rather than the more local cache so by blocking the the google’s data center servers you get the closer cache if youtube can find it after hunting awhile.
    The problem I’ve had with this solution is that sometimes the video is just not on the cache server, and you end up with the snowscreen error message.

    The Real soultion that youtube should implement is a record of which servers are faster than others, and over time it should pick the correct ones more often than not. So in the end it isn’t the ISPs fault, but google’s. If the ISP wanted to throttle youtube, it could do a better job and you’d never be able to watch youtube. More likely the series of tubes connecting to google’s datacenter are just clogged during primetime hours.

    Reply
  21. Sunil J

    If the CDN is for TWC customers, then how is it that it makes a difference to people from other far flung regions of the world? Placebo effect?
    Is this CDN for youtube? if that is so I would have expected Google to provide better experience.

    Got to try this when I get back home and check the before and after speeds.

    Reply
  22. ftemple

    I’m on CenturyLink in AZ and this worked for me. This is the first time in about two years I’ve been able to watch a youtube video in 720/1080p without it stopping to buffer every 2 seconds. I’m on a 40/15 connection so I’ve been scratching my head over this for a while now.

    Reply
  23. Sean

    Wouldn’t it be better to gather actual evidence of TWC throttling (didn’t see any sources here), and present it to both TWC and Google for comment? What do you do when/if the CDNs shift around to different IP subnets? Keep blocking entire /24s and /16s until you’ve eventually blocked yourself from Google almost entirely? Seems extreme but in the end I’d rather see a real root cause found and addressed by Google and/or ISPs.

    Reply
  24. Dave

    Worked great for me using FiOS in New York. Videos take a second or two longer to load initially, but once it gets started, the loading is lightning fast.

    Reply
  25. Seth Green

    I’m In America, using Comcast with Windows 8. It accepted the command but I haven’t noticed a major difference. Was quick to do though.

    Reply
  26. Leon

    Hey Mitch, I need some help. When it asks for the admin password on terminal (Mac) I can’t type anything? I try pressing all buttons but it doesn’t work. Only thing that works is enter. I tried typing up my password then pressing enter but it just says “Wrong Password”

    Reply
    1. Teddy Hill

      your won’t see the typing but it is typing the nothing that you see is the * marks when you actually type your password so just double check you didn’t mess up the password and do it a couple more times should work.

      Reply
  27. kd4pba

    Worked on my firewall. TWC Business Class and I have had a horrible time specifically with Youtube. This seems to have fixed the issue for now. thanks.

    Reply
  28. vineel

    Is there a step by step on how to do this through the wireless router since i have multiple devices like laptop, tablet and phones…?

    Reply
    1. Al

      Have you tried setting your Router DNS to use Google’s public address (8.8.8.8) instead of the ISP’s default? That seems to have eased some of the issues I was having.

      Reply
  29. Rouven

    didn’t work for me here in germany… videos loaded much longer than without the rules… could it be that there are different ip-adresses used by cdn?

    Reply
    1. SquarePenguin

      Yep, no good for me in Germany either. Blocking the…

      173.194.55.0/24

      …range just blocked most of the internet it seemed! Blocking the…

      206.111.0.0/16

      …range had, unfortunately, no measurable impact on streaming speeds whatsoever. My ISP is o2 (Alice).

      Reply
  30. dam

    Hi, do you think this could work in France ?
    We have the same issue here (crap performance on youtube and twitch.tv) with the provider named “Free” (it’s the real name don’t laugh).
    However, i’m not sure we are using the same videos cache servers here. Do you know where i can find ips addresses for those servers in france?

    Reply
  31. M T

    After adding these to terminal, my videos take at least 20 seconds to start. Anyway around that?

    But once the video starts, the whole video loads extremely fast and no buffering.

    Reply
    1. moe

      that could also be your DNS, not sure if this will work with the above but you could try to change to googles DNS servers 8.8.8.8 and 8.8.4.4. This *may* also help in general as Google often hosts a video on several servers and due to load balancing may give you different parts of one clip from several servers, each requiring a DNS lookup. Come to think of it, could different DNS settings also help bypass the CDN?

      Reply