<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>langui.sh &#187; vpn</title>
	<atom:link href="http://langui.sh/tag/vpn/feed/" rel="self" type="application/rss+xml" />
	<link>http://langui.sh</link>
	<description>Fun hacks, WP plugins, photography, and PKI junk.  Languishing since 2008.</description>
	<lastBuildDate>Tue, 17 Jan 2012 20:23:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Bypass Hulu Regional Restrictions in Mac OS X</title>
		<link>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/</link>
		<comments>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:18:55 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[hulu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=780</guid>
		<description><![CDATA[<a href="http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/" title="Bypass Hulu Regional Restrictions in Mac OS X"></a>Hulu is a great site to find new shows and catch up on old, but due to various contracts no one outside the US can use it. This irritated some friends of mine from Canada, England, Germany, et cetera. So &#8230;<p class="read-more"><a href="http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/" title="Bypass Hulu Regional Restrictions in Mac OS X"></a><p>Hulu is a great site to find new shows and catch up on old, but due to various contracts no one outside the US can use it.  This irritated some friends of mine from Canada, England, Germany, et cetera.  So I decided to write up one (very reliable) way to circumvent the Hulu geolocation checks &#8212; using a VPN.<sup class='footnote'><a href='#fn-780-1' id='fnref-780-1'>1</a></sup></p>
<h3>Accessing Hulu Outside The US</h3>
<p>In this case, we&#8217;ll be using a small VM and the open source VPN server pptpd.  All the server side instructions below are applicable to both OS X and Windows, but the client setup is only specified for Mac OS X.</p>
<h3>Server Setup</h3>
<p>First, obtain a VM from a reputable (and fast) US vendor.  The VM must be located in the US since that&#8217;s our required origin.  I personally use <a href="http://www.slicehost.com">Slicehost</a>, but there are many others.  Once you get your login be sure you change the root password.</p>
<p>Install pptpd.  If you&#8217;re running on Ubuntu or Debian you can simply run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> pptpd</pre></div></div>

<p>Once you have pptpd installed, we&#8217;ll need to add a user.  The default pptpd configuration is fine, but we&#8217;ll need to edit /etc/ppp/chap-secrets. When you edit the file (using vi, nano, emacs, et cetera) you&#8217;ll see this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Secrets for authentication using CHAP</span>
<span style="color: #666666; font-style: italic;"># client        server  secret                  IP addresses</span></pre></div></div>

<p>Client is your username, server is &#8220;pptpd&#8221;, secret is your password in plaintext, and IP addresses is a range of allowed IPs.  If you&#8217;re unconcerned about who might attempt to access your VPN, you can simply use a wildcard (*).  Once you&#8217;ve populated this file with data it will look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Secrets for authentication using CHAP</span>
<span style="color: #666666; font-style: italic;"># client	server	secret			IP addresses</span>
testuser	pptpd	mypassword		<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>We need to set up IPv4 forwarding, so edit /etc/sysctl.conf and uncomment the line below from the file (remove the #).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#net.ipv4.ip_forward=1</span></pre></div></div>

<p>This will enable the behavior after a reboot, but you can enable it right now by running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward</pre></div></div>

<p>Now run these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">-o</span> eth0 <span style="color: #660033;">-j</span> MASQUERADE
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-o</span> ppp0 <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> RELATED,ESTABLISHED <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> ppp0 <span style="color: #660033;">-o</span> eth0 <span style="color: #660033;">-j</span> ACCEPT</pre></div></div>

<p>Once you&#8217;ve run these you can save them so they execute every time your VM boots by following <a href="http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/">these quick instructions</a>.  This completes the server side setup.</p>
<h3>Client Setup</h3>
<p>Now it&#8217;s time to configure the Mac to utilize the VPN server.  Bear in mind that all traffic to the internet will be routed through your VPN server when this is active, so you&#8217;ll only want to connect to your VPN when watching Hulu.<sup class='footnote'><a href='#fn-780-2' id='fnref-780-2'>2</a></sup></p>
<p>Open System Preferences and go to Network.  Click the plus sign in the lower left and choose add to add a VPN PPTP interface.  Then set the server address (the IP of your VM) and account name (&#8220;testuser&#8221; from above).<br />
<a href="http://cdn.langui.sh/2009/11/network_screen.png"><img class="alignnone size-medium wp-image-836" title="network_screen" src="http://cdn.langui.sh/2009/11/network_screen-300x264.png" alt="network_screen" width="300" height="264" /></a></p>
<p>After filling out those fields, click authentication settings and type your password, then click Okay.</p>
<p><a href="http://cdn.langui.sh/2009/11/network_screen.png"></a><a href="http://cdn.langui.sh/2009/11/advanced.png"><img style="border: 0px initial initial;" title="advanced" src="http://cdn.langui.sh/2009/11/advanced-300x185.png" alt="advanced" width="300" height="185" /></a></p>
<p>Finally, click advanced, then click DNS and click the plus sign.  Add 4.2.2.1 as a DNS server.<sup class='footnote'><a href='#fn-780-3' id='fnref-780-3'>3</a></sup></p>
<p><a href="http://cdn.langui.sh/2009/11/advanced.png"></a><a href="http://cdn.langui.sh/2009/11/dns_fix.png"><img style="border: 0px initial initial;" title="dns_fix" src="http://cdn.langui.sh/2009/11/dns_fix-300x234.png" alt="dns_fix" width="300" height="234" /></a></p>
<p>Save these changes and then you can click connect to test it out.  Your traffic should all be routed through the VPN and since the endpoint is located in the US Hulu should work just fine!</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-780-1'>There are many other ways, including just proxying Hulu traffic from the browser and Flash plugin, but I&#8217;m not going to cover those methods. <span class='footnotereverse'><a href='#fnref-780-1'>&#8617;</a></span></li>
<li id='fn-780-2'> This can be alleviated by using a split tunnel if you want to go to the trouble. <span class='footnotereverse'><a href='#fnref-780-2'>&#8617;</a></span></li>
<li id='fn-780-3'>Our PPTP server doesn&#8217;t announce its own DNS by default. <span class='footnotereverse'><a href='#fnref-780-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 4/15 queries in 0.005 seconds using memcached
Object Caching 416/435 objects using memcached

Served from: langui.sh @ 2012-02-07 06:27:51 -->
