I installed this VPN script on a CentOS 7 WHM system with CSF
https://github.com/hwdsl2/setup-ipsec-vpn
While I am able to connect to the VPN successfully, I cannot connect to any website or service over the VPN until I execute this command via SSH
systemctl restart iptables
But if I execute above command, it ignores csf.deny IP addresses. So I go and restart the CSF and I'm back to the previous paragraph scenario.
Appreciate any assistance on how to get the two to coexist. I have whitelisted my IP address on csf.allow as well to no avail
hwdsl2 ipsec VPN does not work when CSF is activated
-
- Junior Member
- Posts: 2
- Joined: 10 Mar 2023, 06:31
-
- Junior Member
- Posts: 2
- Joined: 10 Mar 2023, 06:31
Re: hwdsl2 ipsec VPN does not work when CSF is activated
Here's what I tried and appears to work, I think.
and add
Replace "192.168.42.0/24" and "eth0" as needed. You can get the values from "nano /etc/sysconfig/iptables"
Code: Select all
nano /etc/csf/csfpre.sh
Code: Select all
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 192.168.42.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.42.0/24 -o eth0 -j MASQUERADE