Copied to clipboard

firewalld

firewalld is a firewall solution on Linux operating system. It protects computers from unauthorized access and attacks by managing network ports and services.

Example

  • Enable support for IPv4 and IPv6:

    # firewall-cmd --ipv4 --ipv6
    
  • Add specified service to specified zone:

    # firewall-cmd --add-service=http --zone=public
    
  • Add specified port/protocol to specified zone:

    # firewall-cmd --add-port=80/tcp --zone=public
    
  • List all firewall rules:

    # firewall-cmd --list-all
    
  • Get default zone:

    # firewall-cmd --get-default-zone
    
  • Reload firewall rules:

    # firewall-cmd --reload