You won't accomplish much even if your iptables
statements were correct.
UDP
is stateless. This means that I can send arbitrary & large UDP packets to your server. These packets will be DROP
ped by the kernel if there is no process listening on the destination UDP port. The traffic has still crossed the internet and hit your modem/demarc.
The only thing you will be able to prevent with UDP dropping is to prevent the flooding of ports associated with a running service. EG: I can craft large DNS packets and send them via UDP you your DNS server's port. The server will presumably ACCEPT
those packets and attempt to process them. It is this processing that blocking MIGHT help.
You are going to have a bad time if you try to block arbitrary UDP packets. DHCP, DNS, RPC, NFS, NTP, etc... A ton of important network protocols run over UDP. These will need to be allowed.
I suggest you take another look at your network. IF you are having a problem with UDP flooding, you can look at addressing the exact cause and then possible solutions.
If you are being flooded with large UDP packets that are filling your upstream bandwidth look at getting more bandwidth or DDoS protection.
If some application is misbehaving because of the flood, consider fixing the application, using a better one, or getting crazy with some kind of layer 7 firewall to pre-screen packets.
Finally, if you just think blocking UDP flooding
is a good idea because....? ...? It's probably not. It will likely break more than it solves unless you have a specific UDP flood issue.