ubuntu 14.04 pptp server
PPTP Installation
$apt-get install pptpd
$nano /etc/pptpd.conf
localip 10.0.0.1
remoteip 10.0.0.100-200
$nano /etc/ppp/chap-secrets :
# Secrets for authentication using CHAP
# client server secret IP addresses
vpn89Hn pptpd oij$7H0Hp *
vpn32oA pptpd j54dsG-as *
$nano /etc/ppp/pptpd-options
ms-dns 8.8.8.8
ms-dns 8.8.4.4
Start PPTP daemon:
$service pptpd restart
Step 3 - Setup Forwarding
$ nano /etc/sysctl.conf and add the following line if it doesn’t exist there already:
net.ipv4.ip_forward = 1
To make changes active, run sysctl -p
Step 4 - Create a NAT rule for iptables
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
If you would also like your PPTP clients to talk to each other, add the following iptables rules:
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Saving/Updating your Iptables Configuration
sudo apt-get update
sudo apt-get install iptables-persistent
If you ever update your firewall and want to preserve the changes, you must save your iptables rules for them to be persistent.
Save your firewall rules with this command:
sudo invoke-rc.d iptables-persistent save