Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to duplicate UDP traffic for SYSLOG and NetFlow data and was hoping to use iptables to do so, but so far I'm not having much luck.

I'm aware of other user space software packages that can accomplish this, but they don't seem very well maintained by their developers, so I'd prefer to avoid them if at all possible.

share|improve this question
possible duplicate of Copying packets from an interface to another – Zoredache Feb 16 '11 at 23:53
I'm unsure what you mean by duplicate. If you mean log twice the logging targets of iptables are non terminating, and if you mean literally create a secondary packet and forward it to some other machine there's a target that does that, too. – Robbie Mckennie May 23 '13 at 2:21

You could use the iptables TEE target as long you have the xt_TEE modules in your kernel. You can duplicate packets incoming in your box and send them to another server in your LAN.

Es. to duplicate all incoming dns requests and send them to server

iptables -t mangle -A PREROUTING -i eth0 -p udp --dport 53 -j TEE --gateway

Another solution is to use a userspace program as

share|improve this answer
will this preserve the source ip of the incoming packets when they hit the gateway ? – Amistad Feb 4 '15 at 20:59
@Amistad: says: "iptables simply modifies the ethernet header of the original packets to the target host's MAC address. Therefore, you can not get the original source and destination mac addresses. Also, the target host must be in the same subnet as the mirroring source." – Peter V. Mørch Jun 26 '15 at 4:00
Heads Up: the link seems to be for openwrt only. – Peter V. Mørch Jun 26 '15 at 4:03

Your Answer


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.