I had previously installed Oracle Linux 8.5 in a VirtualBox VM and I had successfully installed Oracle DB 19c with the ORCLCDB sample database. I could access the “Oracle Enterprise Manager” using a web browser executed inside the VM but I realised that I could not access it from the host computer for instance. I realised that the Oracle Linux firewall might be filtering these requests. So I decided to check the firewall status and to change the default zone and I have documented how I did it in this small tutorial.

First I decided to check what was the default firewall zone using the “sudo firewall-cmd –get-default” command:

The default (and current) zone was “public” and I realised that the public zone might filter some requests… so I decided to change it to a more permissive zone. I used the “sudo firewall-cmd –get-zones” command to get a list of available zones:

The “trusted” zone was surely the one I was looking for in order to allow the computers in my local network to access the services provided by the VM. I decided to change the default zone to “trusted” using the “sudo firewall-cmd –set-default-zone=trusted” command:

I checked if the default zone was also the current one using the “sudo firewall-cmd –get-active-zone” command:

And effectively the “trusted” zone was now associated with the enp0s3 network interface (the virtual ethernet card).
If you are curious, you can get more details about what has been added or enabled for the default zone using the “sudo firewall-cmd –list-all” command:

As you can se, the “trusted” zone accept all connections by default.
You can see the full list of commands at the official firewalld documentation page:
I verified that I was now able to access the “Oracle Enterprise Manager” using a Web Browser executed on an other computer and It was working as expected.

So the next time you are unable to access the services provided by an Oracle Linux VM from an other computer, be sure to check that the firewall is allowing the requests.
Disclaimer
The post How to change the default firewall zone with Oracle Linux 8.5 appeared first on MyBIJourney