It's handy to use UFW to limit the amount of bandwidth, resources, and ultimately the number of peers that IPFS can connect to. IPFS can be a resource hog, and there are not internal tools to mitigate it. The official stance from IPFS is that bandwidth and firewall controlls should be implemented by the host OS, not by their software.
All ipfs-coord-esm consumers use port 4001 or 4003 and TCP. No peers use UDP or QUIC (which runs on UDP). So any connections to peers using these protocols are wasted resources.
Allow SSH connections:
sudo ufw allow ssh
DENY incoming UDP connections on port 4001: