LXD and dhcp server in a machine simultaneously

You cannot specify an arbitrary default route address in your cloud-init config.

This is because routed NICs use point-to-point links back to the LXD host, and are not bridged at layer 2 (as the name suggests we are using layer 3 routing only).

As such there is only one default route you can use, the private address 169.254.0.1 (which LXD should setup up for you on the host end of the point-to-point link between host and container).

See the example of cloud-init config here Lxd "routed" interface config - problem w Ubuntu 20.04 Host and WiFi?

config:
  user.network-config: |
    version: 2
    ethernets:
        eth0:
            addresses:
            - 192.168.1.201/32
            nameservers:
                addresses:
                - 8.8.8.8
            routes:
            -   to: 0.0.0.0/0
                via: 169.254.0.1
                on-link: true
devices:
  eth0:
    ipv4.address: 192.168.1.201
    nictype: routed
    parent: enp3s0
    type: nic

At that point the packets will go from container to host and then use the routing table on your LXD host to decide the next ‘hop’ to make.