I think I have exhausted everything I can think of. Using postgresql 16
If I try to connect with
psql -d dbname -h localhost
it prompts for a password and connects just fine. However, if I try to connect with
psql -d dbname -h 192.168.86.27
it does not prompt for password and I get this message
psql: error: connection to server at "192.168.86.27", port 5432 failed: FATAL: no pg_hba.conf entry for host "192.168.86.27", user "postgres", database "dbname", no encryption
My pg_hba.conf contains this
local all all trust local replication all trust host replication all 127.0.0.1/32 trust host replication all ::1/128 trust host all all 0.0.0.0/0 trust host all all ::0/0 trust host all all 192.168.0.0/16 trust
My postgresql.auto.conf contains
listen_addresses = '*'
netstat -nlt shows that the ports should be accepting all connections
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp6 0 0 :::5432 :::* LISTEN tcp6 0 0 :::111 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 ::1:631 :::* LISTEN
I realize the security implications of setting it up this way. I'm just trying to get it to work at this point.
psql -h 192.168.86.27 -U postgres
and connect without errors.