Re: VRRP: how to move specific MAC from one router to the other on failover?

Quentin Armitage <[email protected]> Fri, 13 Apr 2018 14:50:11 +0100
Newsgroups gmane.linux.keepalived.devel
Organization The Armitage family
Message-ID <[email protected]>
--===============3722824706738309983==
Content-Type: multipart/alternative; boundary="=-Y2L/0L6lG5ZWQbjQjVvJ"


--=-Y2L/0L6lG5ZWQbjQjVvJ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Andras,
Would it also be a good idea to addnotify_stop "/usr/bin/macchanger -p
eth1"
It would be useful if you could describe your use case for requiring
the specific MAC, since if it is a more general requirement then I
suspect we could implement the MAC change functionality into
Keepalived.
Quentin Armitage
On Fri, 2018-04-13 at 14:48 +0200, Andras Korn wrote:
> 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
> 
--=-Y2L/0L6lG5ZWQbjQjVvJ
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit

<html><head></head><body bgcolor="#ffffff" text="#2e3436" link="#2a76c6" vlink="#2e3436"><div>Andras,</div><div><br></div><div>Would it also be a good idea to add</div><div>notify_stop "/usr/bin/macchanger -p eth1"</div><div><br></div><div>It would be useful if you could describe your use case for requiring the specific MAC, since if it is a more general requirement then I suspect we could implement the MAC change functionality into Keepalived.</div><div><br></div><div>Quentin Armitage</div><div><br></div><div>On Fri, 2018-04-13 at 14:48 +0200, Andras Korn wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>On Tue, Apr 10, 2018 at 04:36:51PM +0000, Damien Clabaut wrote:

Hi,

<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
[need to make sure VRRP MASTER always has the same specific MAC address]
</blockquote>

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"
</blockquote>

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

</pre></blockquote></body></html>
--=-Y2L/0L6lG5ZWQbjQjVvJ--



--===============3722824706738309983==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============3722824706738309983==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel

--===============3722824706738309983==--