Assuming linux.
You need to do two things:
- Turn on ip forwarding
- Set up masquerading Source Network Adress Translation (SNAT)
Leave everything how you have it and check that IP forwarding is on is on.
sysctl net.ipv4.ip_forward
[root@somehose ~]$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0
If that is set to 0 (as it is in the above example) then you need to set it to 1 (on).
Edit /etc/sysctl.conf
Make sure that:
net.ipv4.ip_forward = 1
Run sysctl -p
to reload sysctl.conf
that will cause all the settings in that file to be read and set. Since it is in the file they will also be reser at boot time.
Then run sysctl net.ipv4.ip_forward
again to make sure it actually changed.
[root@somehose ~]$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
Now I'm very confident of the above.
You'll also need to turn on SNAT on server2. Assumes SERVER #2 NIC #2 is eth1 and SERVER #2 NIC #1 is eth0
I'm not 100% sure on the actual command syntax and I don't have a test rug I can test on where I am but you can just google "masquerading iptables SNAT" and you can find a howto.
Come to think of it you could have googles that and got the whole answer. Never mind.
iptables -t nat -A POSTROUTING --out-interface eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp -o eth0 -j SNAT --to-source 10.10.10.3
You need to put this in the appropriate file for your distro so that it persists accross reboots.