Linux Networking – Send Duplicate Packets Over Two Connections

iplinuxnetworkingrouting

I need to duplicate an RTP stream over two different (non-reliable) Internet connections.

On the receiver side, I will probably run a custom program that will use a buffer and rebuild the stream before using it.

But I have some trouble in splitting the traffic over the two connections. I did some research and found that maybe tc (part of iproute2) could be what I need.

Best Answer

The Linux kernel version 2.6.35 introduces a new configuration option CONFIG_NETFILTER_XT_TARGET_TEE:

This option adds a "TEE" target with which a packet can be cloned and this clone be rerouted to another nexthop.

Iptables supports the -j TEE target since 1.4.8.

Earlier support was through the xtables addons, which include both kernel modules and userland tools. You may still prefer this option if you prefer to stick with your distribution's kernel and it's too old to have TEE.

There's a tutorial by bjou (written before the feature was included in the official kernel and iptables).

Related Question