Linode の Ubuntu へ VPN 接続して Hulu を見る
見れました。いろいろな番組が見れるのでびっくり。Lost とか 24 とかいろいろ。。。
OpenVPN サーバーをインストール
$ sudo apt-get install openvpn
まずは、まずは設定ファイルのひな形や生成スクリプトなどをコピーします。
$ cd /etc/openvpn $ sudo cp -pr /usr/share/doc/openvpn/examples/easy-rsa/2.0 ./easy-rsa
CA を生成するための情報を作成します。以下は自分用に設定した内容です。
$ cd easy-rsa $ sudo vim vars ...省略... export KEY_COUNTRY="JP" export KEY_PROVINCE="Kanagawa" export KEY_CITY="Fujisawa" export KEY_ORG="bonnoudotocom" export KEY_EMAIL="kikuchi@bonnou.com" ...省略...
証明書の生成など
$ sudo chown -R root:admin . $ sudo sudo chmod g+w . $ source ./vars $ ./clean-all $ ./build-dh $ ./pkitool --initca $ ./pkitool --server server $ cd keys $ sudo cp server.crt server.key ca.crt dh1024.pem ta.key /etc/openvpn
クライアントからの通信をサーバーのデフォルトルートへリダイレクトさせる設定を有効にする
$ sudo vim /etc/openvpn/server.conf ...省略... # If enabled, this directive will configure # all clients to redirect their default # network gateway through the VPN, causing # all IP traffic such as web browsing and # and DNS lookups to go through the VPN # (The OpenVPN server machine may need to NAT # or bridge the TUN/TAP interface to the internet # in order for this to work properly). push "redirect-gateway def1 bypass-dhcp" # <<<<< この行をコメントアウトする ...省略...
OpenVPN サーバーを起動する
$ sudo /etc/init.d/openvpn start
Ubuntu で OpenVPN クライアントの通信を NAT するように設定
$ sudo vim /etc/sysctl.conf ...省略... # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1 # <<<<< この行をコメントアウトする ...省略... $ sudo sysctl -p $ sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
MacBook に Tunnelblick をインストール