I faced a problem here. Mongodb native driver on nodejs tries to discover the topology and replaces the external IP addresses with internal ones (when using mongoose client). See the issue raised :- http://stackoverflow.com/questions/41307098/mongoerror-no-primary-found-in-replicaset-mongoose-replaces-external-ip-addres