Page 1 of 1

change command iptables to csf

Posted: 01 Oct 2018, 11:13
by 3245
Hello,
i have two line code for iptables for allow just a range ip for able check my port, cause i have a backend ip (reverse proxy), and i dont want anyone able detect it (for secure against ddos and etc)

its below, but when i installed CSF, iptables disabled, so i want know how i can run this two command on CSF?

iptables -I INPUT -p tcp -m multiport --dports http,https -s 186.2.160.0/24 -j ACCEPT
iptables -I INPUT -p tcp -m multiport --dports http,https -s 77.220.207.192/26 -j ACCEPT

Thanks.

Re: change command iptables to csf

Posted: 13 Oct 2018, 02:31
by Black Tiger
If you want to run them after csf has run, then create a file called /etc/csf/csfpost.sh and add the lines in there.

If you want them applied before CSF runs, create a file called /etc/csf/csfpre.sh and add the lines in there.

In both cases you ofcourse have to restart csf after creating or changing them.