TOOL » LINUX » MANAGER

Firewall

Usage

Firewall daemon developed by Red Hat.

shell
firewall-cmd OPTIONS

Zone options

OptionDescription
--get-default-zonePrint default zone for connections and interfaces.
--set-default-zoneSet default zone for connections and interfaces where no zone has been selected.
--list-all-zonesList everything added for or enabled in all zones.

Options to Adapt and Query Zones and Policies

These affect only one particular zone or policy.

OptionDescription
--zoneAffect only one particular zone.
--policyAffect only one particular policy.
--add-rich-ruleAdd rich language rule.
--remove-rich-ruleRemove rich language rule.
--list-rich-rulesList rich language rules.

Direct options

Note: The direct interface has been deprecated.

OptionDescription
--direct --get-all-chainsGet all chains added to all tables.
--add-ruleAdd a rule with the given arguments.
--remove-ruleRemove a rule.
--get-all-rulesGet all rules added to all chains in all tables.

Example

Reject requests to port 80 from a defined address.

shell
firewall-cmd --zone=internal --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" port port="80" protocol="tcp" reject'