MIgration with LXD/StaticIP/Bridge

(Sean Fulton) #1

I’m setting up containers with a static IP address. When complete, I have to create a route on the host like this:
/sbin/route add -host CONTAINER-IP dev lxdbr0
This works great, except when I reboot and I suspect, if I live migrate the container to another host.
Is there a way to add this HOST NODE route to the container config so that each time that container comes up, the host node will add this route as a static route?

(Stéphane Graber) #2

Not to the container’s config, but you can set ipv4.routes on the lxdbr0 bridge which would do the same.

(Sean Fulton) #3

I saw that function. So if I set that, the route will come up when the container comes up? And if I live migrate, will the route follow the container or do I need to set that up on the remote side?