Opening a specific port in Oracle Cloud - Ubuntu 18
Asked Answered
S

3

7

The above one seems like an easy question, but believe me I have tried multiple methods but all seems to be in vain

For example : Port is 8080

1st - I followed many oracle docs and tried opening port 8080, but failed miserably

2nd - I followed another stack overflow posts - Opening port 80 on Oracle Cloud Infrastructure Compute node

Opening port 19132 on an Oracle compute instance (ubuntu-20.04) still no success

3rd - I followed these oracle instructions and tried to open up the port - https://docs.cloud.oracle.com/en-us/iaas/developer-tutorials/tutorials/apache-on-ubuntu/01oci-ubuntu-apache-summary.htm

but not working -> to my surprise, when I tried port no 80 with the same method,it worked well..but not working for any other port at all

In short : ** I enabled port 8080 in Security rules in VNC - didnt work

** I tried ,installing firewalld and allowing through that -> didnt work for me

** Tried this -> didnt work

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

So I was hoping someone else can find me a solution Please to open up a port, or is there any way to completely disable my firewall so that I can use any port at all - currently I am able to listen to only port 80 from outside

Thank you

Shotputter answered 25/11, 2020 at 13:38 Comment(3)
how do you know port 8080 is not opened? (how do you test)Vortical
Hi @Vortical I was using yougetsignal.com/tools/open-ports to test itShotputter
take a few screenshots of the security list, route table, and instance details, maybe we can spot an omission?Vortical
W
6

Ubuntu images in Oracle Cloud seem to have this 'strange' (compared to other clouds) behavior by default where you need to explicitly enable incoming traffic in the VM:

sudo iptables -I INPUT -j ACCEPT

Then you need to make this permanent:

sudo iptables-save -f /etc/iptables/rules.v4
Winsor answered 18/8, 2022 at 8:52 Comment(0)
F
2

I am using Oracle Linux and this worked for me.

  1. First add a new rule inside the default security list(see the link below)
  2. firewall-cmd --permanent --zone=public --add-port=8080/tcp
  3. firewall-cmd --reload

Reference : OCI: Amend Firewall Rules

In your case, you have Ubuntu instead of Oracle Linux, so you could try the above two commands as per Ubuntu and check if it works.

Farceuse answered 10/1, 2022 at 12:7 Comment(1)
That Reference : OCI: Amend Firewall Rules is the only answer I found so far that gives the proper instruction on how to add a new rule inside the default security list, while all other answers missed this must-have step. Thanks!!!Henrik
B
0

To open a certain port it may require creating a security application specific to the port before creating the security rule. Please refer to this walkthru on it if you haven't already - https://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/compute/permitting_public_tcp_traffic_to_compute_instances/permitting_public_tcp_traffic_to_compute_instances.html

Buonaparte answered 1/12, 2020 at 15:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.