FIREWALL-OFFLINE-C(1)
๐ NAME ๐
firewall-offline-cmd โ firewalld offline command line client. periodt. โจ
๐ฆ SYNOPSIS ๐ฆ
firewall-offline-cmd [OPTIONS...]
๐ธ DESCRIPTION ๐ธ
okay so firewall-offline-cmd is the offline command line client for the firewalld daemon. bestie, you should only use it when the firewalld service is not running ๐. like, for example, to migrate from system-config-firewall/lokkit or in the install environment to configure firewall settings with kickstart.
some lokkit options can't be automatically converted, and they'll throw an error or warning at you ๐ญ. this tool tries to convert as much as possible, but there are limitations โ for example with custom rules, modules, and masquerading.
Check the firewall configuration after using this tool! ๐
โจ OPTIONS โจ
if you give no options at all, the config from /etc/sysconfig/system-config-firewall gets migrated. ๐
sequence options are the ones you can specify multiple times. the exit code is 0 if at least one item succeeded. the ALREADY_ENABLED (11), NOT_ENABLED (12), and ZONE_ALREADY_SET (16) errors are treated as succeeded. if there are issues while parsing the items, those are treated as warnings and won't change the result as long as there's a succeeded one. without any succeeded item, the exit code depends on the error codes. exactly one error code? that one is used. more than one? UNKNOWN_ERROR (254) is used. ๐ค
the following options are supported:
๐ General Options ๐
-h,--helpโ prints a short help text and exits ๐-V,--versionโ prints the version string of firewalld and exits โจ-q,--quietโ do not print status messages ๐คซ--default-configโ path to firewalld default configuration. this usually defaults to/usr/lib/firewalld๐--system-configโ path to firewalld system (user) configuration. this usually defaults to/etc/firewalld๐
๐ Status Options ๐
--enabledโ enable the firewall. this option is a default option and will activate the firewall if not already enabled as long as the option--disabledis not given ๐ฅ--disabledโ disable the firewall by disabling the firewalld service ๐--check-configโ run checks on the permanent (default and system) configuration. this includes XML validity and semantics. this may be used with--system-configto check the validity of handwritten configuration files before copying them to the standard location ๐โ--reset-to-defaultsโ reset configuration to firewalld's default configuration ๐
๐ Lokkit Compatibility Options ๐
these options are nearly identical to the options of lokkit. iykyk ๐
--migrate-system-config-firewall=fileโ migrate system-config-firewall configuration from the given file. No further ๐คท--addmodule=moduleโ this option will result in a warning message and will be ignored. handling of netfilter helpers has been merged into services completely. adding or removing netfilter helpers outside of services is therefore not needed anymore. for more information on handling netfilter helpers in services, please have a look atfirewalld.zone(5). ๐--removemoduleโ this option will result in a warning message and will be ignored. handling of netfilter helpers has been merged into services completely. adding or removing netfilter helpers outside of services is therefore not needed anymore. for more information on handling netfilter helpers in services, please have a look atfirewalld.zone(5). ๐--remove-service=serviceโ remove a service from the default zone. this option can be specified multiple times. the service is one of the firewalld provided services. to get a list of the supported services, usefirewall-cmd --get-servicesโจ-s service, --service=serviceโ add a service to the default zone. this option can be specified multiple times. the service is one of the firewalld provided services. to get a list of the supported services, usefirewall-cmd --get-services๐-p portid[-portid]:protocol, --port=portid[-portid]:protocolโ add the port to the default zone. this option can be specified multiple times. the port can either be a single port number or a port rangeportid-portid. the protocol can either betcp,udp,sctp, ordccp๐-t interface, --trust=interfaceโ this option will result in a warning message. mark an interface as trusted. this option can be specified multiple times. the interface will be bound to the trusted zone. if the interface is used in a NetworkManager managed connection or if there is an ifcfg file for this interface, the zone will be changed to the zone defined in the configuration as soon as it gets activated. to change the zone of a connection usenm-connection-editorand set the zone to trusted, for an ifcfg file, use an editor and add"ZONE=trusted". if the zone is not defined in the ifcfg file, the firewalld default zone will be used. ๐-m interface, --masq=interfaceโ this option will result in a warning message. masquerading will be enabled in the default zone. the interface argument will be ignored. this is for IPv4 only. ๐ก--custom-rules=[type:][table:]filenameโ this option will result in a warning message and will be ignored. custom rule files are not supported by firewalld. ๐--forward-port=if=interface:port=port:proto=protocol[:toport=destination port:][:toaddr=destination address]โ this option will result in a warning message. add the IPv4 forward port in the default zone. this option can be specified multiple times. the port can either be a single port numberportidor a port rangeportid-portid. the protocol can either betcp,udp,sctp, ordccp. the destination address is an IP address. ๐--block-icmp=icmptypeโ this option will result in a warning message. add an ICMP block for icmptype in the default zone. this option can be specified multiple times. the icmptype is one of the icmp types firewalld supports. to get a listing of supported icmp types:firewall-cmd --get-icmptypes๐
๐ Log Denied Options ๐
--get-log-deniedโ print the log denied setting. ๐--set-log-denied=valueโ add logging rules right before reject and drop rules in the INPUT, FORWARD and OUTPUT chains for the default rules and also final reject and drop rules in zones for the configured link-layer packet type. the possible *value*s are:all,unicast,broadcast,multicast, andoff. the default setting isoff, which disables the logging. this is a runtime and permanent change and will also reload the firewall to be able to add the logging rules. ๐ฅ
๐ Zone Options ๐
--get-default-zoneโ print default zone for connections and interfaces. ๐--set-default-zone=zoneโ set default zone for connections and interfaces where no zone has been selected. setting the default zone changes the zone for the connections or interfaces that are using the default zone. ๐--get-zonesโ print predefined zones as a space separated list. โจ--get-servicesโ print predefined services as a space separated list. ๐--get-icmptypesโ print predefined icmptypes as a space separated list. ๐--get-zone-of-interface=interfaceโ print the name of the zone the interface is bound to orno zone. ๐คท--get-zone-of-source=source[/mask]|MAC|ipset:ipsetโ print the name of the zone the source is bound to orno zone. ๐--info-zone=zoneโ print information about the zone zone. the output format is:
zone
interfaces: interface1 ..
sources: source1 ..
services: service1 ..
ports: port1 ..
protocols: protocol1 ..
forward-ports:
forward-port1
..
source-ports: source-port1 ..
icmp-blocks: icmp-type1 ..
rich rules:
rich-rule1
..
--list-all-zonesโ list everything added for or enabled in all zones. the output format is:
zone1
interfaces: interface1 ..
sources: source1 ..
services: service1 ..
ports: port1 ..
protocols: protocol1 ..
forward-ports:
forward-port1
..
source-ports: source-port1 ..
icmp-blocks: icmp-type1 ..
rich rules:
rich-rule1
..
..
--new-zone=zoneโ add a new permanent zone. zone names must be alphanumeric and may additionally include characters:_and-. โจ--new-zone-from-file=filename [--name=zone]โ add a new permanent zone from a prepared zone file with an optional name override. ๐--path-zone=zoneโ print path of the zone configuration file. ๐--delete-zone=zoneโ delete an existing permanent zone. ๐๏ธ
๐ง Policy Options ๐ง
--get-policiesโ print predefined policies as a space separated list. ๐--info-policy=policyโ print information about the policy policy. ๐--list-all-policiesโ list everything added for or enabled in all policies. ๐--new-policy=policyโ add a new permanent policy. policy names must be alphanumeric and may additionally include characters:_and-. โจ--new-policy-from-file=filename [--name=policy]โ add a new permanent policy from a prepared policy file with an optional name override. ๐--path-policy=policyโ print path of the policy configuration file. ๐--delete-policy=policyโ delete an existing permanent policy. ๐๏ธ--load-policy-defaults=policyโ load the shipped defaults for a policy. only applies to policies shipped with firewalld. does not apply to user defined policies. ๐ซ
๐ Options to Adapt and Query Zones and Policies ๐
options in this section affect only one particular zone or policy. if used with --zone=zone or --policy=policy option, they affect the specified zone or policy. if both options are omitted, they affect the default zone (see --get-default-zone). ๐ฏ
[--zone=zone] [--policy=policy] --list-allโ list everything added or enabled. ๐[--zone=zone] [--policy=policy] --get-targetโ get the target. ๐ฏ[--zone=zone] [--policy=policy] --set-target=targetโ set the target. for zones target is one of:default,ACCEPT,DROP,REJECT. for policies target is one of:CONTINUE,ACCEPT,DROP,REJECT.defaultis similar toREJECT, but it implicitly allows ICMP packets. ๐ฆ
ACCEPT lets traffic be forwarded out of the zone โ either to the same zone or off to other zones, doesn't matter, it's all allowed. ๐
[--zone=zone] [--policy=policy] --set-description=descriptionโ sets the description. yes bestie, it's just a description. โ๏ธ[--zone=zone] [--policy=policy] --get-descriptionโ prints the description out loud.[--zone=zone] [--policy=policy] --set-short=descriptionโ sets the short description (the little one, the mini me).[--zone=zone] [--policy=policy] --get-shortโ prints that short description.[--zone=zone] [--policy=policy] --list-servicesโ lists every service as a space separated list. one long line of vibes.[--zone=zone] [--policy=policy] --add-service=serviceโ adds a service. you can throw this option in as many times as you want, it stacks. ๐ซถ
The service has to be one of the services firewalld ships with. wanna see the whole roster? run firewall-cmd --get-services.
Note: some services define connection tracking helpers, and helpers that might operate in client mode (like tftp) have to be added to an outbound policy, not a zone, if you want them to actually work for clients. otherwise the helper just won't get applied to the outbound traffic. the related traffic โ the stuff the connection tracking helper defines โ does get allowed on the return path (ingress) by the stateful firewall rules, so at least there's that. ๐
Here's what an outbound policy for connection tracking helpers looks like:
# firewall-cmd --new-policy clientConntrack
# firewall-cmd --policy clientConntrack --add-ingress-zone HOST
# firewall-cmd --policy clientConntrack --add-egress-zone ANY
# firewall-cmd --policy clientConntrack --add-service tftp
[--zone=zone] --remove-service-from-zone=serviceโ removes a service from a zone. can be specified multiple times. if you skipzone, the default zone gets used. ๐[--policy=policy] --remove-service-from-policy=serviceโ removes a service from a policy. can be specified multiple times.[--zone=zone] [--policy=policy] --query-service=serviceโ tells you whether that service has been added. returns0if true,1otherwise.[--zone=zone] [--policy=policy] --list-portsโ lists the ports as a space separated list. a port looks likeportid[-portid]/protocol, so it's either a port-and-protocol pair or a port range with a protocol. ๐[--zone=zone] [--policy=policy] --add-port=portid[-portid]/protocolโ adds the port. can be specified multiple times.
The port can be a single port number or a port range portid-portid. The protocol can be tcp, udp, sctp or dccp.
[--zone=zone] [--policy=policy] --remove-port=portid[-portid]/protocolโ removes the port. can be specified multiple times.[--zone=zone] [--policy=policy] --query-port=portid[-portid]/protocolโ tells you whether that port has been added. returns0if true,1otherwise.[--zone=zone] [--policy=policy] --list-protocolsโ lists the protocols as a space separated list.[--zone=zone] [--policy=policy] --add-protocol=protocolโ adds the protocol. can be specified multiple times. okay and then the page just casually drops this in the middle with zero context:timevalis either a number (of seconds) or a number followed by one of the characterss(seconds),m(minutes),h(hours), for example20mor1h. ๐ญ i'm not gonna pretend that makes sense here, i'm just telling you what it says.
The protocol can be any protocol your system supports. go peek at /etc/protocols for the supported list. ๐ฆ
[--zone=zone] [--policy=policy] --remove-protocol=protocolโ removes the protocol. can be specified multiple times.[--zone=zone] [--policy=policy] --query-protocol=protocolโ tells you whether that protocol has been added. returns0if true,1otherwise.[--zone=zone] [--policy=policy] --list-icmp-blocksโ lists the Internet Control Message Protocol (ICMP) type blocks as a space separated list. โจ[--zone=zone] [--policy=policy] --add-icmp-block=icmptypeโ adds an ICMP block foricmptype. can be specified multiple times.
The icmptype is one of the icmp types firewalld supports. want the full list? firewall-cmd --get-icmptypes.
[--zone=zone] [--policy=policy] --remove-icmp-block=icmptypeโ removes the ICMP block foricmptype. can be specified multiple times.[--zone=zone] [--policy=policy] --query-icmp-block=icmptypeโ tells you whether an ICMP block foricmptypehas been added. returns0if true,1otherwise.[--zone=zone] [--policy=policy] --list-forward-portsโ lists the IPv4 forward ports as a space separated list.
For IPv6 forward ports, bestie, you gotta use the rich language. ๐
--add-forward-port
[--zone=zone] [--policy=policy]
--add-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]
Adds the IPv4 forward port. can be specified multiple times.
The port can be a single port number portid or a port range portid-portid. The protocol can be tcp, udp, sctp or dccp. The destination address is a simple IP address.
For IPv6 forward ports, use the rich language.
Note: IP forwarding gets implicitly enabled if toaddr is specified. no asking, it just happens. ๐ฅ
Note: when this option is used with--policy, it's impossible for the firewall backend to figure out the egress zone. go read the section UNKNOWN DESTINATIONS infirewall-cmd(1)for the whole story.
--remove-forward-port
[--zone=zone] [--policy=policy]
--remove-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]
Removes the IPv4 forward port. can be specified multiple times.
For IPv6 forward ports, use the rich language.
--query-forward-port
[--zone=zone] [--policy=policy]
--query-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]
Tells you whether that IPv4 forward port has been added. returns 0 if true, 1 otherwise.
For IPv6 forward ports, use the rich language.
[--zone=zone] [--policy=policy] --list-source-portsโ lists the source ports as a space separated list. a port looks likeportid[-portid]/protocol.[--zone=zone] [--policy=policy] --add-source-port=portid[-portid]/protocolโ adds the source port. can be specified multiple times.
The port can be a single port number or a port range portid-portid. The protocol can be tcp, udp, sctp or dccp.
[--zone=zone] [--policy=policy] --remove-source-port=portid[-portid]/protocolโ removes the source port. can be specified multiple times.[--zone=zone] [--policy=policy] --query-source-port=portid[-portid]/protocolโ tells you whether that source port has been added. returns0if true,1otherwise.[--zone=zone] [--policy=policy] --add-masqueradeโ enables IPv4 masquerade. masquerading hits different when your machine is a router and machines hanging off an interface in another zone should be able to use the first connection. ๐ง
For IPv6 masquerading, use the rich language.
Note: IP forwarding gets implicitly enabled. again. it's not optional. ๐
[--zone=zone] [--policy=policy] --remove-masqueradeโ disables IPv4 masquerade.
For IPv6 masquerading, use the rich language.
[--zone=zone] [--policy=policy] --query-masqueradeโ tells you whether IPv4 masquerading has been enabled. returns0if true,1otherwise.
For IPv6 masquerading, use the rich language.
[--zone=zone] [--policy=policy] --list-rich-rulesโ lists the rich language rules as a newline separated list. (newline separated, not space separated โ she's different, she's special ๐ )[--zone=zone] [--policy=policy] --add-rich-rule='rule'โ adds the rich language rule'rule'. can be specified multiple times.
For the rich language rule syntax, go look at firewalld.richlanguage(5). ๐
[--zone=zone] [--policy=policy] --remove-rich-rule='rule'โ removes the rich language rule'rule'. can be specified multiple times.
For the rich language rule syntax, go look at firewalld.richlanguage(5).
[--zone=zone] [--policy=policy] --query-rich-rule='rule'โ tells you whether a rich language rule'rule'has been added. returns0if true,1otherwise.
For the rich language rule syntax, go look at firewalld.richlanguage(5).
๐ Options to Adapt and Query Zones ๐
Everything in this lil section affects one particular zone. use it with --zone=zone and it hits that zone. leave the option out and it hits the default zone instead (peep --get-default-zone). ๐
[--zone=zone] --add-icmp-block-inversionโ enables ICMP block inversion.[--zone=zone] --remove-icmp-block-inversionโ disables ICMP block inversion.[--zone=zone] --query-icmp-block-inversionโ tells you whether ICMP block inversion is enabled. returns0if true,1otherwise.[--zone=zone] --add-forwardโ enables intra zone forwarding.[--zone=zone] --remove-forwardโ disables intra zone forwarding.[--zone=zone] --query-forwardโ tells you whether intra zone forwarding is enabled. returns0if true,1otherwise.[--zone=zone] --get-priorityโ gets the zone's priority.[--zone=zone] --set-priorityโ sets the zone's priority for packet classification. this sets both the ingress and egress priority, two for one, ate. โจ[--zone=zone] --get-ingress-priorityโ gets the zone's ingress priority.[--zone=zone] --set-ingress-priorityโ sets the zone's ingress priority for packet classification.[--zone=zone] --get-egress-priorityโ gets the zone's egress priority.[--zone=zone] --set-egress-priorityโ sets the zone's egress priority for packet classification.
๐ Options to Adapt and Query Policies ๐
These ones affect one particular policy, so you must pass --policy=policy with them. no negotiating. ๐
--policy=policy --get-priorityโ gets the priority.--policy=policy --set-prioritypriorityโ sets the priority. (yes bestie, the page really does glue it together like that, i'm just the messenger ๐)
The priority decides the relative ordering of policies. it's an integer between -32768 and 32767, where -1 is the default value for new policies, and 0 is reserved for internal use. no touching. โ ๏ธ
If a priority is < 0, then the policy's rules execute before all rules in all zones.
If a priority is > 0, then the policy's rules execute after all rules in all zones.
--policy=policy --list-ingress-zonesโ lists the ingress zones as a space separated list.--policy=policy --add-ingress-zone=zoneโ adds an ingress zone. can be specified multiple times.
The ingress zone is one of the firewalld provided zones, or one of the pseudo-zones: HOST, ANY. ๐
HOST is used for traffic originating from the host machine โ y'know, the host that's running firewalld.
ANY is for traffic coming from any zone, fr โ think of it as a lil wildcard but for zones ๐ซ. But heads up bestie: it does NOT include traffic from the host machine itself โ for that you gotta use HOST. Periodt.
--policy=policy --remove-ingress-zone=zoneโ takes an ingress zone off the list ๐ฎ. You can drop this option in multiple times, it stacks.--policy=policy --query-ingress-zone=zoneโ asks "is this zone in there?" ๐ Returns0if yes,1if no.--policy=policy --list-egress-zonesโ spills all the egress zones you added, as one space-separated list โจ.--policy=policy --add-egress-zone=zoneโ adds an egress zone ๐. Stackable, hit it multiple times.--policy=policy --remove-egress-zone=zoneโ removes an egress zone ๐ฎ, also stackable.
The egress zone is one of the zones firewalld hands out, or one of the pseudo-zones: HOST, ANY.
For the tea on HOST and ANY, scroll back up to the --add-ingress-zone option ๐ธ.
--policy=policy --query-egress-zone=zoneโ checks if that zone's been added. Returns0if true,1if not.--policy=policy|--policy-set=policy-set --add-disableโ administratively disables a policy ๐ด. A disabled policy just will not activate, simple as that.--policy=policy|--policy-set=policy-set --remove-disableโ lifts that administrative disable ๐ . Now the policy is allowed to activate again.--policy=policy --query-disableโ tells you whether the policy is administratively disabled ๐.
๐ Options to Handle Bindings of Interfaces ๐
Binding an interface to a zone means this zone's settings are the ones restricting traffic through that interface ๐. It's giving "this zone owns this interface."
Options in this section affect only one particular zone, okay? If you use them with --zone=zone, they hit the zone zone. If you leave that option out, they hit the default zone (peep --get-default-zone).
For a list of predefined zones, run firewall-cmd --get-zones โจ.
An interface name is a string up to 16 characters long, and it may not contain ' ', '/', '!' and '*' ๐ซ.
[--zone=zone] --list-interfacesโ lists the interfaces bound to zone zone, space separated ๐. Omit zone and it uses the default zone.[--zone=zone] --add-interface=interfaceโ binds interface interface to zone zone ๐ซถ. Omit zone, default zone it is.[--zone=zone] --change-interface=interfaceโ moves the interface interface over to zone zone ๐. Omit zone and default zone gets it. If the old zone and new zone are literally the same, the call just gets ignored, no error, no drama ๐. If the interface was never bound to any zone before, it acts like--add-interface.[--zone=zone] --query-interface=interfaceโ asks whether interface interface is bound to zone zone. Returns0if true,1if not.[--zone=zone] --remove-interface=interfaceโ unbinds interface interface from zone zone ๐ธ. Omit zone, default zone applies.
๐ Options to Handle Bindings of Sources ๐
Binding a source to a zone means this zone's settings are what restrict traffic from that source ๐.
A source address or address range can be an IP address, or a network IP address with a mask (for IPv4 or IPv6), or a MAC address, or an ipset using the ipset: prefix ๐ฏ. For IPv4 the mask can be a network mask or just a plain number. For IPv6 the mask is a plain number. And ngl โ host names are not supported, so don't even try it bestie ๐ญ.
Options in this section affect only one particular zone. Use --zone=zone and they affect the zone zone. Leave it out, and they affect the default zone (see --get-default-zone).
For a list of predefined zones, hit up firewall-cmd --get-zones โจ.
[--zone=zone] --list-sourcesโ lists the sources bound to zone zone, space separated ๐ซ. No zone? Default zone steps in.[--zone=zone] --add-source=source[/mask]|MAC|ipset:ipsetโ binds the source to zone zone ๐ซถ. No zone, default zone.[--zone=zone] --change-source=source[/mask]|MAC|ipset:ipsetโ changes which zone the source is bound to, over to zone zone ๐. No zone, default zone. If old zone and new zone match exactly, the call is ignored without an error, no cap ๐. If the source was never bound to a zone before, it behaves like--add-source.[--zone=zone] --query-source=source[/mask]|MAC|ipset:ipsetโ checks whether that source is bound to zone zone. Returns0if true,1otherwise.[--zone=zone] --remove-source=source[/mask]|MAC|ipset:ipsetโ removes the binding of that source from zone zone ๐ฎ. No zone, default zone.
๐ IPSet Options ๐
--new-ipset=ipset --type=ipset type [--option=ipset option[=value]]โ makes a brand new permanent ipset, and you get to name the type plus optional options โจ.
ipset names gotta be alphanumeric and may additionally include these characters: '_' and '-' ๐.
--new-ipset-from-file=filename [--name=ipset]โ makes a new permanent ipset from a prepared ipset file, with an optional name override ๐.--delete-ipset=ipsetโ deletes an existing permanent ipset ๐ฎ.--info-ipset=ipsetโ prints the deets about the ipset ipset ๐. The output format is:
ipset
type: type
options: option1[=value1] ..
entries: entry1 ..
--get-ipsetsโ prints all the predefined ipsets, space separated list ๐ธ.--ipset=ipset --add-entry=entryโ adds a new entry to the ipset ๐ซถ.--ipset=ipset --remove-entry=entryโ removes an entry from the ipset ๐ฎ.--ipset=ipset --query-entry=entryโ returns whether that entry's been added to the ipset. Returns0if true,1otherwise.--ipset=ipset --get-entriesโ lists every entry in the ipset ๐ซ.--ipset=ipset --add-entries-from-file=filenameโ adds new entries to the ipset, straight from the file ๐. For every entry that's in the file but already in the ipset, a warning gets printed โ ๏ธ.
The file should have an entry per line. Lines starting with a hash or a semicolon are ignored, and so are empty lines ๐ซ.
--ipset=ipset --remove-entries-from-file=filenameโ removes existing entries from the ipset, based on the file โ๏ธ. For every entry listed in the file but not in the ipset, a warning gets printed โ ๏ธ.
The file should have an entry per line. Lines starting with a hash or a semicolon are ignored, and empty lines too ๐ซ.
--ipset=ipset --set-description=descriptionโ sets a new description on the ipset ๐.--ipset=ipset --get-descriptionโ prints the description for the ipset ๐.--ipset=ipset --set-short=descriptionโ sets a new short description on the ipset ๐.--ipset=ipset --get-shortโ prints the short description for the ipset โจ.--path-ipset=ipsetโ prints the path of the ipset's configuration file ๐.
๐ฆ Service Options ๐ฆ
--info-service=serviceโ prints the deets about service service ๐. The output format is:
service
ports: port1 ..
protocols: protocol1 ..
source-ports: source-port1 ..
helpers: helper1 ..
destination: ipv1:address1 ..
--new-service=serviceโ adds a brand new permanent service ๐.
Service names must be alphanumeric, and may additionally include these characters: '_' and '-' ๐.
--new-service-from-file=filename [--name=service]โ adds a new permanent service from a prepared service file, with an optional name override ๐.--delete-service=serviceโ deletes an existing permanent service ๐ฎ.--path-service=serviceโ prints the path of the service's configuration file ๐.--service=service --set-description=descriptionโ sets a new description on the service ๐.--service=service --get-descriptionโ prints the description for the service ๐.--service=service --set-short=descriptionโ sets a short description on the service ๐.--service=service --get-shortโ prints the short description for the service โจ.--service=service --add-port=portid[-portid]/protocolโ adds a new port to the permanent service ๐ซถ.--service=service --remove-port=portid[-portid]/protocolโ removes a port from the permanent service ๐ฎ.--service=service --query-port=portid[-portid]/protocolโ returns whether the port has been added to the permanent service ๐.--service=service --get-portsโ lists the ports added to the permanent service ๐ซ.--service=service --add-protocol=protocolโ adds a new protocol to the permanent service ๐ซถ.--service=service --remove-protocol=protocolโ removes a protocol from the permanent service ๐ฎ.--service=service --query-protocol=protocolโ returns whether the protocol has been added to the permanent service ๐.--service=service --get-protocolsโ lists the protocols added to the permanent service ๐ซ.--service=service --add-source-port=portid[-portid]/protocolโ adds a new source port to the permanent service ๐ซถ.--service=service --remove-source-port=portid[-portid]/protocolโ removes a source port from the permanent service ๐ฎ.--service=service --query-source-port=portid[-portid]/protocolโ returns whether the source port has been added to the permanent service ๐.--service=service --get-source-portsโ lists the source ports added to the permanent service ๐ซ.--service=service --add-helper=helperโ adds a new helper to the permanent service ๐ซถ.--service=service --remove-helper=helperโ removes a helper from the permanent service ๐ฎ.--service=service --query-helper=helperโ returns whether the helper has been added to the permanent service ๐.--service=service --get-service-helpersโ lists the helpers added to the permanent service ๐ซ.--service=service --set-destination=ipv:address[/mask]โ sets the destination for ipv to address[/mask]in the permanent service ๐ฏ.--service=service --remove-destination=ipvโ removes the destination for ipv from the permanent service ๐ฎ.--service=service --query-destination=ipv:address[/mask]โ returns whether the destination ipv to address[/mask]has been set in the permanent service ๐.--service=service --get-destinationsโ lists the destinations added to the permanent service ๐ซ.--service=service --add-include=serviceโ adds a new include to the permanent service ๐ซถ.--service=service --remove-include=serviceโ removes an include from the permanent service ๐ฎ.--service=service --query-include=serviceโ returns whether the include has been added to the permanent service ๐.--service=service --get-includesโ lists the includes added to the permanent service ๐ซ.
๐ Helper Options ๐
Options in this section affect only one particular helper ๐ง.
--info-helper=helperโ prints the deets about the helper helper ๐. The output format is:
helper
family: family
module: module
ports: port1 ..
The following options are only usable in the permanent configuration. โ ๏ธ
--new-helper=helper --module=nf_conntrack_module [--family=ipv4|ipv6]โ spawns a brand new permanent helper, with the module set, and the family too if you want it. Helper names must be alphanumeric, and you're also allowed to sprinkle in the character'-'. โจ--new-helper-from-file=filename [--name=helper]โ builds a new permanent helper out of a helper file you already prepped, with an optional name override if you're feeling spicy.--delete-helper=helperโ deletes a permanent helper that already exists. bye bestie ๐--load-helper-defaults=helperโ loads the helper's default settings, or hits you with aNO_DEFAULTSerror. no in-between. ๐ค--path-helper=helperโ prints the path of the helper's configuration file.--get-helpersโ prints the predefined helpers as a space separated list.--helper=helper --set-description=descriptionโ sets a new description on the helper.--helper=helper --get-descriptionโ prints the description for the helper.--helper=helper --set-short=descriptionโ sets the short description on the helper.--helper=helper --get-shortโ prints the short description for the helper.--helper=helper --add-port=portid[-portid]/protocolโ adds a new port to the permanent helper.--helper=helper --remove-port=portid[-portid]/protocolโ removes a port from the permanent helper.--helper=helper --query-port=portid[-portid]/protocolโ returns whether that port has been added to the permanent helper or not.--helper=helper --get-portsโ lists the ports added to the permanent helper.--helper=helper --set-module=descriptionโ sets the module description for the helper.--helper=helper --get-moduleโ prints the module description for the helper.--helper=helper --set-family=descriptionโ sets the family description for the helper.--helper=helper --get-familyโ prints the family description of the helper.
๐ฆ Internet Control Message Protocol (ICMP) type Options ๐ฆ
--info-icmptype=icmptypeโ prints all the info about the icmptype icmptype. The output format is, exactly:
icmptype
destination: ipv1 ..
--new-icmptype=icmptypeโ adds a new permanent icmptype.
ICMP type names must be alphanumeric, and may additionally include the characters '_' and '-'. iykyk ๐
--new-icmptype-from-file=filename [--name=icmptype]โ adds a new permanent icmptype from an icmptype file you prepared earlier, with an optional name override.--delete-icmptype=icmptypeโ deletes an existing permanent icmptype.--icmptype=icmptype --set-description=descriptionโ sets a new description on the icmptype.--icmptype=icmptype --get-descriptionโ prints the description for the icmptype.--icmptype=icmptype --set-short=descriptionโ sets the short description on the icmptype.--icmptype=icmptype --get-shortโ prints the short description for the icmptype.--icmptype=icmptype --add-destination=ipvโ enables destination for ipv in the permanent icmptype. ipv is one ofipv4oripv6. ๐--icmptype=icmptype --remove-destination=ipvโ disables destination for ipv in the permanent icmptype. ipv is one ofipv4oripv6.--icmptype=icmptype --query-destination=ipvโ returns whether the destination for ipv is enabled in the permanent icmptype. ipv is one ofipv4oripv6.--icmptype=icmptype --get-destinationsโ lists the destinations in the permanent icmptype.--path-icmptype=icmptypeโ prints the path of the icmptype configuration file.
๐ Direct Options ๐
DEPRECATED ๐จ The direct interface has been deprecated. It will be removed in a future release. It is superseded by policies, see firewalld.policies(5).
The direct options hand you a way more direct hookup to the firewall. They require you to already know basic iptables concepts, like table (filter/mangle/nat/...), chain (INPUT/OUTPUT/FORWARD/...), commands (-A/-D/-I/...), parameters (-p/-s/-d/-j/...) and targets (ACCEPT/DROP/REJECT/...). so like, actual grown-up iptables knowledge, no cap.
Direct options should be used only as a last resort, when it's genuinely not possible to use, for example, --add-service=service or --add-rich-rule='rule' instead. it's giving "emergency exit only" ๐ซถ
โ ๏ธ Warning: Direct rules behavior is different depending on the value ofFirewallBackend. See CAVEATS infirewalld.direct(5).
The first argument of each option has to be ipv4 or ipv6 or eb. With ipv4 it will be for IPv4 (iptables(8)), with ipv6 for IPv6 (ip6tables(8)) and with eb for ethernet bridges (ebtables(8)). โจ
--direct --get-all-chainsโ gets all chains added to all tables.
This option concerns only chains previously added with --direct --add-chain. ๐
--direct --get-chains { ipv4 | ipv6 | eb } tableโ gets all chains added to table as a space separated list.
This option concerns only chains previously added with --direct --add-chain.
--direct --add-chain { ipv4 | ipv6 | eb } table chainโ adds a new chain with the name chain to table.
There already exist basic chains to use with direct options โ for example the INPUT_direct chain (run iptables-save | grep direct to see all of them). These chains are jumped into before chains for zones, i.e. every rule you put into INPUT_direct will be checked before rules in zones. ๐
--direct --remove-chain { ipv4 | ipv6 | eb } table chainโ removes the chain with the name chain from table.--direct --query-chain { ipv4 | ipv6 | eb } table chainโ returns whether a chain with the name chain exists in table. Returns0if true,1otherwise.
This option concerns only chains previously added with --direct --add-chain.
--direct --get-all-rulesโ gets all rules added to all chains in all tables, as a newline separated list of the priority and arguments.--direct --get-rules { ipv4 | ipv6 | eb } table chainโ gets all rules added to chain in table, as a newline separated list of the priority and arguments.--direct --add-rule { ipv4 | ipv6 | eb } table chain priority argsโ adds a rule with the arguments args to chain in table with priority priority.
The priority orders your rules. Priority 0 means the rule gets added on top of the chain, and with a higher priority the rule gets added further down. Rules with the same priority sit on the same level, and the order of those rules is not fixed and may change. So if you need to guarantee a rule lands after another one, use a low priority for the first and a higher one for the following. ๐ง
--direct --remove-rule { ipv4 | ipv6 | eb } table chain priority argsโ removes a rule with priority and the arguments args from chain in table.--direct --remove-rules { ipv4 | ipv6 | eb } table chainโ removes all rules in the chain with the name chain that exists in table.
This option concerns only rules previously added with --direct --add-rule in this chain.
--direct --query-rule { ipv4 | ipv6 | eb } table chain priority argsโ returns whether a rule with priority and the arguments args exists in chain in table. Returns0if true,1otherwise.--direct --get-all-passthroughsโ gets all permanent passthrough rules as a newline separated list of the ipv value and arguments.--direct --get-passthroughs { ipv4 | ipv6 | eb }โ gets all permanent passthrough rules for the ipv value as a newline separated list of the priority and arguments.--direct --add-passthrough { ipv4 | ipv6 | eb } argsโ adds a permanent passthrough rule with the arguments args for the ipv value.--direct --remove-passthrough { ipv4 | ipv6 | eb } argsโ removes a permanent passthrough rule with the arguments args for the ipv value.--direct --query-passthrough { ipv4 | ipv6 | eb } argsโ returns whether a permanent passthrough rule with the arguments args exists for the ipv value. Returns0if true,1otherwise.
๐ Policy Options ๐
--policy-serverโ changes Polkit actions to'server'(more restricted) ๐--policy-desktopโ changes Polkit actions to'desktop'(less restricted) ๐
๐ธ SEE ALSO ๐ธ
firewall-applet(1), firewalld(1), firewall-cmd(1), firewall-config(1), firewalld.conf(5), firewalld.direct(5), firewalld.dbus(5), firewalld.icmptype(5), firewall-offline-cmd(1), firewalld.richlanguage(5), firewalld.service(5), firewalld.zone(5), firewalld.zones(5), firewalld.policy(5), firewalld.policies(5), firewalld.ipset(5), firewalld.helper(5)
๐ซถ NOTES ๐ซถ
firewalld home page:
http://firewalld.org
โญ AUTHORS โญ
- Thomas Woerner
<twoerner@redhat.com>โ Developer - Jiri Popelka
<jpopelka@redhat.com>โ Developer - Eric Garver
<eric@garver.life>โ Developer
and that's the whole page bestie, you made it to the end ๐๐ this was firewalld 2.5.2, serving you the FIREWALL-OFFLINE-C(1) manual page โ now go forth and firewall offline, iconically โจ๐
๐ฆ where this page comes from
- arch rolling: firewalld 2.5.2-1 ยท GPL-2.0-or-later
- nixpkgs unstable: firewalld 2.5.2
- ubuntu stonking: firewalld 2.5.2-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms