Skip to content

Instantly share code, notes, and snippets.

@lin
Last active April 7, 2016 04:59
Show Gist options
  • Select an option

  • Save lin/8fd522b30d9b80735ce90d3189a3b059 to your computer and use it in GitHub Desktop.

Select an option

Save lin/8fd522b30d9b80735ce90d3189a3b059 to your computer and use it in GitHub Desktop.
VPN set up with aws ubuntu

Based on this article

Also this article

apt-get update

Install pptpd

sudo apt-get install pptpd

Open config file

sudo vi /etc/pptpd.conf # open config

Add these two lines at the bottom of file

localip 192.168.9.1
remoteip 192.168.9.11-30

Also uncomment this line!

# logwtmp

Open /etc/ppp/options.pptpd

sudo vi /etc/ppp/options.pptpd

Add this line to the top

ms-dns 8.8.8.8 ms-dns 8.8.4.4

Open /etc/ppp/chap-secrets

sudo vi /etc/ppp/chap-secrets

Add this line to the top

<username> pptpd <passwd> *

Open /etc/sysctl.conf

sudo vi /etc/sysctl.conf

Uncomment this line.

net.ipv4.ip_forward=1

Run this command to reload config

sudo /sbin/sysctl -p

Start iptables

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

For reboot

sudo vi /etc/rc.local

Add this line before exit 0

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Restart pptpd

sudo /etc/init.d/pptpd restart

Remember to open port 1723 on EC2 instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment