How to change the default firewall zone with Oracle Linux 8.5

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.

Firewall
Firewall

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

get default firewall zone
get default firewall zone

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:

get firewall zones
get firewall 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:

Set the default firewall zone to trusted
Set the default firewall zone to trusted

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

Get active firewall zone
Get active firewall zone

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:

List everything added or enabled for the default zone
List everything added or enabled for the default zone

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.

Accessing Oracle Enterprise Manager using Safari on a Mac
Accessing Oracle Enterprise Manager using Safari on a Mac

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 information contained in this Website is for general information purposes only. We try to keep this information up to date and correct but we make no warranties of any kind about the completeness, accuracy, reliability with respect to the website, the information or the graphics contained on the website for any purpose. Any reliance you place on such information is strictly at your own risk. In no event will we be liable for any loss or damage whatsoever from the use of this Website.

The post How to change the default firewall zone with Oracle Linux 8.5 appeared first on MyBIJourney

All trademarks are properties of their respective owners.
FacebookTwitterPinterestWhatsAppMail