I am unable to access some specific ports in a GCP instance I created. I spin up a simple python server using command python3 -m http.server <port#>
on port 22221
and 22222
. I can curl to both ports inside the machine or another machine inside the same VPC(using localhost or public ip). but when I tried to curl both ports from outside using public ip, only 22222
works, but the other port does not work.In the firewall I opened up all the ports.
My Firewall rule opened up all the ports Firewall-Screenshot
Curl inside the machine-Screenshot
netstat netstat-screenshot
update 1 :
i did the same steps in AWS. Created an Ec2 -> assigned security group which allows all ports inbound/outbound -> spinup python simple http server on port 22222
and 22221
. only 22222
is accessible from public ip address. Looks like it is specific to OS(I am using ubuntu). below is the nmap from inside and outside the instance.