Support for firewalld.
New in version 2015.2.0.
Bind an interface to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.add_interface zone eth0
Enable masquerade on a zone. If zone is omitted, default zone will be used.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.add_masquerade
To enable masquerade on a specific zone
salt '*' firewalld.add_masquerade dmz
Allow specific ports in a zone.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.add_port internal 443/tcp
when a zone is created ensure masquerade is also enabled on that zone.
Add port forwarding.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.add_port_fwd public 80 443 tcp
when a zone is created ensure masquerade is also enabled on that zone.
Add a rich rule to a zone
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.add_rich_rule zone 'rule'
Add a service for zone. If zone is omitted, default zone will be used.
CLI Example:
salt '*' firewalld.add_service ssh
To assign a service to a specific zone:
salt '*' firewalld.add_service ssh my_zone
Add a new port to the specified service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.add_service_port zone 80
Add a new protocol to the specified service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.add_service_protocol zone ssh
Bind a source to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.add_source zone 192.168.1.0/24
Allow a specific ICMP type on a zone
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.allow_icmp zone echo-reply
Block a specific ICMP type on a zone
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.block_icmp zone echo-reply
Print default zone for connections and interfaces
CLI Example:
salt '*' firewalld.default_zone
Delete an existing service
CLI Example:
salt '*' firewalld.delete_service my_service
By default firewalld will be reloaded. However, to avoid reloading you need to specify the restart as False
salt '*' firewalld.delete_service my_service False
Delete an existing zone
CLI Example:
salt '*' firewalld.delete_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading you need to specify the restart as False
salt '*' firewalld.delete_zone my_zone False
Print predefined icmptypes
CLI Example:
salt '*' firewalld.get_icmp_types
List interfaces bound to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.get_interfaces zone
Show if masquerading is enabled on a zone. If zone is omitted, default zone will be used.
CLI Example:
salt '*' firewalld.get_masquerade zone
List rich rules bound to a zone
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.get_rich_rules zone
List ports of a service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.get_service_ports zone
List protocols of a service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.get_service_protocols zone
Print predefined services
CLI Example:
salt '*' firewalld.get_services
List sources bound to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.get_sources zone
Print predefined zones
CLI Example:
salt '*' firewalld.get_zones
List everything added for or enabled in a zone
CLI Example:
salt '*' firewalld.list_all
List a specific zone
salt '*' firewalld.list_all my_zone
List ICMP blocks on a zone
New in version 2015.8.0.
CLI Example:
salt '*' firewlld.list_icmp_block zone
List port forwarding
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.list_port_fwd public
List all ports in a zone.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.list_ports
List services added for zone as a space separated list. If zone is omitted, default zone will be used.
CLI Example:
salt '*' firewalld.list_services
List a specific zone
salt '*' firewalld.list_services my_zone
List everything added for or enabled in all zones
CLI Example:
salt '*' firewalld.list_zones
Make current runtime configuration permanent.
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.make_permanent
Add a new service
CLI Example:
salt '*' firewalld.new_service my_service
By default firewalld will be reloaded. However, to avoid reloading you need to specify the restart as False
salt '*' firewalld.new_service my_service False
Add a new zone
CLI Example:
salt '*' firewalld.new_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading you need to specify the restart as False
salt '*' firewalld.new_zone my_zone False
Reload the firewall rules, which makes the permanent configuration the new runtime configuration without losing state information.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.reload_rules
Remove an interface bound to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.remove_interface zone eth0
Remove masquerade on a zone. If zone is omitted, default zone will be used.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.remove_masquerade
To remove masquerade on a specific zone
salt '*' firewalld.remove_masquerade dmz
Remove a specific port from a zone.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.remove_port internal 443/tcp
Remove Port Forwarding.
New in version 2015.8.0.
CLI Example:
salt '*' firewalld.remove_port_fwd public 80 443 tcp
Add a rich rule to a zone
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.remove_rich_rule zone 'rule'
Remove a service from zone. This option can be specified multiple times. If zone is omitted, default zone will be used.
CLI Example:
salt '*' firewalld.remove_service ssh
To remove a service from a specific zone
salt '*' firewalld.remove_service ssh dmz
Remove a port from the specified service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.remove_service_port zone 80
Remove a protocol from the specified service.
New in version 2016.11.0.
CLI Example:
salt '*' firewalld.remove_service_protocol zone ssh
Remove a source bound to a zone
New in version 2016.3.0.
CLI Example:
salt '*' firewalld.remove_source zone 192.168.1.0/24
Set default zone
CLI Example:
salt '*' firewalld.set_default_zone damian
Return version from firewall-cmd
CLI Example:
salt '*' firewalld.version