You can’t get the source IP in replicated mode in the swarm. That’s been a known issue for a while now.
You can get around it by using host mode but that will prevent you from doing the swarm load balancing which means you need to have an external loadbalancer.