ephemeral ports ubuntu


I connect to a website on port 3000 like so :

curl localhost:3000

a random port is used to start the connection (known as ephemeral port)
you can see this with lsof for exemple :
TCP localhost:46862->localhost:3000 (ESTABLISHED)

ephemeral ports can be tweaked from this file :

cat /proc/sys/net/ipv4/ip_local_port_range
32768   60999