linux中物理网络接口的识别

use*_*253 17 networking linux centos

我是 linux 新手,我的服务器有四个网卡。我必须确定将哪个物理网络接口分配给名称 eth0、eth1、eth2 和 eth3。我必须从 eth2 断开电缆,不知道它是哪个网卡。

谢谢

maa*_*yke 24

您可以使用 ethtool。

ethtool -p ethX [N]
Run Code Online (Sandbox Code Playgroud)
  • ethX – 网络接口名称
  • [N] – 闪烁的秒数

例子:

ethtool -p eth2 15
Run Code Online (Sandbox Code Playgroud)

这将使网络接口 eth2 闪烁 15 秒,然后您可以看到哪个物理网络接口用于 eth2