Connect to a replica set with only one static public IP

Hi,

I currently have a replica set with 4 nodes (4 different Linux servers), but only one of them has a static public IP address. In the private network everything works just fine.
Now I have a new requirement, I need to connect to this Mongo DB from another network, read and write needed. Of course I will configure firewall and access rules accordingly (I can whitelist IPs).
If it was a read-only request it was enough to connect to the static IP address node.

How can I approach to this problem without having to force all of the involved IPs to be static?

Thanks in advance for your suggestions!

All nodes of the replica set must be accessible from all clients.

The solution is to set up the replica set using host names and have the appropriate DNS services.