Ubuntu – Port forwarding on Ubuntu – what are the minimum and maximum port numbers to use

linux-networkingnetworkingportport-forwardingUbuntu

I'm using rinetd on Ubuntu as a port forwarding server. I'm running this on EC2. I need to know which ports are available for me to use for port forwarding.

I know that the privileged ports are 01023, so that means I can start at 1024, correct?

Does that also mean that I can use up to 65535?

Please remember, this question is specific to Ubuntu.

Best Answer

This question is actually specific to Linux.

If you're on EC2, you presumably are root inside your VM. Therefore you can use any port you want to accept connections to.

Outgoing ports are usually allocated dynamically; the range which the system uses is configured in /proc/sys/net/ipv4/ip_local_port_range. But the application is free to bind to any specific local port when connecting out.