LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Open Ports In Centos 7 (https://www.linuxquestions.org/questions/linux-newbie-8/open-ports-in-centos-7-a-4175673351/)

kohshan99 04-16-2020 02:29 AM

Open Ports In Centos 7
 
i've installed CentOS Web Hosting Panel. and now how can i open these ports.

Live IP
XX.XX.XX.XX

local IP
10.12.34.19


TCP
IN: 20, 21, 22, 25, 53, 80, 110, 143, 443, 465, 587, 993, 995, 2030, 2031, 2082, 2083, 2086, 2087, 2095, 2096, 33022
OUT: 20, 21, 22, 25, 53, 80, 110, 113, 443, 2030, 2031, 2082, 2083, 2086, 2087, 2095, 2096, 587, 993, 995, 2080, 2443

UDP
IN: 20, 21, 53
OUT: 20, 21, 53, 113, 123

berndbausch 04-16-2020 03:23 AM

A simple tool for managing the firewall is firewalld.
Code:

firewall-cmd --add-port 20/tcp
However, this won't help you with ftp and other protocols that are difficult to deal with. You should use services instead:
Code:

firewall-cmd --add-service ftp
For a list of services that are built into firewalld:
Code:

firewall-cmd --get-services
You may have to install the firewalld package.

Honest Abe 04-16-2020 12:19 PM

@berndbausch, unless the OP wants to add ports for the current session only, he needs --permanent.

@kohshan99, there are numerous tutorials in google for this. This is very thorough

In a nutshell
Code:

firewall-cmd --permanent --add-port=<xx>/<tcp/udp>
firewall-cmd --reload

ideally
Code:

firewall-cmd --zone=<Your Zone> --add-port=<xx>/<tcp/udp> --permanent
firewall-cmd --reload


scasey 04-16-2020 12:25 PM

OP, have you read the CWP documentation?
It appears to be pretty clear.

(I'm presuming that if you're using CWP, you're not comfortable at the command line)

Honest Abe 04-16-2020 12:33 PM

++addendum,

@OP,enabling TCP and UDP BOTH for FTP ? why ?

Please look at firewall rich rules for better controlling In/Out rules. Rich rules are pretty same as iptable rules.

Honest Abe 04-16-2020 12:35 PM

Good catch, scasey :)

kohshan99 04-25-2020 04:11 AM

Quote:

Originally Posted by scasey (Post 6112480)
OP, have you read the CWP documentation?
It appears to be pretty clear.

(I'm presuming that if you're using CWP, you're not comfortable at the command line)

thank you very much.


All times are GMT -5. The time now is 04:05 AM.