Reaching YNH in container LXC

I’m trying to run YNH in LXC container.
Installation is ok, but i have issue with the bridge lxcbr0 to reach YNH instance.

So, i have 2 choices:

  • either i’m pushing lxcbr0 on my lan, but i have trouble configuring /etc/default/lxc-net
  • either i’m forwarding http content via apache2 on the host

Can you tell me what works best, and eventually how to do this ? :stuck_out_tongue:
Thank you !

Hi,

Depending of what you want to do exactly, they can have some others port to forward in order to use every features of YunoHost. (25, 587, 993 for mails - 80, 443 for web - 5222, 5269 for xmpp, …)

So, I suggest you to configure your host as a DNAT thanks iptables to redirect every/some ports on your LXC container. I don’t know iptables very well but I think that you need this type of commands : iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination <ip-of-container>

You can find more details about DNAT on documentation like 5.5. Destination NAT with netfilter (DNAT)

Hi, thank you for your answer ! This is effectively another possibility.

But i don’t think i could not use the non-lxc web service if i’m doing this. Apache or Nginx on the host would allows me a vhost-based switch (relying on fqdn) where NAT would forward everything.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.