Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening port 3000 on Oracle cloud compute instance

I am trying to open port 3000 on Oracle cloud compute instance. I followed Nodejs tutorial step by step but still the port is not opened.

I created another instance and add a new security rule to allow all traffic on all port as below snapshot Ingress rule

I am able to do a ssh on the machine and checked using port open tools and it identify that port 22 is open but port 3000 is closed. The firewall rule on host allows port 3000 as shown below

$ sudo firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 3000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

Update1: I have to reboot the instance to get the interface listed as part of firewall list-all command.

$ sudo firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens3
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 3000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

My distro is CentOS 8 so not sure if that is causing the issue. Update2: I was able to get it working with Oracle Linux 7.9 image so seems plain old CentOS8 image has some issue the way firewall rules work on Oracle cloud.

like image 769
Abhinav Avatar asked Oct 29 '25 04:10

Abhinav


1 Answers

Apart from disabling firewall and adding ingress rule in Oracle Cloud Portal I needed to open port on via iptables:

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3000 -j ACCEPT
like image 57
Amoenus Avatar answered Nov 01 '25 12:11

Amoenus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!