Assign external ip address to container

You have configured an instance to connect to the lxdbr0 bridge.
The lxdbr0 bridge has an IP of 10.74.168.1/24, which means that the instances connected to it should have IP addresses in the 10.74.168.0/24 subnet. Not the IP address you have manually assigned.

The reason it doesn’t work is because the host OS networking stack has no idea that your container has been manually given an IP address outside of the lxdbr0 network’s subnet, and your container has no idea how to reach the gateway 212.7.201.62 because it is in the private network lxdbr0.

What I think you want is to instead connect your instance to the external network (the network connected to enp2s0f0) rather than lxdbr0.

There are 3 ways to do this, with pros and cons of each:

  1. Setup a new manual bridge, e.g. br0, connect enp2s0f0 to it (so that the bridge is connected to the external network), and move enp2s0f0 IP config onto br0. Then you can connect your instance to the manual bridge using lxc config device add <instance> eth0 nic nictype=bridged parent=br0. See Netplan | Backend-agnostic network configuration in YAML
  2. Use macvlan NIC type on your instance connected to the external network via enp2s0f0 using lxc cofig device add <instance> eth0 nic nictype=macvlan parent=enp2s0f0. This avoids needing to setup the manual bridge, but has the downside that the instance and LXD host will not be able to communicate.
  3. Use routed NIC type on your instance connected to the external network via enp2s0f0 using lxc config device add <instance> eth0 nic nictype=routed parent=enp2s0f0 ipv4.address=212.7.201.17. This avoids needing to setup the manual bridge, and allows the host and instance to communicate, but doesn’t allow the instance to automatically configure its IP from the external network’s DHCP server or use broadcast traffic. See How to get LXD containers get IP from the LAN with routed network