Question

How to allow access only this ip address to server postgres

Posted July 8, 2021 103 views
UbuntuSecurityNetworkingFirewallUbuntu 20.04

Hello,
I have ufw enabled, how to make it accept connections for a postgres server (5432) on the internet, only to the ip 190.152.109.234, I have already tried this:
sudo ufw allow from 190.152.109.234 port 5432
sudo ufw allow from 190.152.109.234/32 port 5432
sudo ufw allow proto tcp from 190.152.109.234 port 5432

but nothing works, what could be the cause?

regards..

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.

×
Submit an Answer
1 answer

Hi @efabiancj,

Before I can provide you with some examples, I’m not sure I entirely understand, please correct me if I’m wrong. So you have two droplets one of which is a Postgres droplet. You want to allow connections from the droplet that doesn’t have Postgres to the one that does only from the sad IP address, is that correct?