1

I'm running PostgreSQL 10 on a Windows 10 WSL-2 installation of Ubuntu 18.04. I can start the service, connect to it locally from within Ubuntu with psql, and use it for local development. So far, so good!

I'd like to be able to connect to this instance from the host Windows OS, but can't connect. From Windows cmd, I've tried using telnet to see if I can connect to the NAT IP of the Ubuntu machine:

$ telnet 172.123.456.789 5432
Connecting To 172.31.175.251...Could not open connection to the host, on port 5432: Connect failed

When I run Django's runserver on port 8000, however, I can connect:

$ telnet 172.123.456.789 8000
[connected, returns HTML]

I've tried checking to see if it was something in Ubuntu's firewall ufw, but it isn't running:

$ sudo ufw status verbose
Status: inactive

Has anyone cracked this nut?

4

0 回答 0