Difference between revisions of "Red Hat / Centos firewall"

From MyWiki
Jump to: navigation, search
Line 1: Line 1:
 
<source lang="text">
 
<source lang="text">
  
Try this command
+
Try this command
  
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" \
+
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" \
source address="1.2.3.4/32" \
+
source address="1.2.3.4/32" \
port protocol="tcp" port="4567" accept"
+
port protocol="tcp" port="4567" accept"
  
Check the zone file later to inspect the XML configuration
+
Check the zone file later to inspect the XML configuration
  
cat /etc/firewalld/zones/public.xml
+
cat /etc/firewalld/zones/public.xml
  
shareimprove this answer
+
shareimprove this answer
  
 
</source>
 
</source>

Revision as of 15:44, 29 July 2015

Try this command
 
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" \
source address="1.2.3.4/32" \
port protocol="tcp" port="4567" accept"
 
Check the zone file later to inspect the XML configuration
 
cat /etc/firewalld/zones/public.xml
 
shareimprove this answer