Information Security Stack Exchange is a question and answer site for information security professionals. 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

In a wireless Ad-Hoc network, I have two computers which communicates in UDP together from to

I have a third computer ( which wants to listen to the packets which are not addressed to it. I can see the packets with tcpdump (which sets the wireless card in promiscuous mode).

To redirect the packets, I am using :

iptables -t nat -I PREROUTING -s -j DNAT --to-destination

Is it the only rule I need to use? Why isn't it working? Did I miss other requirements?

share|improve this question
Something looks strange here. In a wireless network, why are you re-transmitting through iptables? The destination is receiving multiple copies of the same packets. If all you are doing is sniffing, you do not need to route. – schroeder Jun 5 '13 at 17:02
I don't want to re-transmitting packets. I would like to catch the packet which are not destinated to computer .5 – Mathieu Leiv Jun 5 '13 at 17:29
But you are 'redirecting' the packets ... What did you intend iptables to do? – schroeder Jun 5 '13 at 17:37
up vote 7 down vote accepted

Why are you using iptables rather than using good old Wireshark which is specifically made for this? Wireshark is a free and open-source packet analyzer and the ideal tool for performing these types of analysis.


If you need to reinject the packets I would have a look at scapy in python.

share|improve this answer
I am reusing the packets caught by my filter. Is there anyway to reemit Wireshark caught packets ? – Mathieu Leiv Jun 5 '13 at 15:07
I would have a look at scapy – Lucas Kauffman Jun 5 '13 at 15:15

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.