Hi guys. I want capture LAN<>Gateway traffic using iptables and netfilter-queue. But the iptable rules I tried is not working as what I expected. I want to capture traffic in gray box in picture.
If I can capture traffic in gray box I could see some thilg like these.
- DNS request from hosts in router before masquerading.
- DNS reponse from DNS server after masquerading.
- TCP traffic from hosts in router before masquerading.
- TCP traffic from hosts in router after masquerading.
I've tried rules below some rules for testing.
iptables -I INPUT -j NFQUEUE
iptables -I OUTPUT -j NFQUEUE
iptables -t nat -I PREROUTING -j NFQUEUE
iptables -t nat -I POSTROUTING -j NFQUEUE
iptables -t nat -I INPUT -j NFQUEUE
iptables -t nat -I OUTPUT -j NFQUEUE
I was not available to capture LAN<>GATEWAY traffic using rules above. I think netfilter-queue is fine because I could capture traffic of ROUTER<>WAN using rules above. I don't think I can capture LAN<>GATEWAY traffic using filter table but I'm wondering why rules in nat table is not working. How can I capture traffic of LAN<>GATEWAY?