Add automatic firewalling for replicas.

This adds automatic firewalling so that all the replicas have the right
ports open, and only the right ports open to the right replicas.