Bridge wired net not working

i running ubuntu 20.04 i create a br0 on my wired net without any error.
i lauch a ubuntu 20.04 on lxd and add this device to lxd as eth0 (using doc page https://openschoolsolutions.org/set-up-network-bridge-lxd/)
after restart lxd, wired internet is disconnected in ubuntu 20.04 host. i login to ubunt guest it’s not possible to connect to internet (they do not take ip. i try to gave statics ip to that netplan try and netplan apply gave no problem, but stil not connected to internet). i stop ubuntu from lxd then
internet from ubuntu host back and working. this is my 01-netcfg.yaml:

 network:
    ethernets:
        enx803f5d14119d:
            dhcp4: no
    version: 2
    bridges:
        br0:
            dhcp4: no
            addresses:
            - 10.74.0.66/24
            gateway4: 10.74.0.12
            nameservers:
                addresses:
                - 10.74.0.12
            interfaces:
            - enx803f5d14119d

Please help!

Please show output of ip a and ip r both on LXD host and inside a container.

this is for host:
ip a:
enx803f5d14119d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 80:3f:5d:14:11:9d brd ff:ff:ff:ff:ff:ff
br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 80:3f:5d:14:11:9d brd ff:ff:ff:ff:ff:ff
inet 10.74.0.66/24 brd 10.74.0.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::823f:5dff:fe14:119d/64 scope link
valid_lft forever preferred_lft forever

ip r :
10.74.0.0/24 dev br0 proto kernel scope link src 10.74.0.66
10.74.0.0/24 dev enx803f5d14119d proto kernel scope link src 10.74.0.66 metric 100

and for lxd:
ip a :
eth0@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:69:87:77 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::216:3eff:fe69:8777/64 scope link
valid_lft forever preferred_lft forever
and ip r show nothing
then i try to gave static ip to lxd
then ip a show the same and ip r show
10.74.0.68/24 dev eth0 proto kernel scope link src 10.74.0.66

You’ll need to get rid of this route, as it should only be on the br0 interface.

10.74.0.0/24 dev enx803f5d14119d proto kernel scope link src 10.74.0.66 metric 100

You are also missing a default gateway route for br0.

What does sudo netplan apply do?

I don’t understand. would you please explain. i don’t missing gateway on 01-netcfg.yaml it’s 10.74.0.12
netplan apply gave the ip number to lxd?

Well for the moment this is nothing to do with LXD.

Your netplan config is not applying as your host is missing a default gateway route and has duplicated routes for your subnet 10.74.0.0/24.

That needs to be resolved first before looking at LXD.

Yes. you are right. i found out what the problem is. laptop has no wired net. It is docking station and
it’s going wrong when i create a bridge of docing internet interface.
is it possible to create a bridge of wireless. it should be the same, isn’t it?

I think bridging to a wifi interface is a problem (unless the interface is working as an AP) as the WIFI client interface’s MAC is used for authentication, and so it can’t expose multiple MACs from behind the bridge.

You could look at using the routed NIC type instead.

https://linuxcontainers.org/lxd/docs/master/instances#nic-routed