I answered Nathan's question separately...

On Mar 19, 2012, at 2:40 PM, Bruce Dubbs wrote:

> The problem is trying to get the different options working together 
> properly.  Right now the CHECK_LINK is done in ifup.  Perhaps it should 
> be moved to the various service scripts and removed from ifup.

Each script should be in charge of a certain interface.  ifup for the physical 
interface, and bridge for the bridge interface.  Each script should take care 
of handling its own interface.  We are just used to IP configurations being 
slapped-on to the physical interface.

If you want a config that resembles the 7.0 interface, you can always 
instrument ipv4-static to have that logic where if no service-specific 
interface is defined, it can use the physical one.  I do that in my fork.

Generally, you want *more* info in a config file, rather than monkeying around 
with less, and dealing with convoluted scripts.  Shouldn't try to configure a 
bridge with a single IFACE variable, because then it's unclear whose 
responsibility it is to deal with the physical link parameters (driver 
parameters, MTU) vs bridge parameters (STP, slave ports) vs IP parameters, and 
also try to figure out which interface to apply each setting to.

> CHECK_LINK is a legacy issue.

I don't see this in other distros.  But, it's sort of moot...Each layer 
(physical, bridge, IP) should take care of setup and teardown of its OWN 
interface.  It just so happens that in the vanilla IP case, the interface for 
the service (eth0) is the same as the physical interface (eth0) which is also 
the same as the file-name (ifconfig-eth0).

But, in the case of a bridge, the interface service (br0) is not the same as 
the physical interface(s) (eth0, eth1, etc).

> I can't really see why an interface 
> should be initialized without setting it up.

Stuff like bridges require the physical links (e.g., eth0) need to be up before 
they are created; otherwise, they can't be enslaved properly.  The physical 
link (e.g., eth0) is not configured when it's part of a bridge.

> The current script tries 
> to bring up the interface before the service script is run.  For the br0 
> interface, that is before it is created and doesn't work.
> 
> The code could also be simplified quite a bit.  Does running
> 
>  ip link set ${IFACE} up
> 
> unconditionally when it is already up really affect anything?

Probably not.  But why would you want to do it?  Have you looked at my scripts 
and decided that they don't solve the problem?

> Alternatively, the ifup script could just test for the device name 
> starting with "br" and defer the step setting the bridge up to the 
> bridge service script.

And what about stuff like SLIP or Multilink PPP or bonding or tunneling?  
Aren't those all tunnel-link protocols going to require setting things up (and 
tearing things down) in stages?  Why wouldn't you want the scripts to work in 
the same way?  Build up the outer layer first, then the next inner layer, and 
so on...

> I do think that if the bridge is up, the gateway will be set properly 
> when the eth device is initialized.

Separation allows ifup to bring up the physical interface and sets physical 
link parameters (like MTU), then pass that interface (configured--in so far as 
the link layer is concerned) to services.  Services take that 
properly-configured physical link, and layer stuff on top.  Some are simple 
(like ipv4-static, DHCP, etc), and just apply a line or two of configuration 
for the most vanilla case.  Others are more complex (like a bridge).  But, if 
you let services deal with the service itself--and not try to combine the 
physical link configuration with the service configuration, it makes things 
cleaner and more correct.

Since the config file is passed to all the services, they can *use* the 
physical link if they need/want to (my ipv4-static can use PHYS--or IFACE--if 
it doesn't see a service-specific interface). But, they don't have to use it, 
and in the case of the bridge, they shouldn't--because there's a difference 
between the SERVICE interface and the PHYSICAL interface.

        Q

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to