aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-09-09 04:47:02 +0000
committerBill Nottingham <notting@redhat.com>2003-09-09 04:47:02 +0000
commitc91600dea4d59ce0812fe66e2688ad7f01e281a0 (patch)
treea17080dd8b57186dc24fec3b05b9da01e1b604f4 /sysconfig/network-scripts/ifup
parent196aeeca3e1e15b24bd9b38af8eb9b159639d90b (diff)
downloadinitscripts-c91600dea4d59ce0812fe66e2688ad7f01e281a0.tar
initscripts-c91600dea4d59ce0812fe66e2688ad7f01e281a0.tar.gz
initscripts-c91600dea4d59ce0812fe66e2688ad7f01e281a0.tar.bz2
initscripts-c91600dea4d59ce0812fe66e2688ad7f01e281a0.tar.xz
initscripts-c91600dea4d59ce0812fe66e2688ad7f01e281a0.zip
bridging support (<dwmw2@redhat.com>)
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-xsysconfig/network-scripts/ifup17
1 files changed, 17 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index d50380b2..96f7128e 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -53,6 +53,8 @@ then
exit 0
fi
+[ "${TYPE}" = "Bridge" ] && exit 0
+
# Ethernet 802.1Q VLAN support
if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then
if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q 'eth[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then
@@ -151,6 +153,21 @@ if [ -n "${HWADDR}" ]; then
fi
fi
+if [ "${TYPE}" = "Bridge" -a -x /usr/sbin/brctl ]; then
+ /sbin/ip link set ${DEVICE} down 2>/dev/null
+ /usr/sbin/brctl delbr ${DEVICE} 2>/dev/null
+ /usr/sbin/brctl addbr ${DEVICE}
+ [ -n "${DELAY}" ] && /usr/sbin/brctl setfd ${DEVICE} ${DELAY}
+ [ -n "${GCINT}" ] && /usr/sbin/brctl setgcint ${DEVICE} ${GCINT}
+fi
+
+if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
+ /sbin/ip addr flush dev ${DEVICE} 2>/dev/null
+ /sbin/ip link set ${DEVICE} up
+ /usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
+ exit $?
+fi
+
# now check the real state
is_available ${REALDEVICE} || {
if [ "$?" = "1" ] ; then