im web developer and i have not good knowledge about devOps and server config, i use this code for forwarding data from server a to b from client my mean is:
client---------->serverA--------->serverB
now how can i keep original client ip when i use ip forward to server B? is there any way? i used following commands before but i don't know it work for my new concept or not?
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination serverA_IP
iptables -t nat -A PREROUTING -j DNAT --to-destination serverB_IP
iptables -t nat -A POSTROUTING -j MASQUERADE