Today I need to open a port on my Centos 7 box and I’m glad I know nothing but iptables which is give me ‘silent’ result 🙂 . After digging a few command from Redhat documentation I found its extremely easy.
As usual I make my note here for my future reference in case I need copy and paste method :-).
Centos 7 comes with firewalld by default. Its use firewall-cmd . For my need to open port 8082 tcp then I just need to type :
Yes, I only have ‘public’ zone.
To open port 8082 :
firewall-cmd –zone=public –add-port=8082/tcp –permanent
To check if this port (8082) is opened :
firewall-cmd –zone=public –list-all
public (default, active)
services: dhcpv6-client http ssh
ports: 3306/tcp 53/udp 8082/tcp
Yes, 8082 listed.
Very neat in my opinion 🙂
systemctl status firewalld
for check if the service (firewalld) run