Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to forward TCP traffic from Server A which is a Linux Server to Server B which is a Windows server. Both are connected to the internet (public IP) and not in the same (local) network.

I have used this for my question: How to route UDP traffic from one public IP (linux) to another public IP(Windows) (rinetd)

The problem is that network traffic arriving at server B via Server A has Server A as source-IP.

My question is: Can I change this setup so that the Windows Server sees the original source IP and not server A as source IP

share|improve this question

Yes, you can. As David mentioned, it is very difficult to do this unless the forwarding machine (A) is the default router for the receiving one (B). Making a linux machine into a router is not difficult, and some selective iptables DNAT use should allow you to alter the destination. I'm not sure this is the best way to do what you are looking to do, however.

share|improve this answer
Although a bit of information about what sort of traffic you want to forward might be nice.. – NickW Feb 26 '14 at 14:01
TCP traffic, port 30000 needs to be forwarded. It is meant as a DDoS protection, because other traffic ends at Server A which has DDoS protection. Server B doesn't have DDoS Protection. – user1857116 Feb 26 '14 at 14:03
Hmm, in this case you'll probably want to mark packets with iptables, then use the fwmark as the basis for your routing policies. Just a question, the public IPs are not in the same subnet are they? – NickW Feb 26 '14 at 14:14
Server A is in Datacenter A (in USA) and Server B is in Datacenter B (in The Netherlands), so no, they are not in the same subnet. Do you have examples for iptables with the things you suggest? – user1857116 Feb 26 '14 at 14:17
I think I may take a step back from my previous statement here. I was going on the assumption that the machines were in the same DC or on the same connection. This has gone from feasible to awfully difficult. I think you might be better off purchasing something to install in DC B to perform this sort of thing. – NickW Feb 26 '14 at 14:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.