reach lxd container from local network

There's several different ways to accomplish what you want.

  1. Forward required ports from host to guest
  2. Route networks
  3. Bridge devices

Options 1 and 2 require ip-forwarding to be enabled on the host:

# run time:
sudo sysctl -w net.ipv4.ip_forward=1

# permanent:
echo 'net.ipv4.ip_forward = 1' | sudo tee /etc/sysctl.d/30-virt-network

Easiest is 1 if you want to access specific service like http (port 80) on guest (you access guest port 80 with host ip-address+port), but you cannot run host services on that same port.

# on lxd host: (-i HOSTDEVICE to lan, usually enp3s0 or eth0)
sudo iptables -t nat -A PREROUTING -i enp3s0 -p tcp -m tcp --dport 80 -j DNAT --to 10.0.3.181:80
# making this permanent is left to the reader (because that depends on your choice of fw setup)

Option 2 is more tricky and depends on how much you can modify your network.

Check that (sudo iptables -L -n) says that chain FORWARD (policy ACCEPT) or sudo iptables -I FORWARD -s 192.168.2.118 -j ACCEPT allow it specifically. Now either on the network firewall route 10.0.3.0/24 to your 192.168.1.112 host or test with route on the 192.168.2.118.

sudo ip route add 10.0.3.181 via 192.168.1.112 dev wlp3s0

Third option would bring your lxd guests to your lan as part of the lan. See Instruction converting eth0 (enp3s0 in your case) to bridge how to do it. In short:

  1. Create bridge device on host
  2. Add eth0 or enp3s0 to that bridge
  3. Set host address to bridge (not enp3s0)
  4. Bind lxd guest devices to that bridge

    stop network-manager
    brctl addbr br0
    brctl addif br0 enp3s0
    ifconfig enp3s0 up
    ifconfig br0 up
    dhclient br0
    lxc profile edit default
      - change lxcbr0 to br0