Home » Software Applications » Running PPTP VPN with CSF firewall

Running PPTP VPN with CSF firewall

Most of the time pptp vpn doesnt work with csf firewall. Here is the guide to make it working.

1) type the following command:
nano /etc/csf/csfpre.sh
2) Put the following into the file:
iptables -A INPUT -i venet0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i venet0 -p gre -j ACCEPT
iptables -A OUTPUT -p gre -j ACCEPT
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s -j SNAT --to-source ww.xx.yy.zz
iptables -A FORWARD -i ppp+ -o venet0 -j ACCEPT
iptables -A FORWARD -i venet0 -o ppp+ -j ACCEPT
Note: ww.xxy… is your VPS/server ip , is the ip you allocated to the pptp

3) Type:
nano /etc/csf/csfpost.sh
4) Put the following there:
service pptpd stop
service pptpd start

Restart your VPS , connect to it and enjoy. Also make sure your 1723 port is open in Csf

Originally posted 2016-02-04 19:40:27.

About admin

I have been working with Linux based systems since 2002. I hope the article published on this site will be useful to those new to server administration.