如何在Linux上查看和编辑临时端口范围? [英] How to view and edit the ephemeral port range on Linux?

查看:502
本文介绍了如何在Linux上查看和编辑临时端口范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Linux系统中,临时端口范围显示如下不同范围

In my Linux system ephemeral port range is showing different ranges as follows

$ cat /proc/sys/net/ipv4/ip_local_port_range 
32768  61000 

cat /etc/sysctl.conf | grep net.ipv4.ip_local_port_range
net.ipv4.ip_local_port_range = 9000 65500

在我的系统中哪个是短暂的有效端口范围?

Which will be the effective ephemeral port range in my system?

推荐答案

以下命令将列出Linux系统中的临时端口范围

Following command will list the ephemeral port range in Linux system

sysctl -A | grep ip_local_port_range 

如果我们不想重新启动,则在编辑/etc/sysctl.conf文件后,如果执行以下命令,它将生效.

If we don't want to reboot, after editing /etc/sysctl.conf file if we execute following command it will be effective.

sysctrl -p /etc/sysctl.conf .

有效范围问题的真相是

sysctl net.ipv4.ip_local_port_range 

如eckes在评论中所述.

as mentioned by eckes in comment.

这篇关于如何在Linux上查看和编辑临时端口范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆