aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-eth
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-03-19 17:07:51 -0400
committerBill Nottingham <notting@redhat.com>2009-03-19 17:07:51 -0400
commit242e38c178b6509496452d4a9d9e01024a415e64 (patch)
tree0bde093d565f4dad9b4491bb307d4d8d495eed27 /sysconfig/network-scripts/ifup-eth
parent8d96a60141a556e25e251d817f072aca7e4d4e8d (diff)
downloadinitscripts-242e38c178b6509496452d4a9d9e01024a415e64.tar
initscripts-242e38c178b6509496452d4a9d9e01024a415e64.tar.gz
initscripts-242e38c178b6509496452d4a9d9e01024a415e64.tar.bz2
initscripts-242e38c178b6509496452d4a9d9e01024a415e64.tar.xz
initscripts-242e38c178b6509496452d4a9d9e01024a415e64.zip
Add support for creating TUN/TAP devices on the fly (#453973, <scott@zahna.com>)
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index fa755535..989f73ea 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -50,6 +50,7 @@ if [ -n "${HWADDR}" ]; then
fi
fi
+# If the device is a bridge, create it with brctl, if available.
if [ "${TYPE}" = "Bridge" ]; then
if [ ! -x /usr/sbin/brctl ]; then
echo $"Bridge support not available: brctl not found"
@@ -62,6 +63,16 @@ if [ "${TYPE}" = "Bridge" ]; then
[ -n "${STP}" ] && /usr/sbin/brctl stp ${DEVICE} ${STP}
fi
+# If the device is a tap device, create it with tunctl, if available.
+if [ "${TYPE}" = "Tap" ]; then
+ if [ ! -x /usr/sbin/tunctl ]; then
+ echo $"Tap support not available: tunctl not found"
+ exit 1
+ fi
+ [ -n "${OWNER}" ] && OWNER="-u ${OWNER}"
+ /usr/sbin/tunctl ${OWNER} -t ${DEVICE} > /dev/null
+fi
+
# now check the real state
is_available ${REALDEVICE} || {
if [ -n "$alias" ]; then
@@ -137,6 +148,7 @@ if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then
done
fi
+# If the device is part of a bridge, add the device to the bridge
if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
if [ ! -d /sys/class/net/${BRIDGE}/bridge ]; then
/usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null