Skip to content

Instantly share code, notes, and snippets.

@jbaranski
Created September 26, 2020 02:00
Show Gist options
  • Select an option

  • Save jbaranski/4671af6cdd6e4038cb90b357d3335fb9 to your computer and use it in GitHub Desktop.

Select an option

Save jbaranski/4671af6cdd6e4038cb90b357d3335fb9 to your computer and use it in GitHub Desktop.
Open Port 80 Oracle Cloud Compute Instance (CentOS)

Open Port 80 Oracle Cloud Compute Instance (CentOS)

FYI This was harder than it needed to be:

  1. Looking at your instance info, find VNIC section, click "Public Subnet".
  2. Click on your security list.
  3. Add a new entry with the following options:
  • "Stateless" = No, "Source" = 0.0.0.0/0, "IP Protocol" = TCP, "Source Port Range" = All, "Destination Port Range" = 80
  1. SSH to your instance.
  2. While SSH'ed in your instance, run command firewall-cmd --permanent --add-service=http.
  3. While SSH'ed in your instance, run command firewall-cmd --reload.
  4. Now start Apache, NGINX, or whatever server you need to on port 80. You can now access from the internet.
@Mcrich23

Mcrich23 commented Mar 27, 2024

Copy link
Copy Markdown

it won't work. Edit: there was a vnic issue

@Rouliooooo

Copy link
Copy Markdown

Thanks, that's perfect !

@NoIDidntHackU

NoIDidntHackU commented Jun 16, 2024

Copy link
Copy Markdown

mine just says "Authorization failed.
Make sure polkit agent is running or run the application as superuser."
any ideas?
(im an idiot when it comes to linux)

edit
NVM, im an idiot, i just had to run it with sudo. Duhh

@vamsiambati

vamsiambati commented Jan 23, 2025

Copy link
Copy Markdown

I did executed all commands still I am not able to access casa os with my public ip

edit: executing below commands worked for me

$ sudo firewall-cmd --zone=public --permanent --add-port=80/tcp

$ sudo firewall-cmd --reload

iptables -I INPUT 5 -i ens3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT

@Kenya-West

Kenya-West commented Feb 13, 2025

Copy link
Copy Markdown

When clicking on Add Security List, it says "None Available".

Ubuntu 24.04 minimal

@brotskydotcom

Copy link
Copy Markdown

As of 2025/07/26, using Oracle Linux 9 on an Ampere instance, these firewall-cmd rules are exactly right (modulo adding sudo), thanks so much!

For general information, the zone that's affected when you don't specify a zone is the "public" zone. You can see all the rules on that zone like this:

sudo firewall-cmd --permanent --info-zone=public

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