My application listens to a stream of data that is broadcast using UDP. I would like to simulate a network outage by interrupting the UDP traffic on my server.
In order to achieve this I have attempted to run the following iptables
command to block all incoming traffic on address 239.255.52.123
port 35912
/sbin/iptables --insert INPUT --protocol udp --source 239.255.52.123/24 --sport 35912 --verbose --jump DROP -m comment --comment 'Emergency Drop'
This does not appear to be working a simple netcat listening to this address continues to receive data after executing the iptables
command
iptables -I INPUT -p udp -d 239.255.52.123 --dport 35912 -j DROP
should work.