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, 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 -- '-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