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 驅動程式發生衝突。

這可以通過以下方式實現:

  • 設定臨時埠範圍,程式可以從中分配本地埠
  • 保留臨時埠範圍內的埠,使其不能用作本地埠

 

逐步指南

  1. 若要檢查目前的暫時連接埠範圍:

    # cat /proc/sys/net/ipv4/ip_local_port_range
    32768	60999
  2. 要檢查範圍內目前的保留埠(空行表示沒有保留埠):

    # cat /proc/sys/net/ipv4/ip_local_reserved_ports
     
  3. 若要動態調整暫時連接埠範圍 (非持續性):

    # echo 40000 60000 > /proc/sys/net/ipv4/ip_local_port_range
    # cat /proc/sys/net/ipv4/ip_local_port_range
    40000	60000
  4. 要動態調整保留埠(不持久),請執行以下操作:

    # echo "50000,50003" > /proc/sys/net/ipv4/ip_local_reserved_ports
    # cat /proc/sys/net/ipv4/ip_local_reserved_ports
    50000,50003
  5. 若要在重新開機後持續變更參數,請編輯 /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

Affected Products

ScaleIO, PowerFlex Software, VxFlex Ready Node
Article 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.