Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
359 views
in Technique[技术] by (71.8m points)

linux - 如何测试短暂端口的耗尽(How to test ephemeral ports exhaustion)

is there any way (tool) in Linux that can be used to reserve all ephemeral ports?

(Linux中有什么方法(工具)可用于保留所有临时端口?)

the reason for this is that I am testing remediation when all outbound ports are in use.

(原因是当所有出站端口都在使用时,我正在测试补救措施。)

I've tested apache "ab" but it does not seem there is a way to allocate all outbound ports on the system.

(我已经测试过apache“ ab”,但似乎没有办法在系统上分配所有出站端口。)

I am viewing the available ports using the below:

(我正在使用以下方法查看可用的端口:)

first_port=$(cut --fields 1 /proc/sys/net/ipv4/ip_local_port_range)
last_port=$(cut --fields 2 /proc/sys/net/ipv4/ip_local_port_range)
ss --numeric --tcp state connected "( sport >= :$first_port and sport <= :$last_port )"
  ask by mohatb translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...