0

I've currently got a Linux router running iptables-services. I've set up forwarding on the server and masquerade out as the public interface's IP on the outbound using the POSTROUTING chain.

I'm trying to simulate a disconnect for an application I'm working on - as if the client sending traffic to my UDP port has stopped doing so, or alternatively my traffic returning to them stops. To achieve this, I'd like to drop traffic on the router itself.

Addresses for talking sake are 192.168.1.10 for my machine, 192.168.1.254 for router local interface, router public is 80.80.80.80, and public peer address is 90.90.90.90.

I would like to drop traffic being forwarded by the router (with NAT masquerading) from my local IP 192.168.1.10 destined for the public peer. Say drop all outbound UDP traffic on port 1000 from 192.168.1.10. Or alternatively, do the same, but catch it on the inbound - so 90.90.90.90 trying to reach my PC at 192.168.1.10.

I want to interrupt / override the process of UPnP by blocking any traffic from reaching the UDP listen port on my local machine through the router.

  • 1
    Without knowing what you have tried so far, does iptables -I FORWARD --protocol udp --dport 1000 -j REJECT work for you? – Thomas Mar 18 '18 at 17:29
  • I don't have a linux router set up to test this but I think you should be able to build what you want with man tc, man tc-flow and man netem. – flerb Mar 23 '18 at 0:02

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.