MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: How to Open Ports In Your Firewall ?  (Read 6954 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
How to Open Ports In Your Firewall ?
« on: September 17, 2014, 05:49:06 PM »
Hell Guys,

Usually its depends on the Firewall is installed on your server, I have covered the several ways to do this.

APF :-

APF can only be configured by accessing the server over ssh, as the root user. Open the following file in your favorite text editor. Here I am using vi editor.

Quote
#vi /etc/apf/conf.apf

Find the following line.

Quote
# Common inbound (ingress) TCP ports
IG_TCP_CPORTS="20,21,22,25,53,80,110,143,443,465,993,995"

After adding port, save and close your text editor, you will need to restart APF. Fire below command.

Quote
#apf -r


CSF :-

CSF can be configured in Web Host Manager (WHM) as well as over ssh, as the root user.

Open up the following file and and add the port you need to open.

Quote
#vi /etc/csf/csf.conf

Quote
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,26"
# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,37,43,53,80,110,113,443,587,873"

You can also open UDP and ICMP port as well.

Then you need to restart the CSF for change to take effect.

Quote
# csf -r

From WHM :-

In WHM go to Home >> Plugins >> ConfigServer Security&Firewall. On that page, click on the Firewall Configuration button.

Find for the same Field TCP_IN and TCP_OUT and the IP address into it. tTen click Changeat the bottom of the page to save your changes.

You will need to restart csf. Next screen you will see a button Restart csf+lfd. Click on this button.

That's all, hope this post will help you.

Note :- To add the port range you use the colon : to specify the port range in between from and to. E.g 1000:2000

Enjoy !!
« Last Edit: October 02, 2014, 08:42:26 PM by Dipak Bhoi »
MilesWeb.com - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India.
Grab a Free SSL for your website.  WordPress Optimized Solution.

MilesWeb Hosting Forum

How to Open Ports In Your Firewall ?
« on: September 17, 2014, 05:49:06 PM »