CSF Firewall Blocking VPN Internet Access

My CSF firewall seemed to be blocking internet access using my VPN. I could connect to it but could not use the internet connection. Here is a solution to the problem:

Create File

vim /etc/csf/csfpre.sh 

Insert This

iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT 
iptables -A INPUT -i eth0 -p gre -j ACCEPT 
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT 
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT 

Save File and Give Executable Permissions

chmod +x /etc/csf/csfpre.sh 

Create File

vi /etc/csf/csfpost.sh 

Input Text down

service pptpd stop 
service pptpd start 

Save File and Give Executable Permissions

chmod +x /etc/csf/csfpost.sh 

Restart CSF

csf -r

Join the conversation

1 Comment

  1. I have tried this script and similar scripts with softether vpn and it does not work – the client does not connect if the csf is running.
    Though if I start csf when the vpn connection is established, the connection does not break.
    Do you have any ideas?

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.