Linux Increase Local Port Range

Increase Local Port Range
In case your Linux server is opening a lot of of outgoing network connections, you might have to increase local port range. By default range is small.
How To Implement?
Edit the following file:
vi /etc/sysctl.conf
And add:
net.ipv4.ip_local_port_range = 20000 65535
Then run:
sysctl -w net.ipv4.ip_local_port_range="20000 64000"
You can confirm the change by running the following:
sysctl net.ipv4.ip_local_port_range
How To Revert?
Again edit:
/etc/sysctl.conf
Remove this line:
net.ipv4.ip_local_port_range = 20000 65535
Then run:
sysctl -w net.ipv4.ip_local_port_range="32768 61000"
Confirm with:
sysctl net.ipv4.ip_local_port_range
Recent Posts

How DigitalOcean Simplifies Cloud Computing for Developers
2023-01-18 12:35:28
How to Get Current Route Name in Laravel
2020-11-08 08:57:11
How to check the logs of running and crashed pods in Kubernetes?
2020-10-28 09:01:44
Top 10 VScode Shortcuts For Mac and Windows to Help You be More Productive
2020-10-28 07:12:51