On 30/08/2011 4:14 AM, Nathan Coulson wrote:
> been sitting on this service script for a while, and I think it could
> go into BLFS. I use this to bridge my eth0 with a TAP interface
> created by QEMU (on bootup, I only use eth0 in the INTERFACES
> variable, and later on, it add's the tap0 if I startup qemu).
>
> [I know it's not in the form of a patch, but to be honest, have yet to
> actually dig into the xml format BLFS uses. Thought I'd test the
> waters before going that far]
>
> This package is used to combine multiple network interfaces together,
> an implementation of the 802.1d
>
> Homepage [I think...]:
> http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge
> Download:
> http://downloads.sourceforge.net/project/bridge/bridge/bridge-utils-1.5.tar.gz
>
> ******** Installation **********
> $ autoconf
> $ ./configure --prefix=/usr --sbindir=/sbin
> $ make
> $ make install
>
>
> Installed Programs: /sbin/brctl
> Installed manuals /usr/share/man/man8/brctl.8
>
>
> Short Description:
> brctl: ethernet bridge administration
>
> ******** Configuration **********
> install -d -m755 /etc/sysconfig/network-devices/ifconfig.br0
> cat> /etc/sysconfig/network-devices/ifconfig.br0/05bridge<< "EOF"
> ONBOOT=yes
> CHECK_LINK=no
> SERVICE=bridge
> INTERFACES=eth0 eth1
> EOF
>
> cat> /etc/sysconfig/network-devices/ifconfig.br0/10ipv4<< "EOF"
> ONBOOT=yes
> SERVICE=ipv4-static
> IP=192.168.1.2
> PREFIX=24
> BROADCAST=192.168.1.255
> GATEWAY=192.168.1.1
> EOF
>
> ******** Service Script **********
> #!/bin/sh
> ########################################################################
> # Begin $network_devices/services/bridge
> #
> # Description : Bridge Boot Script
> #
> # Authors : Nathan Coulson - [email protected]
> #
> # Version : 00.00
> #
> ########################################################################
>
> . /etc/sysconfig/rc
> . ${rc_functions}
> . ${IFCONFIG}
>
> if [ -n "${INTERFACE}" ]; then
> boot_mesg "INTERFACES variable missing from ${ifconfig},", ${FAILURE}
> echo_failure
> exit 1
> fi
>
> case "${2}" in
> up)
> boot_mesg "Creating the ${1} interface..."
> brctl addbr ${1}
> evaluate_retval
> for X in ${INTERFACES}; do
> boot_mesg "Adding ${X} to ${1}..."
> ip addr add 0.0.0.0 dev ${X}&&
> ip link set ${X} up&&
> brctl addif ${1} ${X}
> evaluate_retval
> done
> ;;
>
> down)
> for X in ${INTERFACES}; do
> boot_mesg "Removing ${X} from ${1}..."
> ip link set ${X} down&&
> brctl delif ${1} ${X}
> evaluate_retval
> done
> boot_mesg "Bringing down the ${1} interface..."
> ip link set ${1} down
> brctl delbr ${1}
> evaluate_retval
> ;;
>
> *)
> echo "Usage: ${0} [interface] {up|down}"
> exit 1
> ;;
> esac
>
> # End $network_devices/services/bridge
>
> ******** Patch for latest LFS **********
> #!/bin/sh
> ########################################################################
> -# Begin $network_devices/services/bridge
> +# Begin /lib/boot/bridge
> #
> # Description : Bridge Boot Script
> #
> @@ -10,8 +10,7 @@
> #
> ########################################################################
>
> -. /etc/sysconfig/rc
> -. ${rc_functions}
> +. /lib/boot/functions
> . ${IFCONFIG}
>
> if [ -n "${INTERFACE}" ]; then
> @@ -53,4 +52,4 @@
> ;;
> esac
>
> -# End $network_devices/services/bridge
> +# End /lib/boot/bridge
>
>
This is one of the first packages I install on my HA cluster nodes
(ganeti with KVM) and I imagine it would be quite useful for many other
things. I think it would be a nice addition to the book.
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page