How to access LXC webserver in same LAN?

I have LXC running webserver on host which uses wifi.
From that host, i can access that webserver (typing: bring me apache page of LXC apache installed).
But, I want to be able to access from my other PC, to this laptop home IP (
I tried port forwarding, even different ports (, (so when in laptop host get response from port 1822, to forward it in on it’s port 80.
but’s not working.
I have only wlp2s0 interface (wifi) on this laptop.
Tried checking docs, but i’m confused, what in my case i should type and use ?

my LXC is connected to internet via lxdbr0 which was created by: lxd init.

find out your containers local ip

lxc ls <your container>$ -c 4

use the firewall of your choice firewalld (recommended), ufw or simply iptables to forward the incoming requests to your local ip

firewall-cmd --add-forward-port=port=port-number:proto=tcp|udp:toport=port-number:toaddr=IP

if the settings work and you want to make them permanent then:

firewall-cmd --runtime-to-permanent
1 Like