LXD Default lxdbr0 bridge + Publicly Accessible IPs?


#1

Not sure exactly what I need to do to as the final step in getting my container public IPs accessible from outside of my server.

Using Xenial for host and container. lxd init was setup with the default lxdbr0 bridge with default/auto setting for private IPv4 & IPv6. I have 5 usable IPs; my host OS is configured with one and the 4 other IPs are available but not configured on the host.

I followed this suggestion from Using static IPs with LXD , using the second option.

To pass public IPs from the host to the container, you can either have them added to your host and NAT to your container’s IP, or (usually cleaner), route the IPs or subnets to your bridge, using the ipv4.routes option on the bridge and then adding it to the container with something like ip -4 addr add ADDRESS/32 dev eth0 (or the distribution network equivalent of that).

Specifically, I followed this example: Public IP in the CT along with the messages posted above and below it.

The result is that I am able to ping/ssh into a container with the public IP but only from the host OS. Remotely, I cannot connect to that container via the public IP at all.

Is there anything else I need to do aside from what was described in the other posts that I linked to?

I’m missing some piece of the puzzle, just not sure what it is. Been reading through these forums as well as other resources found via Google for a few days & testing various configs along the way.

Any help with this would be much appreciated.


#2

If you search for the thread titled:

Another ‘networking issue’ or ‘how to connect containers to more than one network using a bridge or macvlan’

I think the solution given there (not my solution but given by others to me) might just give you want you want. If not - - - sorry for leading you down the wrong path.