【求助】请问怎么给bridge模式KVM的guest分配ip地址?

使用如下命令创建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.

搞定了, 需要将物理网卡, 我的情况是eno1, 桥接到bridge br0, 而不是反过来

ip link set eno1 master br0

删除eno1的ip, 给br0分配ip.

ip addr del *address* dev eno1
ip address add dev br0 *address*

加一个路由

ip route add default via *gateway* dev br0

然后将虚拟机的网卡桥接到br0, 我使用virt-manager自动绑定, 路由器dhcp自动分配的话直接就有ip了.

搞错了bridge的模型, bridge br0负责通信, host guest同级.