There's a binary that I need to run which uses bind
with a port argument of zero, to get a random free port from the system. Is there a way I can constrain the range of ports the kernel is allowed to pick from?
How to limit range of random port sockets
kernelnetworkingsocketsysctltcp
Best Answer
on Linux, you'd do something like
instruction for changing ephemeral port range on other unices can be found for example at http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html