How to Open specific port to specific IP in CSF

Opening ports and closing ports in CSF is easy. But it can be a bit tricky to open a port to a specific IP in CSF.

What if we need to open the MySQL port only to your home IP ?
[the_ad id=”11935″]

Or another port to communicate between your payment gateway ?  Here is the tip.

If you need to open the port XXXX to the ip aa.bb.cc.dd , Add the following lines to  /etc/csf/csf.allow

tcp:in:d=XXXX:d=aa.bb.cc.dd
tcp:out:d=XXXX:d=aa.bb.cc.dd

and restart csf

csf -r

So to open the mysql port to IP 11.22.33.44 , add the following lines. 

tcp:in:d=3306:d=11.22.33.44
tcp:out:d:3306:d=11.22.33.44


 

This Post Has One Comment

  1. Is it possible to allow a specific port with an IPv6 in this way? I’ve tried replacing ipv4 address with ipv6, it’s not working. I need that. Please help me.

Leave a Reply

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

Close Menu