summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2011-11-08 16:02:06 -0800
committerBob Gilligan <gilligan@vyatta.com>2011-11-08 16:02:06 -0800
commitdb9cc7f187ff8b2796bafd1f3b14472256385338 (patch)
treeb1c5f72aca610e550f80726624ded986a0ffb0b3 /scripts
parent5d27f2ef302dc600ea737e9af4151041aa11a2e0 (diff)
downloadvyatta-cfg-system-db9cc7f187ff8b2796bafd1f3b14472256385338.tar.gz
vyatta-cfg-system-db9cc7f187ff8b2796bafd1f3b14472256385338.zip
First pass implementation of support for virtual MAC address
This change introduces a new parameter named "interface" under the vrrp-group configuration tree under ethernet interfaces and vlans. If the "interface" parameter is set, keepalived will be configured to bring up a macvlan interface, which will hold the virtual MAC address that is specified in the VRRP spec.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/keepalived/vyatta-keepalived.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl
index 7a113469..e834745b 100755
--- a/scripts/keepalived/vyatta-keepalived.pl
+++ b/scripts/keepalived/vyatta-keepalived.pl
@@ -144,6 +144,12 @@ sub keepalived_get_values {
push @errs, $err;
next;
}
+
+ my $use_vmac = 0;
+ if ( $config->exists("interface") ) {
+ $use_vmac = 1;
+ }
+
my $priority = $config->returnValue("priority");
if ( !defined $priority ) {
$priority = 1;
@@ -240,6 +246,9 @@ sub keepalived_get_values {
$output .= "\tstate $init_state\n";
$output .= "\tinterface $intf\n";
$output .= "\tvirtual_router_id $group\n";
+ if ($use_vmac) {
+ $output .= "\tuse_vmac\n";
+ }
$output .= "\tpriority $priority\n";
if ( $preempt eq "false" ) {
$output .= "\tnopreempt\n";