Skip to content

Instantly share code, notes, and snippets.

@dctanner
Created August 5, 2008 00:20
Show Gist options
  • Save dctanner/3997 to your computer and use it in GitHub Desktop.
Save dctanner/3997 to your computer and use it in GitHub Desktop.
ec2-run-instances ami-2bb65342 -k gsg-keypair
ssh -i ~/.ec2/id_rsa-gsg-keypair [email protected]
On EC2
---
yum install -y openvpn
modprobe tun
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.4.0.1/2 -o eth0 -j MASQUERADE
openvpn --genkey --secret /mnt/secret.key
openvpn --proto udp --port 1194 --dev tun --ifconfig 10.4.0.1 10.4.0.2 --verb 1 --secret /mnt/secret.key --push "redirect-gateway def1" --push "dhcp-option DNS 172.16.0.23"
On local box
---
ec2-authorize default -p 22
ec2-authorize default -p 1194 -P udp
Get http://code.google.com/p/tunnelblick/
vi Library/openvpn/openvpn.conf
dev tun
proto udp
port 1194
remote ec2-67-202-32-198.compute-1.amazonaws.com
ifconfig 10.4.0.2 10.4.0.1
secret /Users/dctanner/.secret.key
redirect-gateway def1
persist-key
persist-tun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment