post-up|down clauses in /etc/network/interfaces on Debian-based distributions can be either defined right after an interface definition, or "dangling". See a very simple example:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  post-up <command1>

post-up <command2>

It's pretty clear to me that command1 will be executed once eth0 is up. However, when is command2 executed? Is it when all interfaces are up? Or is it when any interface is up?


command2 is not "dangling", it is a post-up option for eth0, so it will be executed right after command1. From man interfaces:

Options are usually indented for clarity (as in the example above) but are not required to be.

Also, empty lines are ignored in /etc/network/interfaces (and in all included files).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.