firewalld: zones, services, ports
Sign in to read this lesson
On RHEL the firewall is on by default and allows only SSH, Cockpit and the DHCPv6 client. After installing a new service, the answer to "why can't I connect?" is very often here. In this lesson we learn firewalld zones, service and port rules, and the important difference between runtime and permanent.
What you will learn
- firewalld works with zones: an interface belongs to a zone (
publicby default), and the zone decides what is allowed. firewall-cmd --list-allshows everything in the current zone;--get-active-zonesthe zones of the interfaces.--add-service=httpopens by ready-made service name,--add-port=8090/tcpby port.- Runtime (immediate, temporary) and permanent (on disk, after
--reload) are separate:--permanent+--reload, or--runtime-to-permanent. - By source:
--add-source=10.20.0.0/24 --zone=trusted— everything from that network is handled by that zone's rules.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.