[patch initscripts] Add support for network team device.
by Jiri Pirko
example cfg file:
$ cat /etc/sysconfig/network-scripts/ifcfg-teamx1
DEVICE="teamx1"
NM_CONTROLLED="no"
ONBOOT="no"
TYPE="Team"
BOOTPROTO="dhcp"
TEAM_CONFIG='{"runner": "roundrobin", "ports": ["eth1", "eth2"]}'
Signed-off-by: Jiri Pirko <jpirko(a)redhat.com>
---
sysconfig/network-scripts/ifdown-eth | 8 ++++++++
sysconfig/network-scripts/ifup-eth | 9 +++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index fcbae80..8fbd0d2 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -133,6 +133,14 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
fi
fi
+if [ "${TYPE}" = "Team" ]; then
+ if [ ! -x /usr/bin/teamd ]; then
+ net_log $"Team support not available: teamd not found"
+ exit 1
+ fi
+ /usr/bin/teamd -k -p /var/run/teamd-${DEVICE}.pid || exit 1
+fi
+
if [ "${TYPE}" = "Tap" ]; then
tunctl -d "${DEVICE}" >/dev/null
fi
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 5d2cff5..d451975 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -64,6 +64,15 @@ if [ "${TYPE}" = "Bridge" ]; then
done
fi
+# If the device is a team, create it with teamd, if available.
+if [ "${TYPE}" = "Team" ]; then
+ if [ ! -x /usr/bin/teamd ]; then
+ net_log $"Team support not available: teamd not found"
+ exit 1
+ fi
+ /usr/bin/teamd -g -d -t ${DEVICE} -c "${TEAM_CONFIG}" -p /var/run/teamd-${DEVICE}.pid || exit 1
+fi
+
# If the device is a tap device, create it with tunctl, if available.
if [ "${TYPE}" = "Tap" ]; then
if [ ! -x /usr/sbin/tunctl ]; then
--
1.7.7.6
12 years, 3 months