在我的 Ubuntu 20.04 系统上,网络(以太网)工作正常,直到我将 ASRock B550M Pro4 主板的 BIOS 更新到最新版本。现在,每当我启动 Ubuntu 时,都无法再访问网络。
$ ping 8.8.8.8
ping: connect: Network is unreachable
看来我的以太网接口已被禁用。
$ sudo lshw -C network
*-network DISABLED
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
不ifconfig
ifconfig
由于没有互联网访问,无法安装
不NetworkManager.state
尝试了下面几个命令,但是它们不起作用:
$ cat /var/lib/NetworkManager/NetworkManager.state
cat: /var/lib/NetworkManager/NetworkManager.state: No such file or directory
$ cat /var/lib/NetworkManager
cat: /var/lib/NetworkManager: No such file or directory
运行后无输出:
$ cat /etc/network/interfaces
重新启动网络服务没有帮助
$ sudo systemctl restart systemd-networkd
找到 3 个网络接口
ip a
显示 3 个接口
lo
enp4so
docker0
输出ip r
$ ip r
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
输出ip a
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp4so: <BROADCAST,MULTICAST> mtu 15500 qdisc noop state DOWN group default qlen 1000
link/ether a8:a1:59:64:4b:5b brd ff:ff:ff:ff:ff:ff
3: docker0: <NOCARRIER,BROADAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
BIOS 中已启用以太网
在BIOS设置中,Onboard LAN
是Enabled
。
实时会话中的互联网访问
能够 ping google.com 和 ping 8.8.8.8
dkms
和netplan
dksm
未安装,且没有网络访问则无法安装。
$ cat /etc/netplan/*.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp7so:
dhcp4: true
version: 2
关于如何恢复网络访问有什么建议吗?谢谢!
答案1
编辑您的 /etc/netplan/*.yaml...
改变这个...
# This is the network config written by 'subiquity'
network:
ethernets:
enp7so:
dhcp4: true
version: 2
对此...
# This is the network config written by 'subiquity'
network:
version: 2
renderer: networkd
ethernets:
enp4so:
dhcp4: true
optional: true
sudo netplan generate
sudo netplan apply
reboot