我在 2014 年的 Macbook Pro 上安装了 Ubuntu 20.04 Server,使用 USB 转以太网适配器一切运行良好。但是,当我尝试使用 Thunderbolt 2 转以太网适配器时,我无法使网络连接正常工作。运行ip a
显示(我认为是)Thunderbolt 接口 (ens9) 为 DOWN,因此我运行了sudo ip link ens9 up
。然后 Macbook 显示为路由器中的设备,但我仍然无法访问它(在其上运行着一个 Web 服务器,可以与 USB 适配器配合使用)。运行ping google.com
显示:ping: google.com: Temporary failure in name resolution
。
我没有安装任何驱动程序,只是简单地插入 Thunderbolt 适配器并启动。非常乐意提供一些帮助来排除故障。提前致谢!
编辑:跑步cat /etc/netplan/*.yaml
可获得:
# This is the network config written in 'subiquity'
network:
ethernets:
enx00f76f6f62ca:
dhcp4: true
version: 2
运行结果sudo lshw -C network
为:
*-network
description: Network controller
product: BCM4360 802.11ac Wireless Network Adapter
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:03:00.0
version: 03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=bcma-pci-bridge latency=0
resources: irq:18 memory:b0600000-b0607fff memory:b0400000-b05fffff
*-network DISABLED
description: Ethernet interface
product: NetXtreme BCM57762 Gigabit Ethernet PCIe
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:0a:00.0
logical name: ens9
version: 00
serial: 18:7e:b9:0a:c7:d6
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.137 firmware=57762-a1.10 latency=0 link=no multicast=yes port=twisted pair
resources: irq:19 memory:bcc00000-bcc0ffff memory:bcc10000-bcc1ffff memory:b0c00000-b0c0ffff
答案1
如果sudo lshw -C network
正确显示Thunderbolt 2 转以太网适配器为 ens9,那么您的 /etc/netplan/*.yaml 应该看起来像这样......
network:
version: 2
renderer: networkd
ethernets:
ens9:
dhcp4: true
optional: true
sudo netplan generate
sudo netplan apply
reboot