I have a server running mysql, ssh and other services. I want to see the range for ephemeral ports available for the OS running:
which returns 32768 - 61000. When I run
sudo netstat -anp
I get in the foreign addresses, many ips and also ports outside the range stated before. Example:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 10.251.1.62:3306 220.127.116.11:63192 ESTABLISHED 1483/mysqld
Which looks to me that my server is assigning port 63192 to the remote host, which is not it's allocated range. How is this possible? am I not looking the ephemeral ports in the right place? am I not understanding properly the output of netstat? Am I not understanding how ephemeral ports work at all? Thanks.