Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active December 23, 2021 18:56
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 zulhfreelancer/92dfed8d62d2630fdb91ed40ecf3058e to your computer and use it in GitHub Desktop.
Save zulhfreelancer/92dfed8d62d2630fdb91ed40ecf3058e to your computer and use it in GitHub Desktop.
How to open a port in Oracle Cloud Instance?
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# IMPORTANT
# Make sure you already create an ingress rule for the port that you want to open in Oracle Cloud virtual firewall aka
# "Security Lists". This tutorial might be useful for you:
# ---> https://youtu.be/1AIXULHjabQ
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# SSH into the instance
$ ssh <username>@<ip_address>
# Install
$ sudo apt-get install -y firewalld
# Open the port (e.g. port 80)
$ sudo firewall-cmd --zone=public --permanent --add-port=80/tcp
# Reload
$ sudo firewall-cmd --reload
# Verify using another machine (e.g. local/dev machine)
$ nc -zv <ip_address> 80
Connection to <ip_address> port 80 [tcp/http] succeeded!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment