我正在尝试在两台 Linux 主机之间建立点对点连接。我已经用交叉电缆连接了它们,但它们无法相互 ping 通。以下是每台笔记本电脑的配置:
笔记本电脑 1
(eth0 configuration)
IP Address - 128.110.1.6
Subnet Mask - 255.255.255.240
Gateway - 128.110.1.1
笔记本电脑 2
(eth0 configuration)
IP address - 128.110.1.1
Subnet Mask - 255.255.255.240
Gateway - 128.110.1.6
我是不是遗漏了什么?如何在两台笔记本电脑之间建立连接?
編輯-1:我运行了该'arp -a'
命令并收到以下输出:
笔记本电脑 1
? (128.110.1.1) at <incomplete> on eth0
笔记本电脑 2
? (128.110.1.6) at <incomplete> on eth0
我猜测 ARP 表中的这些条目可能是由于 ping 失败造成的。
編輯-2:我发现其中一台笔记本电脑启用了桥接功能,该桥接功能之前与 USB 转以太网适配器接口一起使用,并且eth1
内置以太网接口为eth0
。但不确定这是否会影响任何事情。按照建议运行会ethtool
产生以下输出:
笔记本电脑 1
[root@link_3 doctor]# /sbin/ethtool eth0
Settings for eth0:
Link detected: yes
[root@link_3 doctor]# /sbin/ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Link detected: no
笔记本电脑 2
[root@hitl3 doctor]# /sbin/ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes
答案1
确保至少有一个以太网端口是 GigE。否则您可能需要交叉电缆。