Wrong IP address of logged in user inside LXC

Hello,
after creating and configuring LXC I got internal IP address like 10.109.xx.xx as logged in user (not his IP address). Outside of the container the logged in user IP is correct. Why?

Hi!

I am guessing that you have created a container, let’s say c1.
Then, you have configured somehow to forward from port, let’s say, 2222 on the host to port 22 at the container c1. Is that the case? If not, please describe in more details.

I don’t know whether it is the case or not but in the container I have installed virtualmin/usermin/webmin which has it’s own PERL web server.

I see. It’s somewhat similar.

But you need to tell me how you access those virtualmin/usermin/webmin from the Internet.
By default, you cannot access a website in a container from the Internet. How do you do it?

I did routing through iptables

Anyone can help more?

routing through iptables is not enough.

Is it

  1. MASQUARADE?
    2 NAT with PREROUTING?

Since you have the problem, then it’s probably 1. Use 2 instead.