• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

A cPanel Tech

The Diaries of a Linux Server Administrator

  • Home
  • About
  • Privacy
You are here: Home / Control Panels / How to Open specific port to specific IP in CSF

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/cptech/public_html/wp-content/themes/genesis/lib/functions/image.php on line 116

How to Open specific port to specific IP in CSF

June 7, 2013 By admin 1 Comment

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


 

Filed Under: Control Panels

Reader Interactions

Comments

  1. Abhik Bose says

    December 1, 2016 at 7:28 pm

    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.

    Reply

Leave a Reply Cancel reply

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.

Primary Sidebar

Copyright 2018 CPanelTech