I own a linux Debian 6 server, and it's running some of my projects.
I'm now in need of a tool that listens on a certain IP address and port, and if a TCP packet is being sent to that destination, it should catch the packet, and forward it to 2 different destinations.
What I was thinking myself is using some iptables setup, but I don't have a clue how I would do that.
I would be really thankful if someone has a solution for this.
The above example will forward requests received on port 80 via eth0 to 22.214.171.124 port 8081.
I do not think REDIRECT is able to clone packets.
To clone a packets and send it later to two different destinations you could take a look at the TEE target... or if you want to skip iptables check out if socat is able to accomplish what you are looking for
You might want to take a look at HAProxy for proxying the packets to the final destination. You can use tcp mode to forward the packets. I'm not sure if you can configure HaProxy directly to clone to request however, you could forward the packet to a custom iptables entry port or a number of different ways to clone the request.
PCLHS | SAS70 Datacenters in New Jersey/Texas 100TB Dedicated Servers • 1U - Full Cab Colocation • Complex Hosting • Horizontally Scalable Hosting • DR/HA Hosting • Public and Private Clouds • Web Farms • Innovative, Reliable, and Responsive Contact Us E: mark [at] pclhs.net | W: www.pclhs.net