Re: VRRP: how to move specific MAC from one router to the other on failover?
Andras Korn <[email protected]> Fri, 13 Apr 2018 14:48:03 +0200
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <20180413124803.yj4lxu5hp4xmwljv@hellgate> |
On Tue, Apr 10, 2018 at 04:36:51PM +0000, Damien Clabaut wrote:
Hi,
> > [need to make sure VRRP MASTER always has the same specific MAC address]
>
> I do not believe VRRP is able to do such a thing natively.
>
> I have a solution to offer you, but at your own risks as it is non-standard.
>
> I strongly suggest you test it in a lab first (and tell me if I got anything wrong).
>
> You can use notify_master, notify_slave and notify_fault this way
> (provided 00:26:18:82:8b:07 is the mac address you want to move, and eth1 is your interface):
>
> notify_master "/usr/bin/macchanger -m 00:26:18:82:8b:07 eth1"
> notify_slave "/usr/bin/macchanger -p eth1"
> notify_fault /usr/bin/macchanger -p eth1"
It's `notify_backup`, not `notify_slave`, and a quote is missing from the
last command line, but otherwise, this works beautifully (it also,
obviously, needs `script_user root` in `global_defs`).
Thanks for pointing me to `macchanger`; I'd have done it with `ip link set
address` otherwise, which is less elegant because it doesn't have an
equivalent of `macchanger -p`.
I'm pleasantly surprised it's now possible to change the MAC of an Ethernet
interface without bringing it down first; I remember this not being the case
a few years ago.
Andras
--
Help Wanted: Telepath. You know where to apply.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot