# controlling order of start-up of network interfaces [SOLVED]

## equaeghe

I have 3 network interfaces, 2 wire (eth0, an skge card; eth1, a via-rhine card), 1 wireless (ra0, a rt2500 card). All configured in /etc/conf.d/net.

Since the recent udev update making coldplug redundant, the startup procedure insists on starting up the wireless card first (something with "device initiated settings"). The wireless connection often fails (which is in itself no problem), but as it starts up first, gentoo thinks it has a net connection and tries to start ntp-client before starting the dependable wired network connections.

How do I solve this problem? I myself was thinking about finding a way to force a startup order of eth0, eth1, ra0, and ideally, ntp-client at the end.

Thanks for any suggestions,

ErikLast edited by equaeghe on Tue Feb 20, 2007 10:19 pm; edited 1 time in total

----------

## Aszrael

I have no idea how to change order, but this could be a (dirty) workaround:

given that wired interfaces = eth0 & eth1 and wireless = eth2

remove eth2 from auto-startup in /etc/conf.d/rc

RC_PLUG_SERVICES="net.eth0 net.eth1 !net.eth2"

now start your wireless ether manually or by adding

"/etc/init.d/net.eth2 start" to /etc/conf.d/local.start

"/etc/init.d/net.eth2 stop" to /etc/conf.d/local.stop

possible drawback:

sometimes starting my ipw3945 with "/etc/init.d/net.eth2 start" throws errors on my system (maybe ipw3945d-problem)

Aszrael

----------

## UberLord

You can affect the ordering and dependencies of services in /etc/conf.d/foo by using

RC_NEED="bar"

or

RC_AFTER="bar"

or

RC_BEFORE="bar"

or

RC_USE="bar"

You can even provide your own if you so wish

RC_PROVIDE="bar"

/etc/conf.d/net extends this to

RC_NEED_eth1="net.eth0"

So that eth1 needs net.eth0 to be started - handy for bridges

I guess you need RC_AFTER_ra0="net.eth0 net.eth1" in /etc/conf.d/net

----------

## equaeghe

UberLord,

Your suggestion of using RC_AFTER_ra0="net.eth0 net.eth1" in /etc/conf.d/net would be nice, but does not work, ra0 still starts up first.

However, RC_AFTER="net.eth0" in /etc/conf.d/ntp-client does work and solves this problem.

Could you comment on why the first solution might have failed (it interests me). 

A question related to the use of the conf.d files: are user-created conf.d files for user-created init.d scripts with the same name automatically read?

Erik

----------

## UberLord

 *equaeghe wrote:*   

> Could you comment on why the first solution might have failed (it interests me).

 

Could be a variety of reasons, but my favourite would have to be a baselayout bug in dependency ordering.

Should be fixed in baselayout-1.13 in portage.

----------

