我创建了一个网桥(用于 libvirt),如下所示:
nmcli con add ifname br0 type bridge con-name br0
nmcli con add type bridge-slave ifname enp3s0 master br0
nmcli con mod br0 ipv4.addresses ***
nmcli con mod br0 ipv4.gateway ***
nmcli con mod br0 ipv4.dns '***'
nmcli con mod br0 ipv4.method manual
nmcli con modify br0 bridge.stp no
nmcli con up bridge-slave-enp3s0
正常重启后系统如下:
$ nmcli conn show
NAME UUID TYPE DEVICE
br0 0e94307b-e86f-4987-ab11-178bdd9f80d9 bridge br0
lo b2bac3d3-d51f-4f6c-b1aa-98ae95a8e298 loopback lo
bridge-slave-enp3s0 85f6225c-bd8d-4cfc-a1dc-d196ea0870d5 ethernet enp3s0
将系统从睡眠状态唤醒后,如下所示:
$ nmcli conn show
NAME UUID TYPE DEVICE
br0 0e94307b-e86f-4987-ab11-178bdd9f80d9 bridge br0
lo b2bac3d3-d51f-4f6c-b1aa-98ae95a8e298 loopback lo
enp3s0 fd23344b-3bde-4ab4-9a8a-f0dc555f589b ethernet enp3s0
bridge-slave-enp3s0 85f6225c-bd8d-4cfc-a1dc-d196ea0870d5 ethernet --
系统再次将同一设备添加到网桥。断开连接(从命令行或界面)将删除新添加的连接并使用原始配置自动连接,然后再次出现:
$ nmcli conn show
NAME UUID TYPE DEVICE
br0 0e94307b-e86f-4987-ab11-178bdd9f80d9 bridge br0
lo b2bac3d3-d51f-4f6c-b1aa-98ae95a8e298 loopback lo
bridge-slave-enp3s0 85f6225c-bd8d-4cfc-a1dc-d196ea0870d5 ethernet enp3s0
两种情况下连接都正常工作,但有些奇怪......
操作系统:Kubuntu 23.10