I have a Windows computer with IP Forwarding activated. However, I want to forward everything except the traffic that goes to port 53 in UDP. In Linux, this is easily solved with iptables: iptables -A FORWARD -p udp --dport 53 -j DROP.

How can I do this with Windows? I think the firewall hasn't got the option of managing forward rules, only input and output.

Thanks for any suggestion.

  • Port 53 is DNS, and DNS uses TCP too, not just UDP. What you are trying to do by dropping these packets? – Patrick Mevzek Aug 15 '18 at 19:04
  • I'm doing a DNS Spoofing test with python. What I want is to answer those packets, or forward them if I'm not interested. That's why I need that packets on port 53 are not forwarded by default. This works perfectly with the iptable rule mentioned above. – Klecko Aug 15 '18 at 22:34
  • Yes, it does work for some part of DNS traffic, that is the one on UDP. As soon as the client switches to TCP, your iptable rule will do nothing anymore. This is the only point I wanted to address because far too many people think DNS is only over UDP which causes a tremendous amount of problems for both them and the global community. – Patrick Mevzek Aug 15 '18 at 22:44
  • I didn't know DNS could work with TCP, thanks. The solution to that problem is easy. The point is how to disable IP forwarding on port 53 in Windows. – Klecko Aug 15 '18 at 22:54

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.