I have a python app running at port 9000 and want to connect externally. So, I open port 9000 in ufw, checked wheather port app is listen and created rule at Digital Ocean firewall. I can connect to postgres at port 5432 and ssh, but cannot connect to port 9000.

sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      692/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      877/sshd
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      937/postgres
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      1184/python3.6
tcp6       0      0 :::22                   :::*                    LISTEN      877/sshd
tcp6       0      0 :::5432                 :::*                    LISTEN      937/postgres
sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
9000/tcp                   ALLOW       Anywhere
9001/tcp                   ALLOW       Anywhere
10001/tcp                  ALLOW       Anywhere
10000/tcp                  ALLOW       Anywhere
5432/tcp                   ALLOW       Anywhere
22/tcp                     ALLOW       Anywhere
22                         ALLOW       Anywhere
9000/tcp (v6)              ALLOW       Anywhere (v6)
9001/tcp (v6)              ALLOW       Anywhere (v6)
10001/tcp (v6)             ALLOW       Anywhere (v6)
10000/tcp (v6)             ALLOW       Anywhere (v6)
5432/tcp (v6)              ALLOW       Anywhere (v6)
22/tcp (v6)                ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)

Print of Droplet Firewall

Can someone help me, please?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there @nevessmichel,

This actually looks all correct, so I think that it might be your local network closing the connections to that custom port. In order to do that you could run the following command from your computer:

  • telnet portquiz.net 9000

If you are not able to connect then this would indicate that port 9000 is closed on your local network.

Let me know how it goes!
Regards,
Bobby

  • Hi Bobby, after got stuck for many hours, my app started to receive requests, the same code and firewall. About my local network, I think that’s not the case, because I have a VM on GoogleCloud plataform and tried to ping to my droplet, which fail too.
    It solved on it’s own, but thank you for try to help me.

    Regards,
    Michel

Submit an Answer