Opening a specific port in Oracle Cloud - Ubuntu 18

Viewed 3453

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

3 Answers

I am using oracle linux and this worked for me.

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

Refeerence : enter link description here

I think in your case you have Ubuntu instead of oracle linux, so you could try the above two command as per the Ubuntu and check if it works or not.

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
Related