There've been a lot of questions and threads about this but none of them solves my problem.
I want to assign a specific ip to a specific container WITHOUT configuring it inside the container. The goal is to BIND the container to a specific ip.
The containers CAN'T use the same bridge as interface due to ip/packet spoofing.
There are 2 public ip's pointing to my host server. The first one should stay to the host, the second to a specific container.
1. Try: Using the lxd bridge
If i use the lxd bridge, i can assign every container a fixed ip address from the lxd bridge network (meaning: the lxd bridge creates a private network with an ip range that is NOT public but can be accessed from the host server)
My host system has access to the private lxd network and the public network. Now i could route (on the host system) a public ip to a private ip and therefore a specific container but i haven't found a way to do this since the incoming traffic from the public ip needs to be forwarded to the private ip und the outgoing traffic from the private ip to the public ip.
2. Try: Creating a network interface for every ip and assign the specific interface to the container
Since this is much more complicated (and i'm a newbie in linux) i've tried following the instructions from https://lists.linuxcontainers.org/pipermail/lxc-users/2016-March/011271.html
But it didn't work out.
I would go with the first attempt cause it should work if i can route the ip's to each other but i don't know how.
Just saw this answer How can I restrict an LXD guest to using a single public IP address?
Seems like this could work. Can'T test it at the moment because my home router can't assign free ip adresses to devices..