以太网电缆链路协商

以太网电缆链路协商

我刚买了一台带有 4 个 eth 端口的 SoC 计算机,我打算将它转换成带 Linux 的路由器。我将一根 CAT5 电缆连接到其中一个 eth 和我的笔记本电脑,但我没有看到任何一侧的连接。我的记忆有误(我指的是大脑),似乎记得 NB 擅长协商传输包括是使用直通电缆还是交叉电缆。这接近现实吗?我可以力量NB 的 eth 端口是否可以用作交叉线?还是应该购买交叉线?

答案1

大概任何过去十年制造的设备应该支持 Auto MDI-X。如果没有连接,我首先会怀疑电缆的问题(也许可以尝试连接到交换机,看看那里是否有连接)。

无论如何,你可以用 强制 MDI-X ethtool。从手册页

      mdix auto|on|off
              Selects MDI-X mode for port. May be used to override the
              automatic detection feature of most adapters. An argument
              of auto means automatic detection of MDI status, on forces
              MDI-X (crossover) mode, while off means MDI (straight
              through) mode.  The driver should guarantee that this
              command takes effect immediately, and if necessary may
              reset the link to cause the change to take effect.

答案2

我刚刚发现这个问题,所以自己回答:这只是一个运行的问题ip link <dev> up。如果忘记了这一点,我会觉得自己很愚蠢,但我真的不知道有人能控制这个级别,而且如果你没有配置接口,它就不会尝试建立链接。

相关内容