Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In order to setup a load-balanced permanent routes in debian, according to this article, i have to run the following command

ip route add default scope global \
    nexthop via dev eth0 weight 1 \
    nexthop via dev eth1 weight 1 \
    nexthop via dev eth2 weight 1 \
    nexthop via dev eth3 weight 1 \
    nexthop via dev eth4 weight 1 \
    nexthop via dev eth5 weight 1

after all interfaces were up. I think the best place to put that command is if-up.d folder, but scripts there are running onec for each interface, and i can't get how to run this command only once after last interface was up.

share|improve this question
up vote 0 down vote accepted

You can run it once after all interfaces are setup with:

post-up ip route add.... as the last line of /etc/network/interfaces file.

share|improve this answer
according to man interfaces it wouldn't mean "after all", it will be just "post-up" of last interface in a file, but what if for some reason interfaces will be initialized in different order? – Mike Jul 19 '12 at 14:19
true but if you put the line as last line of the file (or after defining all the interfaces), I understand this as meaning after the last interface of all the above that come up and not only the last defined. This is my understanding but tbh I never thought it could be different so I never considered the subject. Anyways I never had problem using it this way (loading iptables rules for example). – laurent Jul 19 '12 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .