Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Open Port for Specific IP Address in CSF?

Discussion in 'Security' started by Jr Sarath, Oct 14, 2017.

  1. Jr Sarath

    Jr Sarath Member

    Joined:
    Oct 13, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,
    i wanted to open port for a specific Ip
    i use this at csf.allow
    tcp:in:d=3306:s=151.236.33.9
    tcp:in:d=27015:s=151.236.33.9
    tcp:in:d=27016:s=151.236.33.9
    tcp:in:d=27017:s=151.236.33.9
    tcp:in:d=27018:s=151.236.33.9
    tcp:in:d=27019:s=151.236.33.9

    and restarted CSF +LFD

    but still Port is being blocked I'm kinda newbie so help me please
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    720
    Likes Received:
    123
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    You were right but use | instead of :

    tcp|in|d=3306|s=151.236.33.9
    tcp|in|d=27015|s=151.236.33.9
    tcp|in|d=27016|s=151.236.33.9
    tcp|in|d=27017|s=151.236.33.9
    tcp|in|d=27018|s=151.236.33.9
    tcp|in|d=27019|s=151.236.33.9
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Jr Sarath

    Jr Sarath Member

    Joined:
    Oct 13, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    not working, :(

    do I need to open those ports globally first?
    Like using CSF.CONF's TCP_IN, TCP_OUT, UDP_IN, UDP_OUT ?
     
  4. Muhammed Fasal

    Muhammed Fasal Active Member

    Joined:
    Aug 9, 2017
    Messages:
    39
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    I will show you how to open Port for Specific IP Address in CSF via Commandline:

    1. Login to SSH.
    2. Open /etc/csf/csf.allow in your preferred text editor. For the sake of this tutorial I'll be using nano.
    3. Add your rules to this file, one per line.
    • We'll be adding lines in the same format as tcp/udp|in/out|s/d=port|s/d=ip.

    tcp|in|d=3306|s=151.236.33.9
    tcp|in|d=27015|s=151.236.33.9
    tcp|in|d=27016|s=151.236.33.9
    tcp|in|d=27017|s=151.236.33.9
    tcp|in|d=27018|s=151.236.33.9
    tcp|in|d=27019|s=151.236.33.9​

    4. Save the file. If you're in nano, use ^X (Ctrl+X) and tell it "Y" to overwrite the file.
    5. Restart CSF using csf -r.

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Please understand that CSF is not provided or supported by cPanel. You may find the best support at CSF forums:
    ConfigServer Community Forum - Index page

    My understanding is that entries in `csf.allow' will override '*_IN' and '*_OUT' settings in `csf.conf'.

    Muhammed's suggestions should help resolve your issue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Jr Sarath

    Jr Sarath Member

    Joined:
    Oct 13, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    well I will like to let you guys know that
    any of above solutions are not working I already tried them thousands of time,
    so that's why I'm here for a solution

    tcp|in|d=3306|s=151.236.33.9
    tcp|in|d=27015|s=151.236.33.9
    tcp|in|d=27016|s=151.236.33.9
    tcp|in|d=27017|s=151.236.33.9
    tcp|in|d=27018|s=151.236.33.9
    tcp|in|d=27019|s=151.236.33.9

    isn't working at any cost
     
  7. Jr Sarath

    Jr Sarath Member

    Joined:
    Oct 13, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Doesn't works
    tried earlier too
     
  8. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Jr Sarath

    Jr Sarath Member

    Joined:
    Oct 13, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    I wish they could respond like you, they didn't responded since last 2 days,
    anyways I have another enquiry to do,
    cPanel remote MySQL
    do i need to open port 3306 via Firewall to enable remote sql ?
    coz adding host ip into user cPanel isn't working,
    i also clicked on "Click here" button on additional MySQL host in WHM
     
  10. Muhammed Fasal

    Muhammed Fasal Active Member

    Joined:
    Aug 9, 2017
    Messages:
    39
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Yes, you need to open 3306 port on your server firewall (CSF) inorder to access the database remotely.

    Regarding CSF port issue, sorry to hear that you are still having issues, you can contact CSF support to resolve this issue as @cPWilliamL mentioned.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice