linux

routing rules for Netflix to bypass your VPN

Its great to send all your traffic through a VPN to protect your privacy. Unfortunately, Netflix will stop working. Here is a script to set up routes for all of Netflix’s IP ranges.

In this example, 192.168.1.1 is the network gateway. I call this using an ‘ifup’ script from OpenVPN. If you know how to do this without using the temporary file let me know!

whois -h whois.radb.net -- '-i origin AS2906' | grep -Eo '([0-9.]+){4}/[0-9]+'|sort|uniq > /root/tmp.txt
for i in `cat /tmp/nfips.txt`; do
	ip route add $i via 192.168.1.1
done