Hi are these on separate VMs? the error “no route to host” suggests that the FW is not open. You can check this very easily by doing a telnet secondary_ip mongod_port from the primary and see if it can can connect. Even though the ping succeeds you need to validate on the specific mongod port.
if that fails it means there is a FW blocking it (probably the default rhel FW) so you can open it and then try again.