Reputation: 1015
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
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.
Upvotes: 4
Views: 5437
Reputation: 148
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
Upvotes: 3
Reputation: 21
Odd that the firewall has no interfaces. A similar command on my compute instance reveals an interface 'ens3' and that public is '(active)':
$ sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens3
sources:
services: ssh
ports: 3001/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Did you miss reloading the firewall after you added the port?
sudo firewall-cmd --reload
Upvotes: 2