I'm using iptables to block Internet (by redirecting to an internal server) access on devices connected to my hotspot. That's my command:
iptables -t nat -I PREROUTING -p tcp -s 192.168.43.51 -j DNAT --to-destination 192.168.43.1:12345 iptables -t nat -I PREROUTING -p udp -s 192.168.43.51 ! --dport 53 -j DNAT --to-destination 192.168.43.1:12345
192.168.43.51 is the device I'm blocking and 192.168.43.1:12345 is the internal server. So it's working but there is a delay between real blocking and command execution. For example while I'm downloading a file, I am executing that command but file keeps downloading for a 5-15(apprx.) seconds while the user can consume some additional data. How can it be solved?