apt-get install pptpd 

nano /etc/pptpd.conf 
localip 10.0.0.1 
remoteip 10.0.0.100-200 

nano /etc/ppp/chap-secrets 
username pptpd password * 

nano /etc/ppp/pptpd-options 
ms-dns 8.8.8.8 
ms-dns 8.8.4.4

service pptpd restart

check:
netstat -alpn | grep :1723

nano /etc/sysctl.conf
net.ipv4.ip_forward = 1

sysctl -p

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
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

# ======================== ufw ===================

ufw allow 22 
ufw allow 1723 

nano /etc/ufw/before.rules 
# NAT table rules 
*nat 
:POSTROUTING ACCEPT [0:0] 
# Allow forward traffic to eth0 
-A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE 
# Process the NAT table rules 
COMMIT 

# before the line # drop INVALID packets ... add: 
-A ufw-before-input -p 47 -j ACCEPT 

ufw disable 
ufw enable

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required