[CentOS] network interface activation order

Fri Nov 30 17:03:24 UTC 2007
Matt Hyclak <hyclak at math.ohiou.edu>

On Fri, Nov 30, 2007 at 08:51:50AM -0800, John R Pierce enlightened us:
> Graham Johnston wrote:
> >I am using CentOS as a firewall/router.  I am using bonded interfaces,
> >vlan interfaces, and bridge interfaces.  My problem currently is that on
> >boot the system is attempting to activate the bridge interface before
> >it's bonded-vlan members have been created.  What this means is that the
> >bridge is created but not activated.
> >
> >Is there anyway for me to influence the activation order and have bridge
> >interfaces dealt with last?
> >  
> 
> there's probably a better way to do this, but what I've done in the past 
> is to create special firewall related kinda stuff like your'e describing 
> in my own script thats run quite late in the init sequence, usually from 
> rc2.d/S99myfirewall  or even from /etc/rc.d/rc.local
> 
> 

Yes, there is probably a better way. My initial thought was to set ONBOOT=no
for the bridge interfaces and then bring them up in an initscript or
rc.local later.

Looking at the network startup script (/etc/init.d/network), though, it
looks like you can probably achieve the same effect simply by renaming the
ifcfg-brX files to something like ifcfg-zbrX.

There is a loop to bring up interfaces that looks like:

# bring up all other interfaces configured to come up at boot time
        for i in $interfaces; do

and $interfaces is set just above by listing all files starting with ifcfg
and snagging the end part (e.g. eth0 or br0).

The loop figures out what kind of configuration it needs by reading the
file, so I don't think it cares what it is named, as long as it is
ifcfg-something. By renaming bridges to ifcfg-zbrX, it will come after
ifcfg-vlanX and I think solve your problem.

That was work, time for lunch :-)

Matt

-- 
Matt Hyclak
Department of Mathematics 
Department of Social Work
Ohio University
(740) 593-1263