Armin K. wrote:
> On 22.12.2013 18:49, Bruce Dubbs wrote:

>> This brings up a question.  How does systemd handle bringing up a bridge
>> and attaching an ethernet connection?  In BLFS we do:
>>
>> ONBOOT=yes
>> IFACE=br0
>> SERVICE="bridge ipv4-static"  # Space separated
>> IP=192.168.0.22
>> GATEWAY=192.168.0.1
>> PREFIX=24
>> BROADCAST=192.168.0.255
>> CHECK_LINK=no                 # Don't check before bridge is created
>> STP=no                        # Spanning tree protocol, default no
>> INTERFACE_COMPONENTS="eth0"   # Add to IFACE, space separated devices
>> IP_FORWARD=true
>>
>> and the ifup, bridge, and ipv4-static scripts handle it.  How is this
>> done with systemd?
>>
>>      -- Bruce
>>
>
> Not sure, systemd runs "/sbin/ifup interface" at boot, but requires the
> "/etc/sysconfig/ifconfig.interface" and interface in /sys/class/net or
> whatever to be present in order to start it. We might need different
> unit to configure bridge, and that one might need to have a dependency
> on classic ifupdown service that configures the interface, so the bridge
> configuration is started after the interface has been configured properly.
>
> I am curious is this how lfs does it? First, it brings up the interface
> that's being bridged, then it creates the bridge?

In LFS, we basically do:

for S in ${SERVICE}; do
   IFCONFIG=${file} /lib/services/${S} ${IFACE} up
done

So it brings up the bridge and then ipv4.  The bridge script basically does:

brctl addbr ${1}
for I in ${INTERFACE_COMPONENTS}; do
          log_info_msg "Adding ${I} to ${1}..."
          brctl addif ${1} ${I}
          evaluate_retval
done

And then the ipv4-static script runs.  Note that in this configuration, 
the eth0 interface does not have the IP address.  It's only needed by 
the bridge device.

The only reason that I know of for this configuration is to have a place 
to connect qemu virtual hosts as described in BLFS.

   -- Bruce



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

Reply via email to