2015年5月6日 星期三

IP Local Port Range (Ephemeral port)

Windows 部份
  • Windows 2008 之前 1025 ~ 5000
  • Windows 2008 之後(含) 49152 ~ 65535 (IANA)
Verify :
  • netsh int ipv4 show dynamicport tcp
  • netsh int ipv4 show dynamicport udp
  • netsh int ipv6 show dynamicport tcp
  • netsh int ipv6 show dynamicport udp
Configuration :
  • netsh int ipv4 set dynamicport tcp start=10000 num=1000
  • netsh int ipv4 set dynamicport udp start=10000 num=1000
  • netsh int ipv6 set dynamicport tcp start=10000 num=1000
  • netsh int ipv6 set dynamicport udp start=10000 num=1000
特殊狀況 :
  • Exchange Server 2007 會自動修改為 1025 ~ 60000
Linux 部份
  • 32768 ~ 61000
Verify :
  • sysctl net/ipv4/ip_local_port_range
Configuration :
  • sysctl -w net.ipv4.ip_local_port_range="1024 64000"
  • edit /etc/sysctl.conf with "net.ipv4.ip_local_port_range = 1024 64000"
OpenBSD
  • 1024 ~ 49151
  • 49152 ~ 65535
Verify :
  • sysctl net.inet.ip.portfirst net.inet.ip.portlast net.inet.ip.porthifirst net.inet.ip.porthilast
Configuration :
  • sysctl net.inet.ip.portfirst=32768 net.inet.ip.portlast=49151 net.inet.ip.porthifirst=49152 net.inet.ip.porthilast=65535
  • edit /etc/sysctl.conf with "net.inet.ip.portfirst=32768 net.inet.ip.portlast=49151 net.inet.ip.porthifirst=49152 net.inet.ip.porthilast=65535"
Solaris
  • 32768 ~ 65535
Verify :
  • /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
Configuration :
  • ndd -set /dev/tcp tcp_smallest_anon_port=9000 
  • ndd -set /dev/tcp tcp_largest_anon_port=65500 
  • ndd -set /dev/udp udp_smallest_anon_port=9000 
  • ndd -set /dev/udp udp_largest_anon_port=65500   
MAC OS X
  • 49152 ~ 65535
Verify :
  • sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last
Configuration :
  • sysctl -w net.inet.ip.portrange.first=32768
  • sysctl -w net.inet.ip.portrange.last=65535

Android , BlackBerry , FreeBSD ... , Selection Strategy 沒有談到.

參考 :
http://en.wikipedia.org/wiki/Ephemeral_port
http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
https://gist.github.com/mbbx6spp/3154170

沒有留言:

張貼留言