使用如下命令创建bridge设备br1, 给br1和vnet10(virt-manager自动创建,桥接)分配了ip地址
# ip link add name br1 type bridge
# ip link set dev br1 up
此处应当`ip link set master`, 但似乎virt-manager每次启动虚拟机的时候都会自动创建执行.
# ip address add dev br1 192.168.66.66/24
# bridge link
17: vnet10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br1 state forwarding priority 32 cost 100
# ip addr
13: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b6:c3:08:27:b8:23 brd ff:ff:ff:ff:ff:ff
inet 192.168.66.66/24 scope global br1
valid_lft forever preferred_lft forever
inet6 fe80::b4c3:8ff:fe27:b823/64 scope link
valid_lft forever preferred_lft forever
17: vnet10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default qlen 1000
link/ether fe:54:00:50:f0:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.66.67/24 scope global vnet10
valid_lft forever preferred_lft forever
inet6 fe80::fc54:ff:fe50:f0ac/64 scope link
valid_lft forever preferred_lft forever
guest
# ip addr
enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether ...
inet6 ... scope link noprefixroute
valid_lft forever preferred_lft forever
guest 上本来是没有ip的, 执行了# ip address add dev vnet10 192.168.66.67/24
之后有了一个ipv6的地址, 但是还是连不上网.
是按照这个(https://wiki.archlinux.org/title/Network_bridge)操作的, 但我是用opensuse-tumbleweed.