Suresh Kumar Suresh Kumar - 1 year ago 122
Linux Question

How to block udp ports range in linux RHEL7

need to test an application which uses the UDP port range from 5000 to 60,000 in. i want to test the boundary value condition for ports. so i want to block UDP ports range from 5000 to 59999.

Answer Source

Using iptables:

iptables -A INPUT -p udp --dport 5000:59999 -j DROP

or, better,

iptables -A INPUT -p udp --dport 5000:59999 -j REJECT --reject-with icmp-port-unreachable
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download