I have a server with public IP and I have an lxd configuration setup on it.
I ran a container and added a lxd network to it. Now I want to attach Public IP that I have on the server to this container so I can access publicly the application running inside my lxd container. I also need an internal IP (coming from the already added lxd network) for another use case.
So 2 networks I think need to be attached on the same container. One adding public IP of the server to the container and the other simply for internal access within the server.
I’m not sure if that’s even possible at all. Any advice would be appreciated. Thanks!
You could probably just use the ipv4.routes.external config key on the container’s nic entry and set that to 22.214.171.124/32. This should then add a route entry on the host which will route the address to the instance’s network.
The instance can then grab an IP normally through DHCP but then can also add the static address to the same interface and will respond on both.
I have port 55000 forwarded from my container to the host.
Now if I run a service inside the container at 55000 port then I am unable to access it at PUBLIC_IP:55000
Is this configuration incorrect?
Also, do I need to forward ports to make a service accessible at a port or are they automatically available when I enable Public IP access to the container? All ports are currently open on my Public IP.