Each of your Cardano nodes needs a static IP address to communicate between each other. You can use IP or domain names.
Block Producer (BP) node
For better security, you can choose to set a private IP to your BP node to communicate with your relays (on the same private network) since your BP is hosting sensitive data you don't really want to expose.
Relay nodes
However, it is necessary that the relay nodes have a public IP address as the other external relay servers will need to establish incoming TCP/IP connections with yours to exchange and update informations.
You can set 1 public IP address for each one of your relays but you can also use a single public IP address and port-forward to share with your relays.