Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
3  
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

1 Answer 1

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 192.168.0.10

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

Another solution is to use a userspace program as http://code.google.com/p/port-mirroring/

share|improve this answer

Your Answer

 
discard

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.