我有两个桌面系统,一个使用 Windows 10,另一个使用 Debian 9。我所有的数据都存储在 Linux 系统上,该系统使用 Samba 在 Windows 下作为网络驱动器安装。
我想使用专用的千兆以太网卡在两台计算机之间建立直接以太网连接,以避免网络饱和。因此,我将两台计算机都配置为使用静态 IP 寻址:
在 /etc/网络/接口:
auto enp6s0
iface enp6s0 inet static
address 192.168.253.1
netmask 255.255.0.0
network 192.168.253.0
broadcast 192.168.253.255
Windows 适配器:
但是两台主机无法互相 ping 通。我在 Linux 计算机的日志中也发现了这些问题:
NetworkManager[466]: <info> [1544785487.5682] device (enp6s0): Activation: starting connection 'enp6s0' (0169b53d-570d-477c-b45a-5edd8f1e57a3)
NetworkManager[466]: <info> [1544785487.5685] device (enp6s0): state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager[466]: <info> [1544785487.5687] device (enp6s0): state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager[466]: <info> [1544785487.5688] device (enp6s0): state change: config -> ip-config (reason 'none') [50 70 0]
NetworkManager[466]: <warn> [1544785487.5688] device (enp6s0): interface enp6s0 not up for IP configuration
avahi-daemon[462]: Joining mDNS multicast group on interface enp6s0.IPv4 with address 192.168.253.1.
avahi-daemon[462]: New relevant interface enp6s0.IPv4 for mDNS.
avahi-daemon[462]: Registering new address record for 192.168.253.1 on enp6s0.IPv4.
kernel: [ 4090.228869] r8169 0000:06:00.0 enp6s0: link down
kernel: [ 4090.228917] r8169 0000:06:00.0 enp6s0: link down
kernel: [ 4090.228943] IPv6: ADDRCONF(NETDEV_UP): enp6s0: link is not ready
NetworkManager[466]: <info> [1544785487.7322] device (enp6s0): state change: ip-config -> ip-check (reason 'none') [70 80 0]
NetworkManager[466]: <info> [1544785487.7328] device (enp6s0): state change: ip-check -> secondaries (reason 'none') [80 90 0]
NetworkManager[466]: <info> [1544785487.7330] device (enp6s0): state change: secondaries -> activated (reason 'none') [90 100 0]
NetworkManager[466]: <info> [1544785487.7387] device (enp6s0): Activation: successful, device activated.
那么我的配置中可能缺少什么?
答案1
您可以确保已启用自动 MDI/MDI-X: https://www.reddit.com/r/linuxquestions/comments/2qivsa/how_to_determine_if_nic_is_auto_mdimdix_capable/cn6i19t 应该不需要再进行任何配置。您可以通过将两台计算机临时连接到交换机来确保这一点。
答案2
最后,其中一个网卡出现故障。更换网卡并设置正确的网络掩码即可解决问题。