Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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 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 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 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 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 at 14:23

Your Answer

 
discard

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.