0

How to block/open http port in firewalld commands

hello .., in centos 7 out block incoming and out going http/https access via firewalld command.

Firewalld HTTP Add a comment
lawrence
asked Sep 26 2017

Answer

0

use below command

Block the port in firewall

firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 source address=ipaddress port port=80 protocol=tcp reject'

firewall-cmd --reload

Open the port in firewall

firewall-cmd --permanent --remove-rich-rule 'rule family=ipv4 source address=ipaddress port port=80 protocol=tcp reject'

firewall-cmd --reload

Add a comment
arunkumarak
asked Dec 03 2017
edited Oct 05 2018
Post your Answer