我无法从 macOS 主机上的 ubuntu VM ware 访问任何 Web 服务器。
主机:MacOS --> 互联网连接良好 访客:Ubuntu --> 互联网连接不良
Ubuntu 版本
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
配置文件
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.010.11 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:09:48:52:9b txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 50178 bytes 63227601 (63.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 50178 bytes 63227601 (63.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
网络管理器状态
sudo systemctl status network-manager.service
● NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-11-19 11:53:22 CET; 10s ago
Docs: man:NetworkManager(8)
Main PID: 8622 (NetworkManager)
Tasks: 4 (limit: 14267)
Memory: 2.9M
CGroup: /system.slice/NetworkManager.service
└─8622 /usr/sbin/NetworkManager --no-daemon
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1865] ifupdown: interface-parser: parsing file /etc/network/interfaces
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1865] ifupdown: interface-parser: finished parsing file /etc/network/interfaces
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1880] device (lo): carrier: link connected
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1881] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1888] manager: (docker0): new Bridge device (/org/freedesktop/NetworkManager/Devices/2)
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1895] manager: (ens33): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3)
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <warn> [1637319202.1900] Error: failed to open /run/network/ifstate
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.1944] manager: startup complete
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.2162] agent-manager: agent[de5a91ed7bc2b4be,:1.39/org.gnome.Shell.NetworkAgent/1000]: agent registered
Nov 19 11:53:22 ubuntu NetworkManager[8622]: <info> [1637319202.2202] modem-manager: ModemManager available
NS 查找
nslookup google.com
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find google.com: SERVFAIL
有人可以指导我解决并修复这个问题吗?
接口
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
# auto eth1
# iface eth1 inet dhcp
网络计划
$ cat /etc/netplan/*.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
瘦身
sudo lshw -C network
[sudo] password for -----:
*-network
description: Ethernet interface
product: 82545EM Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 1
bus info: pci@0000:02:01.0
logical name: ens33
version: 01
serial: 00:0c:29:a1:3f:99
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=5.11.0-38-generic duplex=full latency=0 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) memory:fd500000-fd50ffff