Package: bridge-utils
Version: 1.0.4-1
Severity: normal
Tags: patch
Hi,
I want to setup a bridge without IP address, and I think the correct
way of doing so is to use the "manual" method of the inet family.
Something like this:
auto br2
iface br2 inet manual
bridge_ports none
bridge_stp off
bridge_fd 5
While such a bridge is nicely created and comes up, it doesn't get
deleted properly. Here's what happens:
host# ifup br2
Waiting for br2 to get ready (MAXWAIT is 12 seconds).
host# ifdown br2
bridge br2 is still up; can't delete it
run-parts: /etc/network/if-post-down.d/bridge exited with return code 1
This is because of a missing "ifconfig br2 down" call, which I solved
with the attached /etc/network/if-post-down.d/bridge file.
This file changes two things:
- it changes the order of things,
- it removes interfaces from the bridge,
- it adds an ifconfig down call on the bridge interface.
The reversal is IMHO needed since the up script does something in the
lines of:
create_bridge()
for all ports
add_port()
ifconfig port up
setup_bridge()
ifconfig bridge up
Hence, the logical destroyal (with respect to the pre-up script) should
be:
ifconfig bridge down
for all ports
ifconfig port down
remove_port()
del_bridge()
In your package it is:
del_bridge()
for all ports
ifconfig port down
Regards,
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages bridge-utils depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
pn libsysfs1 Not found.
--
Lo�c Minier <[EMAIL PROTECTED]>
"Neutral President: I have no strong feelings one way or the other."
#!/bin/sh
# You don't usually need to touch this file at all, the full configuration
# of the bridge can be done in a standard way on /etc/network/interfaces.
# Have a look at /usr/share/doc/bridge-utils/README.Debian.gz if you want
# more info about the way on wich a bridge is set up on Debian.
if [ ! -x /usr/sbin/brctl ]
then
exit 0
fi
case "$IF_BRIDGE_PORTS" in
"")
exit 0
;;
none)
INTERFACES=""
;;
all)
INTERFACES=`grep eth /proc/net/dev|sed 's/\(\
*\)\(eth[^:]*\)\(.*\)/\2/'`
;;
*)
INTERFACES="$IF_BRIDGE_PORTS"
;;
esac
ifconfig $IFACE down
for i in $INTERFACES
do
ifconfig $i down
brctl delif $IFACE $i
done
brctl delbr $IFACE