Site icon Micah Hoffman's Personal Blog

Setting up an OpenVPN server in Amazon’s EC2

Amazon Instance Config

Server Config

Client Config

  • Go to a site that will tell you your current IP address (like my simple http://whatu.info/) and look at what your current IP address is.
  • Some of the client config is done in the “Server” section above. You’ll need those files (ca.crt, client.crt, client.key) on the client.
  • For the client, I’m guessing you have a Windows 7/8.x system just because I can.
  • Visit https://openvpn.net/index.php/open-source/downloads.html and download the appropriate client for your Operating System.
  • Once installed, you’ll need to launch it as an Administrator (right click and run as administrator).
  • Create a config file (*.ovpn). It needs to match the settings in the server.conf file on the server.
  • Make a Notepad/Wordpad document with the following info
  • The top of the file should have something like:

client
comp-lzo yes
dev tun1
dev-type tun
mute 10
nobind

ns-cert-type server 

persist-keypersist-tun 

port PORTTOYOURVPN
remote IPADDRESSTOYOURSYSTEM
verb 3

proto PROTOCOL(udp or tcp) 

pull

reneg-sec 86400


—–BEGIN CERTIFICATE—–
[paste your CA cert content here from ca.crt]
—–END CERTIFICATE—–

—–BEGIN CERTIFICATE—–
[paste your client cert content here from client.crt]
—–END CERTIFICATE—–

—–BEGIN RSA PRIVATE KEY—–
[paste your client key content here from client.key]
—–END RSA PRIVATE KEY—–

  • Save your file to your desktop
  • Copy/move the file to C:\Program Files\OpenVPN\config
    • You can definitely have multiple config files here, one per port/protocol (one for 53/udp and one for 443/tcp)
  • In your Windows tray (Windows 8 users need to go to their “Desktop”) you will see a grayed-out computer screen. Right click, navigate up to the configuration file that you created and select Connect.
Everything should work (the little computer icon in the tray turns green). Revisit the site that will tell you your current IP address (like my simple http://whatu.info/) and look at what your current IP address is. Should now be the Amazon one.
Exit mobile version