指定熔断器的 IPv6 地址
使用 CentoS 5.5。
我有一个 Apache 2.x 服务器在端口 9999 上运行,我正在尝试使用 fusion 找到它。
我可以使用netstat找到它,即:
netstat -an | grep 9999
输出:
tcp 0 0 :::9999 :::* LISTEN
问题 1:为什么 netstat 使用 IPv6 语法显示端口?
问题2:我可以使用什么fuser命令来查找服务器的pid?以下均不起作用:
fusionr -n tcp :::9999
fusionr -n tcp 9999
fusionr -4 -n tcp 9999
fusionr -6 -n tcp 9999
fusionr -6 -n tcp :::9999
谢谢!
Using CentoS 5.5.
I have an Apache 2.x server running on port 9999 and I am trying to find it using fuser.
I can find it using netstat, i.e.:
netstat -an | grep 9999
outputs:
tcp 0 0 :::9999 :::* LISTEN
Question 1: Why is netstat displaying the port using IPv6 syntax?
Question 2: What fuser command can I use to find the pid of the server? None of the following work:
fuser -n tcp :::9999
fuser -n tcp 9999
fuser -4 -n tcp 9999
fuser -6 -n tcp 9999
fuser -6 -n tcp :::9999
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么它要监听 IPv6?嗯,默认情况下,在 Linux 上,绑定到
[::]
不仅会绑定到 IPv6,还会绑定到 IPv4 兼容地址。 IPv6 中的::ffff:0.0.0.0/96
空间用于 IPv4 兼容连接。软件这样做的优点是它只需要绑定到一个套接字。它使编码稍微简单一些。
并非所有发行版或操作系统都这样做。例如,Windows 要求您显式绑定到
[::]
或0.0.0.0
才能支持 IPv6 或 IPv4。在 Linux 上,如果net.ipv6.bindv6only
sysctl 设置为1
(就像在 Debian 上一样,但不是大多数其他发行版,包括 CentOS 或 Ubuntu),那么您需要显式绑定到[::]
和0.0.0.0
以支持两者。至于如何在
fuser
中查找,可以这样做:或者显示端口绑定了哪些进程:
Why is it listening on IPv6? Well, by default on Linux, binding to
[::]
will not only bind to IPv6, but will also bind to an IPv4–compatible address. The::ffff:0.0.0.0/96
space in IPv6 is used for IPv4–compatible connections.The advantage of the software doing this is that it only needs to bind to the one socket. It makes the coding slightly simpler.
Not all distros or operating systems do this. For example, Windows requires you to bind to both
[::]
or0.0.0.0
explicitly in order to support IPv6 or IPv4. And on Linux, if thenet.ipv6.bindv6only
sysctl is set to1
(like it is on Debian, but not most other distros, including CentOS or Ubuntu), then you will need to explicitly bind to[::]
and0.0.0.0
to support both.As for how to look it up in
fuser
, do it like this:Or to show what process is bound to the port:
解决方法之一是禁用 ipv6:
添加到 /etc/modprobe.conf:alias
net-pf-10 off
我不认为 fusioner 喜欢 ipv6。
One was fix was to disable ipv6:
Added to /etc/modprobe.conf:
alias net-pf-10 off
I don't think fuser likes ipv6.