On Mar 18, 2012, at 3:46 PM, Bruce Dubbs wrote:

> Nathan Coulson wrote:
>> On Sun, Mar 18, 2012 at 2:28 PM, Bruce Dubbs <[email protected]> wrote:
>>> Nathan Coulson wrote:
>>>> Looks like a balance between simplicity, and useful.  I noted that
>>>> there is nothing to call ip link set br0 up after the interface is
>>>> created though, so it fails to add the gateway.
>>> The bridge is set up explicitly in the bridge service:
>>> 
>>> ip link set ${1} up
>>> 
> 
> I wasn looking at my test system where the bridge service script has a 
> date of Jan 27.  There have been some changes since then.  I'll research 
> it and get back to you.

I haven't had time to check on the current ifup & services scripts to see what 
changes--if any--Bruce accepted.  When I submitted my proposal a few weeks ago, 
the issues were these:

1) ifup needs to be dealing with the physical interface, esp if the config 
scripts need to set parameters for that physical IF (e.g., MTU, driver 
parameters, etc).  I called this variable "PHYS".  If I had to speculate as to 
what Bruce changed (if anything), he probably kept that as "IFACE".

2) Services should be chained, and ordered, so that each service does "it's own 
thing":

        * ifup should bring eth0 up
        * ifup should set MTU (and other link-related parameters)
        * bridge should NOT bring eth0 up, but rely on its caller (ifup) to do 
so
        * bridge should take care of adding the bridge interface (e.g., br0)
        * bridge should take care of the enslaving (eth0 -> br0)
        * bridge should NOT set IP addresses...
        * ...because ipv4-static should set them.

3) The previous constraint means that bridge needs its own variable (i.e., 
BRIDGE_IF=br0) so it knows which interface to create...

4) ...This also means that ipv4-static also needs its own variable (i.e., 
IPV4_IF=br0) so it knows on which interface to ip set addr.

* * *

My vanilla (non-bridged) configs looks like this:

        ONBOOT=yes
        PHYS=eth1
        SERVICE="ipv4-static"
        IP=192.168.0.5
        PREFIX=24
        BROADCAST=192.168.0.255
        GATEWAY=192.168.0.1

In my version of the ipv4-static script, if IPV4_IF isn't set, it just uses 
PHYS (or, as I speculated above, IFACE).

* * *

My bridged configs look like this:

        ONBOOT=yes
        PHYS="eth0"
        MTU=9000
        SERVICE="bridge ipv4-static"
        BRIDGE_IF="br0"
        STP=no
        IPV4_IF="br0"
        IP=10.0.0.5
        GATEWAY=10.0.0.1
        PREFIX=8

So, ifup takes care of setting MTU, and bringing eth0 up.  Then, bridge takes 
care of creating br0, and enslaving eth0 to br0, and setting STP properly.  
Notably, it doesn't not bring eth0 up...it depends on the caller to do that, 
and assumes no responsibility for the physical interface(s).  Then, ipv4-static 
takes care of assigning the IP (10.0.0.5) to br0 (IPV4_IF).

This way, when you take the interface down via ifdown br0, the sequence of 
events is just reversed:

        1) ipv4-static removes the IP from br0
        2) bridge frees eth0 from br0
        3) bridge takes br0 down
        4) ifdown takes eth0 down

This also has the added benefit (which is more correct, IMO) of not having to 
specify CHECK_LINK ever (unless you really don't want ifup to bring the link 
up).  ifup *should* bring the link up.  The other main advantage is that for 
vanilla setups, nothing really changes.

But, for bridged setups, it's correct--and allows us isolate each part of the 
setup and teardown to their respective scripts.  IDK what the scripts in 
LFS-svn look like now, but you can reference my forks of those scripts at:

        https://github.com/qrux/xlapp/tree/master/xlapp-bootscripts

Hope this helps (and I'm crossing my fingers that we don't revert any of the 
new functionality...).

        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