Lxc add route at startup

(cumafo) #1

How would it be possible to add a static route (at startup) from the host without touching the guest configs (like /etc/network/...) ?
Played with lxc.network.script.up but it seems that the running-context is host, not guest.

(St├ęphane Graber) #2

lxc.hook.start or lxc.hook.mount should both be good candidates for that.
The former would run the command from inside the container, the latter from the host, both should have the container's network namespace already setup.