How to view and edit the ephemeral port range on Linux?

℡╲_俬逩灬. 提交于 2019-12-06 00:00:42

问题


In my Linux system ephemeral port range is showing different ranges as follows

$ cat /proc/sys/net/ipv4/ip_local_port_range 
32768  61000 

cat /etc/sysctl.conf | grep net.ipv4.ip_local_port_range
net.ipv4.ip_local_port_range = 9000 65500

Which will be the effective ephemeral port range in my system?


回答1:


Following command will list the ephemeral port range in Linux system

sysctl -A | grep ip_local_port_range 

If we don't want to reboot, after editing /etc/sysctl.conf file if we execute following command it will be effective.

sysctrl -p /etc/sysctl.conf .

The truth of the matter of effective range is output of

sysctl net.ipv4.ip_local_port_range 

as mentioned by eckes in comment.



来源:https://stackoverflow.com/questions/28573390/how-to-view-and-edit-the-ephemeral-port-range-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!