How can I block IP range for all programs?

Is there a way to block all inbounds for a specific range of ip?
What I found is that I can only find settings that can specify a specific program and limit remote ip only for that program.
These days, certain ip keeps trying to attack my pc, but I can't stand the notification every time.
I want to block all of those bands, is there any way?