1

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

1
  • 4
    You mixed up source and destination. iptables -I INPUT -p udp -d 239.255.52.123 --dport 35912 -j DROP should work.
    – Lenniey
    Jan 9, 2018 at 16:31

1 Answer 1

2

As per @lenniey's comment, there is a mixup in the original command between the source and destination address/port.

The multicast address should be specified as the destination:

iptables -I INPUT -p udp -d 239.255.52.123 --dport 35912  -j DROP

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .