正如这里所述如何在 Ubuntu 22.04 上逐步安装 KVM我已经完成了一系列命令:
$ sudo vi /etc/netplan/01-netcfg.yaml
network:
ethernets:
enp0s3:
dhcp4: false
dhcp6: false
# add configuration for bridge interface
bridges:
br0:
interfaces: [enp0s3]
dhcp4: false
addresses: [192.168.1.162/24]
macaddress: 08:00:27:4b:1d:45
routes:
- to: default
via: 192.168.1.1
metric: 100
nameservers:
addresses: [4.2.2.2]
parameters:
stp: false
dhcp6: false
version: 2
sudo netplan apply
$ 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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether e4:54:e8:62:02:3e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.112/24 brd 192.168.1.255 scope global dynamic noprefixroute enp2s0
valid_lft 5283sec preferred_lft 5283sec
inet6 fe80::9431:8b2a:4a7b:29c8/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:68:0e:ff brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
15: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 08:00:27:4b:1d:45 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.162/24 brd 192.168.1.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe4b:1d45/64 scope link
valid_lft forever preferred_lft forever
17: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:b8:09:6a brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:feb8:96a/64 scope link
valid_lft forever preferred_lft forever
然后,我在 Virt Manager 界面上设置了虚拟网络接口设置。
我以为这些步骤都没问题,但我仍然没有互联网连接。
设置有什么问题?谢谢你的帮助。