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!