It is possible using iptables (on Debian) to block all inbound connections for all the ports with a port number over (as an example) 16000.
Like this (using 16000 as reference):
The port 15999 is open for input, instead from port 16000 to 65535 inbound connections are dropped.