FIREWALLD.SERVICE(5)
π FIREWALLD.SERVICE(5) π
okay bestie, gather round, because we're talking about firewalld.service β the man page alllll about firewalld service configuration files. yes it's manual section 5, yes it's about XML, no you cannot skip it. β¨
β¨ NAME β¨
firewalld.service β the firewalld service configuration files, aka the little XML glow-ups that tell firewalld what a "service" even is π
πΈ SYNOPSIS πΈ
/etc/firewalld/services/service.xml
/usr/lib/firewalld/services/service.xml
those two paths. that's it. that's the whole vibe. one's the one you edit, one's the one the system ships. iykyk π¦
π DESCRIPTION π
so a firewalld service configuration file is literally just a file that hands firewalld all the info about one service entry. and like, the parts that actually matter the most? ports, modules, and destination addresses. those are the main character options fr fr π
here's an example config so you can see what the structure looks like β study it, it's giving architecture:
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>My Service</short>
<description>description</description>
<port port="137" protocol="tcp"/>
<protocol value="igmp"/>
<module name="nf_conntrack_netbios_ns"/>
<destination ipv4="224.0.0.251" ipv6="ff02::fb"/>
<include service="ssdp"/>
<helper name="ftp"/>
</service>
π§ OPTIONS π§
the config can contain all these tags and attributes, okay? some of them are mandatory (no skipping, bestie) and others are optional (do it if you want, it's your life).
service π
the mandatory service start and end tag defines the service. and listen β this tag can only be used once in a service configuration file. one and done. periodt.
there are optional attributes for services, though:
version="string"β gives the service a version. cute little label, that's all β¨
short π
an optional start and end tag, and it's there to give a service a more readable name. like a nickname but for a service entry.
description π
an optional start and end tag so you can have a description for a service. put your thoughts in there, bestie.
port π
an optional empty-element tag, and yes you can use it several times to have more than one port entry. stack 'em up. but heads up: all attributes of a port entry are mandatory:
port="string"β this string can be a single port number, or a port range in the formportid-portid, or it can be empty to match a protocol only πprotocol="string"β the protocol value can betcp,udp,sctpordccp. those four, that's the list.
so for compatibility with older firewalld versions, it's possible to add protocols with the port option where the port is empty. but with the addition of native protocol support in the service, this is not needed anymore. those entries will automatically be converted to protocols. and with the next modification of the service file, the enries will be listed as protocols. π (yes the manpage says "enries", we don't fix it, we respect it)
protocol π¦
an optional empty-element tag, usable several times to have more than one protocol entry. a protocol entry has exactly one attribute:
value="string"β the protocol can be any protocol supported by the system. please have a look at/etc/protocolsfor supported protocols, bestie, that's the source of truth π
source-port πΈ
an optional empty-element tag, and you can use it several times to have more than one source port entry. all attributes of a source port entry are mandatory:
port="string"β the port string can be a single port number or a port rangeportid-portidprotocol="string"β the protocol value can either betcp,udp,sctpordccp
module π
okay so... this element is deprecated. not me having to deliver bad news. please use helper described below in the section called "helper". move on, glow up, use the new thing π
destination π§
an optional empty-element tag and it can be used only once. it specifies the destination network as a network IP address (optional with /mask), or a plain IP address. and listen, the use of hostnames is not recommended, because these will only be resolved at service activation and transmitted to the kernel. for more info on this element, please have a look at --destination in iptables(8) and ip6tables(8).
ipv4="address[/mask]"β the IPv4 destination address with optional maskipv6="address[/mask]"β the IPv6 destination address with optional mask
include π
an optional empty-element tag and it can be used several times to have more than one include entry. an include entry has exactly one attribute:
service="string"β the include can be any service supported by firewalld
Warning: firewalld will only check that the included service is a valid service if it's applied to a zone. β οΈ don't @ me, that's just how it is
helper β¨
an optional empty-element tag and it can be used several times to have more than one helper entry. a helper entry has exactly one attribute:
name="string"β the helper can be any helper supported by firewalld
π SEE ALSO π
all the sibling manpages, they're a family and we love them:
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:
go there. say hi. π«Ά
π AUTHORS π
absolute legends, every single one:
- 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!! π this was firewalld 2.5.2, and you just read FIREWALLD.SERVICE(5). slay, you're officially a firewalld service config girlie now. go forth and write some well-formed XML π
πβ¨π¦ππΈ
π¦ where this page comes from
- arch rolling: firewalld 2.5.2-1 Β· GPL-2.0-or-later
- 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