Pg_hba.conf problem after unexpected IP change

Started by Yessica Brinkmannover 4 years ago10 messagesgeneral
Jump to latest
#1Yessica Brinkmann
brinkmann.yessica@gmail.com

Hello. I write for the following reason: I had configured a pg_hba.conf
file, which I am using with some debian virtual machines, to be able to
communicate between two different virtual machines.
Well, it turns out that at one point when I was using my virtual machines,
suddenly and unexpectedly, the IP of one of the virtual machines changed.
I was trying to find out why the commands that I was executing between one
virtual machine and the other did not work for me, until finally I came to
the conclusion that the IP of one of my virtual machines had changed.
Well, then, I went to modify my pg_hba.conf file so that it reflected the
new IP that I did not know why it changed, and to continue communicating
between the two virtual machines, but it turns out that when I change my
pg_hba.conf file, the connection still does not work for me .
The new line in my pg_hba.conf file is as follows:
host ds2 postgres 192.168.52.153/32 trust
and the line above was:
host ds2 postgres 192.168.52.150/32 trust
I clarify that right now when doing ip addr in the virtual machine whose IP
changed unexpectedly, the following IP address appears: 192.168.52.153/24.
I will greatly appreciate a help please.
Regards,
Yessica Brinkmann

<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
Libre
de virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Yessica Brinkmann (#1)
Re: Pg_hba.conf problem after unexpected IP change

On 11/11/21 17:14, Yessica Brinkmann wrote:

Hello. I write for the following reason: I had configured a pg_hba.conf
file, which I am using with some debian virtual machines, to be able to
communicate between two different virtual machines.

Well, then, I went to modify my pg_hba.conf file so that it reflected
the new IP that I did not know why it changed, and to continue
communicating between the two virtual machines, but it turns out that
when I change my pg_hba.conf file, the connection still does not work
for me .

Did you reload or restart the server after making the change?

I clarify that right now when doing ip addr in the virtual machine whose
IP changed unexpectedly, the following IP address appears:
192.168.52.153/24 <http://192.168.52.153/24&gt;.
I will greatly appreciate a help please.
Regards,
Yessica Brinkmann

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Yessica Brinkmann
brinkmann.yessica@gmail.com
In reply to: Adrian Klaver (#2)
Re: Pg_hba.conf problem after unexpected IP change

Hello.
Thank you very much for your answer.
Yes, I restart the server after making the changes.
Regards,
Yessica Brinkmann

<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
Libre
de virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

El jue, 11 nov 2021 a las 22:41, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

Show quoted text

On 11/11/21 17:14, Yessica Brinkmann wrote:

Hello. I write for the following reason: I had configured a pg_hba.conf
file, which I am using with some debian virtual machines, to be able to
communicate between two different virtual machines.

Well, then, I went to modify my pg_hba.conf file so that it reflected
the new IP that I did not know why it changed, and to continue
communicating between the two virtual machines, but it turns out that
when I change my pg_hba.conf file, the connection still does not work
for me .

Did you reload or restart the server after making the change?

I clarify that right now when doing ip addr in the virtual machine whose
IP changed unexpectedly, the following IP address appears:
192.168.52.153/24 <http://192.168.52.153/24&gt;.
I will greatly appreciate a help please.
Regards,
Yessica Brinkmann

--
Adrian Klaver
adrian.klaver@aklaver.com

#4Dave Cramer
pg@fastcrypt.com
In reply to: Yessica Brinkmann (#3)
Re: Pg_hba.conf problem after unexpected IP change

On Fri, 12 Nov 2021 at 06:12, Yessica Brinkmann <brinkmann.yessica@gmail.com>
wrote:

Hello.
Thank you very much for your answer.
Yes, I restart the server after making the changes.
Regards,
Yessica Brinkmann

Check the logs for postgres to make sure there were no errors in your new
configuration.

Dave Cramer
www.postgres.rocks

Show quoted text
#5Yessica Brinkmann
brinkmann.yessica@gmail.com
In reply to: Dave Cramer (#4)
Re: Pg_hba.conf problem after unexpected IP change

Thank you very much for your answer.
Regards,
Yessica Brinkmann

El vie, 12 nov 2021 a las 9:22, Dave Cramer (<davecramer@postgres.rocks>)
escribió:

Show quoted text

On Fri, 12 Nov 2021 at 06:12, Yessica Brinkmann <
brinkmann.yessica@gmail.com> wrote:

Hello.
Thank you very much for your answer.
Yes, I restart the server after making the changes.
Regards,
Yessica Brinkmann

Check the logs for postgres to make sure there were no errors in your new
configuration.

Dave Cramer
www.postgres.rocks

#6Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Yessica Brinkmann (#5)
Re: Pg_hba.conf problem after unexpected IP change

On 11/12/21 10:34 AM, Yessica Brinkmann wrote:

Thank you very much for your answer.

Did you find the problem?

If not have you investigated whether whatever changed the IP also
enabled a firewall rule that blocks port(5432 I'm assuming)?

Regards,
Yessica Brinkmann

El vie, 12 nov 2021 a las 9:22, Dave Cramer
(<davecramer@postgres.rocks>) escribió:

On Fri, 12 Nov 2021 at 06:12, Yessica Brinkmann
<brinkmann.yessica@gmail.com <mailto:brinkmann.yessica@gmail.com>>
wrote:

Hello.
Thank you very much for your answer.
Yes, I restart the server after making the changes.
Regards,
Yessica Brinkmann

Check the logs for postgres to make sure there were no errors in
your new configuration.

Dave Cramer
www.postgres.rocks

--
Adrian Klaver
adrian.klaver@aklaver.com

#7Yessica Brinkmann
brinkmann.yessica@gmail.com
In reply to: Adrian Klaver (#6)
Re: Pg_hba.conf problem after unexpected IP change

Hello.
Thank you very much for your answer.
The configuration actually works for me. After restarting my computer, I
went to test again and it was already working. I assume that perhaps
because they are virtual machines it was not only enough to restart the
server, I think you also had to restart the computer.
It's what I think, or I don't know what else could have happened, but now
it's working for me.
Thank you very much and greetings,
Yessica Brinkmann

<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
Libre
de virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

El vie, 12 nov 2021 a las 15:37, Adrian Klaver (<adrian.klaver@aklaver.com>)
escribió:

Show quoted text

On 11/12/21 10:34 AM, Yessica Brinkmann wrote:

Thank you very much for your answer.

Did you find the problem?

If not have you investigated whether whatever changed the IP also
enabled a firewall rule that blocks port(5432 I'm assuming)?

Regards,
Yessica Brinkmann

El vie, 12 nov 2021 a las 9:22, Dave Cramer
(<davecramer@postgres.rocks>) escribió:

On Fri, 12 Nov 2021 at 06:12, Yessica Brinkmann
<brinkmann.yessica@gmail.com <mailto:brinkmann.yessica@gmail.com>>
wrote:

Hello.
Thank you very much for your answer.
Yes, I restart the server after making the changes.
Regards,
Yessica Brinkmann

Check the logs for postgres to make sure there were no errors in
your new configuration.

Dave Cramer
www.postgres.rocks

--
Adrian Klaver
adrian.klaver@aklaver.com

#8Ray O'Donnell
ray@rodonnell.ie
In reply to: Yessica Brinkmann (#7)
Re: Pg_hba.conf problem after unexpected IP change

On 14/11/2021 19:46, Yessica Brinkmann wrote:

Hello.
Thank you very much for your answer.
The configuration actually works for me.After restarting my computer, I
went to test again and it was already working. I assume that perhaps
because they are virtual machines it was not only enough to restart the
server, I think you also had to restart the computer.
It's what I think, or I don't know what else could have happened, but
now it's working for me.

Restarting the entire computer shouldn't be necessary... On the Debian
servers I look after, it's enough to do:

systemctl restart postgresql

(or whatever the name of the particular service is).

Ray.

--
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie

#9Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ray O'Donnell (#8)
Re: Pg_hba.conf problem after unexpected IP change

On 11/14/21 11:55, Ray O'Donnell wrote:

On 14/11/2021 19:46, Yessica Brinkmann wrote:

Hello.
Thank you very much for your answer.
The configuration actually works for me.After restarting my computer,
I went to test again and it was already working. I assume that perhaps
because they are virtual machines it was not only enough to restart
the server, I think you also had to restart the computer.
It's what I think, or I don't know what else could have happened, but
now it's working for me.

Restarting the entire computer shouldn't be necessary... On the Debian
servers I look after, it's enough to do:

    systemctl restart postgresql

(or whatever the name of the particular service is).

Actually that was already done:

/messages/by-id/CAOR+mccGARtFsb7c+F=RUk832=daaJ8+yQW8eBYa1Krypr4O6Q@mail.gmail.com

The problems seems to have stemmed from this(per OP):

"Well, it turns out that at one point when I was using my virtual
machines, suddenly and unexpectedly, the IP of one of the virtual
machines changed."

Something to do with the networking between host and VM's I presume.

Ray.

--
Adrian Klaver
adrian.klaver@aklaver.com

#10Ray O'Donnell
ray@rodonnell.ie
In reply to: Adrian Klaver (#9)
Re: Pg_hba.conf problem after unexpected IP change

On 14/11/2021 20:16, Adrian Klaver wrote:

Actually that was already done:

/messages/by-id/CAOR+mccGARtFsb7c+F=RUk832=daaJ8+yQW8eBYa1Krypr4O6Q@mail.gmail.com

The problems seems to have stemmed from this(per OP):

"Well, it turns out that at one point when I was using my virtual
machines, suddenly and unexpectedly, the IP of one of the virtual
machines changed."

Something to do with the networking between host and VM's I presume.

Ah, OK - I missed that. Serves me right for jumping in late. :-)

Ray.

--
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie