-   Linux - Networking (
-   -   packet cloning and routing with single NIC (

gianman 11-10-2006 10:33 AM

packet cloning and routing with single NIC
I need help to setup a linux box with a single NIC to solve this problem:
On the same LAN ( there are one ethernet device and 2 PCs connected with a switch.
The device act as a server on port 5000 but can accept only 1 connection ( unfortunately is proprietary software...)
Te PCs are windows machine, and works in mirror, for redundancy purpose, and they must have the same data input from the server, but for the server limitation, only one of them can connect to.

the idea is to put a linux box with its NIC connected to the switch on the same LAN, in order to receive packets from PCs and route them to the device and viceversa, take the packet from the device and route to both PCs.
I've seen the iptables, I'm completely new about it, so I ask help...

First problem:
I'm triyng to realize the ip and port redirection from Pc to device using PREROUTING and DNAT, but it doesn't work... : device ip : Pc1 ip : Pc2 ip linux box ip

PC1 connection on linux box is on port 5500
PC2 connection on linux boxis on port 5501

iptables -D PREROUTING -t nat -p tcp -d --dport 5500 -j DNAT --to
iptables -D PREROUTING -t nat -p tcp -d --dport 5501 -j DNAT --to

this rules works only for port redirection, not for IP redirection...
where am I wrong?

Second problem:
I have no idea on how realize the data flow Device --> PCs , cloning the packet from the device.
Infact each PC must have the same tcp packet in input to work for redundancy.
I'have seen the mangle -tee option, but I'm quite confusing on how to use it.
Can someone clarify ( maybe with some examples..)?

Is there any other way to do this job?


All times are GMT -5. The time now is 07:59 AM.