Skip to content

Instantly share code, notes, and snippets.

@adeel
Created September 25, 2011 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adeel/1240589 to your computer and use it in GitHub Desktop.
Save adeel/1240589 to your computer and use it in GitHub Desktop.
Null-route Facebook netblocks
#!/usr/bin/env python2
# http://bgp.he.net/AS32934#_prefixes
import os
netblocks = [
"31.13.24.0/21",
"66.220.144.0/21",
"66.220.152.0/21",
"69.63.176.0/21",
"69.63.176.0/24",
"69.63.184.0/21",
"69.171.224.0/20",
"69.171.239.0/24",
"69.171.240.0/20",
"69.171.255.0/24",
"74.119.76.0/22",
"173.252.64.0/19",
"173.252.70.0/24",
"204.15.20.0/22"]
for n in netblocks:
os.popen("sudo route add -net %s 127.0.0.1 -blackhole" % n).read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment