db's firewall is on, with only ssh allowed. The shop app on web needs the database, but no other machine does.
New command
sudo ufw allow from
Lets one address in on one port. Everyone else still gets nothing.
Usagesudo ufw allow from address to any port port
text
learner@db:~$ sudo ufw allow from 10.0.0.10 to any port 5432
Rule added
learner@db:~$ sudo ufw status
…
5432 ALLOW 10.0.0.10 ← web onlysudo ufw allow 5432 would let every machine in. To remove a rule, type it again after delete:
text
learner@db:~$ sudo ufw delete allow from 10.0.0.10 to any port 5432
Rule deletedObjectives
- Let web reach the database.
- What ops gets now.