0

This is my first question here so sorry for any mistakes I make. I've not found any solution for my question yet here in serverfault.

I setup two LXC Containers: one ("A") with Dovecot and Postfix, the other one ("B") with nginx and Roundcube. Both are connected using veth to the host's main NIC which has 1 public IPv4 adress.

I can ping the host's domain from both containers, but if I do curl [host's domain or ip adress] it will fail with connection refused. (I think it connects to the host, where there isn't anything running on port 80)

From any external computer I'm forwarded to B, because I setup the following iptables rule: -A PREROUTING -i ens3 -p tcp --dport 80 -j DNAT --to 10.0.3.xxx:80

I want to access the mailserver container from the roundcube's one through the host domain because of the SSL certificate.

nee6AGag
  • 11
  • 4

1 Answers1

0

I found the anwser myself:

You need to add the rule also for the local-only interface -A PREROUTING -i lxcbr0 -p tcp --dport 80 -j DNAT --to 10.0.3.xxx:80

nee6AGag
  • 11
  • 4