PowerFlex:如何在 Linux 上调整临时端口范围
Summary: 当进程或内核模块通过网络发起通信时,将从临时端口范围中分配本地端口作为套接字的一部分。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
默认情况下,临时端口范围介于 32768 和 60999 之间。
有时,可能需要配置此范围或在此范围内保留某些端口。第三方软件可能会使用临时范围内的端口,这可能会与 ScaleIO 的 SDC 驱动程序发生冲突。
这可以通过以下方式实现:
- 设置程序可以从中分配本地端口
的临时端口范围和 - 保留临时端口范围内的端口,使其无法用作本地端口
分步指南
-
要检查当前的临时端口范围,请执行以下作:
# cat /proc/sys/net/ipv4/ip_local_port_range 32768 60999 -
要检查范围内的当前保留端口(空行表示没有保留端口),请执行以下作:
# cat /proc/sys/net/ipv4/ip_local_reserved_ports -
要动态调整临时端口范围(非持久),请执行以下作:
# echo 40000 60000 > /proc/sys/net/ipv4/ip_local_port_range # cat /proc/sys/net/ipv4/ip_local_port_range 40000 60000 -
要动态调整保留的端口(而不是持久端口),请执行以下作:
# echo "50000,50003" > /proc/sys/net/ipv4/ip_local_reserved_ports # cat /proc/sys/net/ipv4/ip_local_reserved_ports 50000,50003 -
要在重新启动后持久更改参数,请编辑 /etc/sysctl.conf,然后使用“sysctl -w”使之生效。
可以使用“sysctl -a |grep ip_local“,例如:# sysctl -a|grep ip_local net.ipv4.ip_local_port_range = 40000 60000 net.ipv4.ip_local_reserved_ports = 50000,50003 sysctl: reading key "net.ipv6.conf.all.stable_secret" sysctl: reading key "net.ipv6.conf.default.stable_secret" sysctl: reading key "net.ipv6.conf.eth0.stable_secret" sysctl: reading key "net.ipv6.conf.lo.stable_secret"
Additional Information
相关文章
https://access.redhat.com/solutions/26875RHEL 是否支持使用 /proc/sys/net/ipv4/ip_local_reserved_ports 可调从临时范围内保留本地端口?- 红帽客户门户
Affected Products
ScaleIO, PowerFlex Software, VxFlex Ready NodeArticle Properties
Article Number: 000154992
Article Type: How To
Last Modified: 06 Aug 2025
Version: 8
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.