diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-25 09:15:18 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-25 09:15:18 -0700 |
commit | 6c0a3aa59ed28dceddd8e5f09fdad12e255639ee (patch) | |
tree | 129f1c9ad43763a4961429ba3352e52e302b9cd3 /templates/interfaces | |
parent | 227ba9c0795cbe3a800266a17a5e762ea60c904d (diff) | |
download | vyatta-cfg-quagga-6c0a3aa59ed28dceddd8e5f09fdad12e255639ee.tar.gz vyatta-cfg-quagga-6c0a3aa59ed28dceddd8e5f09fdad12e255639ee.zip |
Wait to bring up bond interface until end
Setting bonding parameter requires setting interface down.
Avoid flapping interface unnecessarily on boot, by defering
setting link up until end of boot.
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/bonding/node.def | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def index 211140da..2346c490 100644 --- a/templates/interfaces/bonding/node.def +++ b/templates/interfaces/bonding/node.def @@ -9,9 +9,10 @@ syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \ begin: if [ ! -f /sys/class/net/bonding_masters ]; then sudo modprobe bonding max_bonds=0 miimon=250 fi + create: sudo sh -c "echo +$VAR(@) > /sys/class/net/bonding_masters" || exit 1 - ip link set "$VAR(@)" up - /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on + touch /tmp/bonding_$VAR(@).$PPID + delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`; if [ -z "$SLAVES" ] then @@ -20,3 +21,9 @@ delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`; echo "bonded interface $VAR(@) still has slaves: $SLAVES" exit 1; fi + +end: if [ -f /tmp/bonding_$VAR(@).$PPID ] + then rm -f /tmp/bonding_$VAR(@).$PPID + ip link set "$VAR(@)" up + /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on + fi |