Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
if ( $remote_addr ~* 192.133.125.0/24 ) {
limit_rate 3k;
}
if ( $remote_addr ~* 165.135.0.0/16 ) {
limit_rate 3k;
}
if ( $remote_addr ~* 192.104.54.0/24 ) {
limit_rate 3k;
}
if ( $remote_addr ~* 4.21.126.0/24 ) {
limit_rate 3k;
}
if ( $remote_addr ~* 65.125.25.64/26 ) {
limit_rate 3k;
}
if ( $remote_addr ~* 208.23.64.0/25 ) {
limit_rate 3k;
}
# put the serve files or proxy_pass code here.
}
@AfterCredits
Copy link

AfterCredits commented May 10, 2014

Sorry for the n00b question...

My site is WordPress powered hosted on GoDaddy. Any idea how to implement this? Or if someone can make a plugin like the SOPA blackout one, that would be awesome!

@PowerFist
Copy link

PowerFist commented May 11, 2014

Thank you for this, implementing it directly. Logic will prevail.

@jedsmith
Copy link

jedsmith commented May 11, 2014

I look forward to these ranges being reassigned, then all of you forgetting this shit in your long, crusty configuration file, then spending four days trying to figure out why only $isp customers in $region can't do shit with your site.

Oh wait, if you're sticking this in your config and getting away with it, you don't have a site of note. So, never mind.

(Also, the Apache 12-regexes-per-request to a PHP script that calls sleep() is my personal favorite. In grown-up operations terms, we call that a "DoS vector," being one while(1) away from unresponsive.)

@aardvark857
Copy link

aardvark857 commented May 11, 2014

Not tested and could use some improvements. I'll make a better version and post tomorrow.

= ip2long("192.133.125.0") && $ip <= ip2long("192.133.125.24") ) || ( $ip >= ip2long("165.135.0.0") && $ip <= ip2long("165.135.0.16") ) || ( $ip >= ip2long("192.104.54.0") && $ip <= ip2long("192.104.54.24") ) || ( $ip >= ip2long("4.21.126.0") && $ip <= ip2long("4.21.126.0/24") ) || ( $ip >= ip2long("65.125.25.26") && $ip <= ip2long("65.125.25.64") ) || ( $ip >= ip2long("208.23.64.0") && $ip <= ip2long("208.23.64.25") )) { //Redirect to some horrible site. You need to change the last line for this script to work. header("Location: lemonparty.org || meatspin.cc || someOtherHorribleSite.whatevs"); die(); } ?>

@m1
Copy link

m1 commented May 11, 2014

@jedsmith

Apache 12-regexes-per-request
In grown-up operations terms, we call that a "DoS vector," being one while(1) away from unresponsive.)

Can't tell if this is a joke or pure idiocy. Also this made me laugh:

Oh wait, if you're sticking this in your config and getting away with it, you don't have a site of note. So, never mind.

@handelaar
Copy link

handelaar commented May 12, 2014

@m1 Pay no heed. Apple's employees know everything about everything.

@jdorfman
Copy link

jdorfman commented May 12, 2014

Genius.

FWIW: If you are a MaxCDN customer you can enable this in the CP: http://blog.maxcdn.com/throttle-fcc-fight-net-neutrality/

@flipflopsimsommer
Copy link

flipflopsimsommer commented May 13, 2014

👍

@wasnertobias
Copy link

wasnertobias commented May 16, 2014

+1

@Danw33
Copy link

Danw33 commented May 21, 2014

Brilliant! Implementing this on all of my sites...

@JCron245
Copy link

JCron245 commented Dec 14, 2017

Anyone implemented this recently?

@Serkan-devel
Copy link

Serkan-devel commented Apr 8, 2018

Are those IP-ranges still correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment