From c264c79e12e84f522d4eda1a14eb714c67355b2f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sat, 23 Oct 2010 17:39:08 -0700 Subject: Fix bond hash policy Turns out link must be down to change hash policy --- templates/interfaces/bonding/node.tag/hash-policy/node.def | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/bonding/node.tag/hash-policy/node.def b/templates/interfaces/bonding/node.tag/hash-policy/node.def index 54c2bb0f..842410d9 100644 --- a/templates/interfaces/bonding/node.tag/hash-policy/node.def +++ b/templates/interfaces/bonding/node.tag/hash-policy/node.def @@ -5,8 +5,7 @@ syntax:expression: $VAR(@) in "layer2", "layer2+3", "layer3+4" \ ; "hash_policy must be layer2 layer3+4 or layer2+3" help: Bonding transmit hash policy -update: sudo sh -c \ - "echo $VAR(@) >/sys/class/net/$VAR(../@)/bonding/xmit_hash_policy" +update: sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$VAR(../@) --hash=$VAR(@) val_help: layer2; use MAC addresses to generate the hash (802.3ad) val_help: layer2+3; combine MAC address and IP address to make hash -- cgit v1.2.3 From 6c0a3aa59ed28dceddd8e5f09fdad12e255639ee Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 25 Oct 2010 09:15:18 -0700 Subject: 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. --- templates/interfaces/bonding/node.def | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'templates') 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 -- cgit v1.2.3 From 8a10b67b00f09a7d8d519c772061f04d48bfc8f7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 25 Oct 2010 09:33:18 -0700 Subject: Add bonding ARP monitor parmeters --- .../interfaces/bonding/node.tag/arp-monitor/interval/node.def | 5 +++++ templates/interfaces/bonding/node.tag/arp-monitor/node.def | 1 + templates/interfaces/bonding/node.tag/arp-monitor/target/node.def | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 templates/interfaces/bonding/node.tag/arp-monitor/interval/node.def create mode 100644 templates/interfaces/bonding/node.tag/arp-monitor/node.def create mode 100644 templates/interfaces/bonding/node.tag/arp-monitor/target/node.def (limited to 'templates') diff --git a/templates/interfaces/bonding/node.tag/arp-monitor/interval/node.def b/templates/interfaces/bonding/node.tag/arp-monitor/interval/node.def new file mode 100644 index 00000000..1b88797e --- /dev/null +++ b/templates/interfaces/bonding/node.tag/arp-monitor/interval/node.def @@ -0,0 +1,5 @@ +type: u32 +default: 0 +help: ARP link monitoring frequency in milliseconds + +update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../../@)/bonding/arp_interval" diff --git a/templates/interfaces/bonding/node.tag/arp-monitor/node.def b/templates/interfaces/bonding/node.tag/arp-monitor/node.def new file mode 100644 index 00000000..e1c392a7 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/arp-monitor/node.def @@ -0,0 +1 @@ +help: ARP link monitoring parameters diff --git a/templates/interfaces/bonding/node.tag/arp-monitor/target/node.def b/templates/interfaces/bonding/node.tag/arp-monitor/target/node.def new file mode 100644 index 00000000..7dad4c4c --- /dev/null +++ b/templates/interfaces/bonding/node.tag/arp-monitor/target/node.def @@ -0,0 +1,7 @@ +multi: +type: ipv4 +help: IP address to use for ARP monitoring + +create: sudo sh -c "echo +$VAR(@) >/sys/class/net/$VAR(../../@)/bonding/arp_ip_target" + +delete: sudo sh -c "echo -$VAR(@) >/sys/class/net/$VAR(../../@)/bonding/arp_ip_target" -- cgit v1.2.3