Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Created July 25, 2015 07:39
Show Gist options
  • Select an option

  • Save githubutilities/7f4a31ef0de9327bbfb6 to your computer and use it in GitHub Desktop.

Select an option

Save githubutilities/7f4a31ef0de9327bbfb6 to your computer and use it in GitHub Desktop.
PPTP on AWS ubuntu

PPTP on AWS ubuntu

apt-get install ppp
apt-get install pptpd

# backup configuration
cp /etc/pptpd.conf /etc/pptpd.conf.bak
cp /etc/ppp/pptpd-options /etc/ppp/pptpd-options.bak
cp /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak
cp /etc/sysctl.conf /etc/sysctl.conf.bak

# Get the ip address of `eth0` interface
IP_ADDRESS=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

# Config `pptpd` and `ppp`
vim /etc/pptpd.conf 
vim /etc/ppp/pptpd-options 
vim /etc/ppp/chap-secrets

# enable IP forwarding
vim sysctl.conf
sysctl -p

sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to $IP_ADDRESS

/etc/init.d/pptpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment