- In this video, we are further going to explore
working with zones in firewalld.
As we have seen, network interfaces
in firewalld are assigned to a zone,
and the default zone is public.
On multi-home service, using multiple zones is usual
to ensure specific traffic types are allowed
in specific environments only.
Within a multi-home server is a server
with multiple network carts and that's not very common
but you should know how to deal with zones anyway.
So let me run a short demo.
So firewall-cmd --get-zones,
showing all the zones that are available.
Now if you use firewall-cmd --list-all-zones,
then we get the configuration
of all the zones that we've got.
You can see for instance, trusted.
That's very restricted.
There is no services active by default.
And there is work.
Well, we do have services and that is how these zones
are providing some default configuration.
Here we have internal for instance.
That's a little bit more that is going
to be allowed by default.
And that is what makes it easier for you to get started
with a specific configuration.
Now let's use firewall-cmd --list-all,
which is printing the current configuration
for all of the active zones.
Now I am going to use firewall-cmd --get-default-zone,
and that allows you to get the default zone,
and if you want to, you can use set-default-zone
to set it to something else.
I don't want to set it to something else
so I'm going to leave it without the argument.
But here you need to provide an argument.
Well, you know what?
Internal for instance,
and now we can see that the internal zone is default.
Next, let's add something.
firewall-cmd --add-service https.
If you just do it like this, then the service will be added
to the the current default zone.
But on a system that is using multiple zones
you can also specify the zone where you want
to add this specific service.
So we're using --zone dmz.
We have added it to the dmz zone.
Let's not forget, I want to get back
to the public zone, which is the default
and that's what I want for the next demo.