I've postgres server listening on all ip addresses at port 8085. Even after following the Google cloud instructions here to open the port 8085 (instead of default 5432 port) through firewall rules, I'm still getting the following error. I've set up both egress and ingress firewall rules with the same ip address as the source (for ingress) and destination (for egress rules).
Error: could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "xx.xx.xxx.xx" and accepting TCP/IP connections on port 8085?
For ingress rule, set the following values for source and destination:
Source is the client that is originating the request, so the source ip is 'any' and the source port is 'any'. However, the destination is the server that is serving the client request. So the destination ip is whatever is the public ip of your VM and destination port is 8085.
For egress rule, the source and destination values are analogous to the ingress rule. Source ip is the server ip address and the source port is 8085. Destination ip is 'any' and destination port is also 'any'.
User contributions licensed under CC BY-SA 3.0