summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-03-04 00:02:36 +0100
committerDirk von Suchodoletz2009-03-04 00:02:36 +0100
commit4fc25af885fd34b5216b8008222b104d5a561126 (patch)
tree4786d2f01d24095460a0476693b6143758124193 /os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh
parentRearranging init-hooks to add a special network bridge hook. (diff)
downloadcore-4fc25af885fd34b5216b8008222b104d5a561126.tar.gz
core-4fc25af885fd34b5216b8008222b104d5a561126.tar.xz
core-4fc25af885fd34b5216b8008222b104d5a561126.zip
Added the general bridge configuration feature as described in ticket
#311: The xenbr function is moved to the appropriate init hook from general functions (cleaning up there). The bridge init hook for the several virtualization tools like vmware, qemukvm, virtualbox use the same filename as the action is to be performed just once ... git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2665 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh')
-rw-r--r--os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh b/os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh
new file mode 100644
index 00000000..7503e3ab
--- /dev/null
+++ b/os-plugins/plugins/virtualbox/init-hooks/20-nw-bridge-config/bridge.sh
@@ -0,0 +1,30 @@
+#!/bin/ash
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# Init hook to create a bridge on the active network interface
+#############################################################################
+
+set -x
+
+local bridge=br0
+local brnwif=${nwif}
+local nwifmac=${macaddr}
+
+# bridge 0 already defined or some other problem
+brctl addbr ${bridge} || exit 0
+brctl stp ${bridge} off
+brctl setfd ${bridge} 0.000000000001
+ip link set addr ${nwifmac} br0
+ip link set dev ${nwif} up
+brctl addif ${bridge} ${nwif}
+
+# fixme: sending back the variable to init does not work properly at the moment
+nwif=${bridge}