/etc/sysctl.conf配置文件参数详解

发布时间 2023-07-19 15:01:21作者: 双叶幼稚园IT协会
【net.ipv4.ip_local_port_range   32768-61000】
原文解释是:
The /proc/sys/net/ipv4/ip_local_port_range defines the local port range that is used by TCP and UDP traffic to choose the local port. You will see in the parameters of this file two numbers: The first number is the first local port allowed for TCP and UDP traffic on the server, the second is the last local port number. For high-usage systems you may change its default parameters to 32768-61000 -first-last.
该选项定义了本地tcp/udp的端口范围。能够理解为系统中的程序会选择这个范围内的端口来链接到目的端口,即用于向外连接的端口范围(对同一个ip+port可以创建的连接数),net.ipv4.ip_local_port_range的默认值为32768 61000,也就是说可以对同一个服务器的ip+port创建28233个连接,如果觉得不够可以改大一些,如10000 61000,不过需要注意的是不要改的占用正常服务监听的端口范围。