AMP AMP
AMP
0
AMP

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
a sample image
lawrence
asked Sep 26 2017

Answer

AMP
0
AMP

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
a sample image
arunkumarak
asked Dec 03 2017
edited Oct 05 2018
Post your Answer