You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

CentOS 7

On CentOS 7, firewall-cmd is used to maintain the firewall.

List All Rules

firewall-cmd --list-all

Allow a port

This example allows a TCP port through the firewall, for all network interfaces in the "public" zone:

firewall-cmd --zone=public --add-port=3306/tcp --permanent

 

This example allows a UDP port through the firewall, for all network interfaces in the "public" zone:

firewall-cmd --zone=public --add-port=20202/udp --permanent

Reload the firewall

firewall-cmd --reload

Delete a rule

firewall-cmd --zone=public --remove-port=3306/tcp

CentOS 6

  • No labels