Skip to content

Instantly share code, notes, and snippets.

@jg3
Created January 19, 2024 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jg3/a9a6580e959fc0a70d2a9b23de798179 to your computer and use it in GitHub Desktop.
Save jg3/a9a6580e959fc0a70d2a9b23de798179 to your computer and use it in GitHub Desktop.
Oracle Linux firewall config

Oracle Linux Host Firewall Config

The default firewall configuration of Oracle Linux in the OCI environment basically denies everything. To enable traffic of any kind these following commands are needed.

sudo systemctl status firewalld
sudo firewall-cmd --list-all
sudo firewall-cmd --zone=public
sudo firewall-cmd --zone=public --add-port=5201/tcp --permanent
sudo firewall-cmd --zone=public --add-port=5201/udp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-ports

sudo systemctl status firewalld
Check the status of the firewall daemon. If it isn't green, there are bigger problems, look there first.

sudo firewall-cmd --list-all
Observe the configuraion of the firewall. NB shows ssh under services.

sudo firewall-cmd --zone=public
Incomplete command, don't do this.

sudo firewall-cmd --zone=public --add-port=5201/tcp --permanent
Add port to the firewall configuration and make it remain across restarts and reboots.

sudo firewall-cmd --zone=public --add-port=5201/udp --permanent
Add port to the firewall configuration and make it remain in place across restarts and reboots!

sudo firewall-cmd --reload
Very Important restart the fierwall daemon to have the new rules take effect.

sudo firewall-cmd --zone=public --list-ports
Show (only) the ports allowed. Compare with --list-all output from earlier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment