[lxc-users] lxc proxy nat? is there a "reverse proxy nat"?

Tomasz Chmielewski mangoo at wpkg.org
Fri Jan 24 14:40:29 UTC 2020


Let's say I have a LXD server with two public IPs, 1.1.1.1 and 2.2.2.2. 
The default IP for outgoing routing is 1.1.1.1.

There, I setup two containers with private IP addresses: 10.1.1.1 and 
10.2.2.2.

They receive the following proxy nat config:

- LXD server passes TCP traffic 1.1.1.1:25 to container 10.1.1.1:25:

   proxy-smtp:
     connect: tcp:10.1.1.1:25
     listen: tcp:1.1.1.1:25
     nat: "true"
     type: proxy

- LXD server passes TCP traffic 2.2.2.2:25 to container 10.2.2.2:25:

   proxy-smtp:
     connect: tcp:10.2.2.2:25
     listen: tcp:2.2.2.2:25
     nat: "true"
     type: proxy


Now, it works great. However, mail sent from container 10.2.2.2 will use 
LXD server's 1.1.1.1 as the outgoing IP. I'd like it to use 2.2.2.2, and 
still have the private IP assigned (I don't want to assign the public IP 
to this container).

How can I do it?


Tomasz


More information about the lxc-users mailing list