From db1b44563e05c1eb1f5d8bd475c3ed1250307aeb Mon Sep 17 00:00:00 2001 From: "David S. Madole" Date: Sun, 27 Sep 2009 15:27:54 -0400 Subject: Add VRRP capability to bonding interfaces and vifs of bonding interfaces. --- lib/Vyatta/Keepalived.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm index 96d4fe9..c34d277 100755 --- a/lib/Vyatta/Keepalived.pm +++ b/lib/Vyatta/Keepalived.pm @@ -153,10 +153,18 @@ sub vrrp_get_config { my $path; my $config = new Vyatta::Config; - if ($intf =~ m/(eth\d+)\.(\d+)/) { - $path = "interfaces ethernet $1 vif $2"; + if ($intf =~ m/bond/) { + if ($intf =~ m/(bond\d+)\.(\d+)/) { + $path = "interfaces bonding $1 vif $2"; + } else { + $path = "interfaces bonding $intf"; + } } else { - $path = "interfaces ethernet $intf"; + if ($intf =~ m/(eth\d+)\.(\d+)/) { + $path = "interfaces ethernet $1 vif $2"; + } else { + $path = "interfaces ethernet $intf"; + } } $config->setLevel($path); -- cgit v1.2.3