svlsResearch / ha-mikrotik

High availability code for Mikrotik routers
156 stars 45 forks source link

HA interface through switch #5

Closed mrgadget closed 5 years ago

mrgadget commented 6 years ago

We have a requirement to run the HA interface through a switch (as the routers aren't in the same datacenter). It seems that by default all MACs are duplicated to the standby router - including the HA interface. This means, when traffic is put through a switch, it falls over as a MAC can only exist on one port.

I found this line in ha_startup (commented): #/interface ethernet reset-mac-address

We don't require the replication of MACs, so uncommenting this I thought would do the trick - but on new versions this command actually waits for input (interface number) - to get it to run on all interfaces I appended [find] ie: /interface ethernet reset-mac-address [find]

I then thought as one further option that if people do want MAC replication but just not on the HA interface, this line works: /interface ethernet reset-mac-address [find interface="$haInterface"]

Or am I doing/understanding this wrong?

nathanfaber commented 6 years ago

This seems reasonable. I don't see any reason why $haInterface can't have their respective original MAC, just as you suggested. Does this satisfy your requirement or you still need a full reset of all interfaces for your setup?

It seems like the simple single $haInterface reset would work and be backwards compatible, so we could just make it the default assuming that all proves out.

nathanfaber commented 5 years ago

Implemented. #