I've a Linux box with 3 network adapaters, which I'd like to configure as follow:
- Adapter A is connected to computer A
- Adapter B is connected to computer B
- Adapter C is connected to the Internet. Specifically, to someserver.com
What I want to acheive:
- All traffic from A will go to the Internet
- Define a special "secret port" on Adapter B
- TCP traffic coming from Computer B going to 'someserver.com' on 'secret port' will masquerade its source IP to appear as it is coming from Computer A
- TCP traffic coming back from 'someserver.com' going to Computer A to the same port used in #3, will redirect to computer B.
Do I need to implement a router or a bridge? Can I do it merely by configuring NetFitler/ip tables or should it implement some code? If code, at which layer to I integrate with the IP stack?