]> TLD Linux GIT Repositories - rc-scripts.git/blobdiff - lib/ifup-bond
- use ip command for configuring bond interfaces
[rc-scripts.git] / lib / ifup-bond
index 5651839c072d2025d80e39aeb76e7dbfc54ea725..3c1d648098817f452d7b5a455f51a58d32f93df7 100755 (executable)
@@ -35,20 +35,15 @@ fi
 if [ ! -f /sys/class/net/bonding_masters ]; then
        modprobe -s bonding || exit 1
        # delete default bond0
-       echo "-bond0" > /sys/class/net/bonding_masters
+       ip link del bond0 type bond
 fi
 
 # set all major variables
 setup_ip_param
 
 # create bonding master
-if ! grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
-       echo "+${DEVICE}" > /sys/class/net/bonding_masters
-       if [ $? -eq 0 ]; then
-               ip link set dev ${DEVICE} multicast ${MULTICAST} ${ARP}
-       else
-               exit 1
-       fi
+if [ ! -d "/sys/class/net/${DEVICE}" ]; then
+       ip link add "${DEVICE}" type bond
 fi
 
 # add the bits to setup driver parameters here