I have a C program attached to a TUN interface. In my C program, I'm building packets and writing them to the TUN interface.

Now to check if packets are really sent from my TUN interface I use iptables rules to log them:

#iptables -t mangle -A PREROUTING -j LOG --log-prefix "PREROUTING-MANGLE " --log-level 4 #iptables -t mangle -A INPUT -j LOG --log-prefix "INPUT-MANGLE " --log-level 4 #iptables -t mangle -A FORWARD -j LOG --log-prefix "FORWARD-MANGLE " --log-level 4

I can see log messages in the PREROUTING chain, which means packets are correctly sent from the TUN interface. But I can't see packets hit other chains. I have correctly configured my routing rules and the forwarding option is activated.

Is there any way to log dropped packets or to know the reason why are they dropped?

Any help would be very appreciated!

  • "Not routed" is usually not a firewall problem with locally generated packets. What happens if you disable Netfilter? – Hauke Laging Jun 26 '14 at 14:29
  • Still the same problem and I need netfilter to filter packets anyway. Don't you know a way to log packets if they're dropped after the routing decision? – HaTiMuX Jun 26 '14 at 14:42
  • You can check that with the iptables target TRACE. – Hauke Laging Jun 27 '14 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.