Community discussions

MikroTik App
 
fred974
newbie
Topic Author
Posts: 37
Joined: Fri Jul 15, 2016 3:39 pm

MLAG Script Assistance

Tue Jan 03, 2023 8:33 pm

Help setting Mikrotik MLAG

help/advice me on how to aggregate 2 ports using LACP between the 2 Mikrotik switches.

We have 4x hypervisors 1x storage server and 2 backup servers all conneted to 2x Mikrotik CRS317-1G-16S+RM let call the switches 'mk_switch1' and 'mk_switch2' for illustration purporses.
Each servers hae 2x sfp+ interfaces. 1x interface is connected to mk_switch1 and the other to mk_switch1.
We need to bond the 2 interfaces using LACP between the 2 Mikrotik switches so that we have High availibity setup in place. Loosing 1 switch should not stop the VMs from running. The bond need to be able to receive all vlan (Trunk mode) as the hypervisor will be responsable to creating the correct network to the correct VMs.
Here are the bond we are looking to create:

Hypervisor 1:
mk_switch1 -> sfp+ 2
mk_switch2 -> sfp+ 2

Hypervisor 2:
mk_switch1 -> sfp+ 5
mk_switch2 -> sfp+ 5

Hypervisor 3:
mk_switch1 -> sfp+ 9
mk_switch2 -> sfp+ 9

Hypervisor 4:
mk_switch1 -> sfp+ 13
mk_switch2 -> sfp+ 13

Storage:
mk_switch1 -> sfp+ 6
mk_switch2 -> sfp+ 6

Backup Server 1:
mk_switch1 -> sfp+ 8
mk_switch2 -> sfp+ 8

Backup Server 2:
mk_switch1 -> sfp+ 10
mk_switch2 -> sfp+ 10


In the hypervisor config and backup servers, the 2x 10G interface are bonded with the LACP protocol and we now need to make sure the switch also support LACP for the 2 interfaces accross both switches.

In order to achive our goal, we loaded the latest MikroTik RouterOS 7.6, reset the boot from SwOS back to RouterOS to attempted to create the MLAG but we are not sure if it should be set in 'bridge' or 'router' mode.
Here is our script so far (executed on both switch) from this article https://stubarea51.net/2021/06/04/mikro ... -switches/ :
Peer1
/interface bonding
add mlag-id=10 mode=802.3ad name=opnsense01-bond slaves=sfp-sfpplus16;
add mlag-id=11 mode=802.3ad name=hyper1-bond slaves=sfp-sfpplus2;
add mlag-id=12 mode=802.3ad name=hyper2-bond slaves=sfp-sfpplus5;
add mlag-id=13 mode=802.3ad name=hyper3-bond slaves=sfp-sfpplus9;
add mlag-id=14 mode=802.3ad name=hyper4-bond slaves=sfp-sfpplus13;
add mlag-id=15 mode=802.3ad name=backupPrimary-bond slaves=sfp-sfpplus8;
add mlag-id=16 mode=802.3ad name=backupReplica-bond slaves=sfp-sfpplus10;
add mlag-id=17 mode=802.3ad name=truenas-bond slaves=sfp-sfpplus6;


/interface bridge
add name=bridge1 vlan-filtering=yes

/interface bridge port
add bridge=bridge1 interface=opnsense01-bond;
add bridge=bridge1 interface=hyper1-bond;
add bridge=bridge1 interface=hyper2-bond;
add bridge=bridge1 interface=hyper3-bond;
add bridge=bridge1 interface=hyper4-bond;
add bridge=bridge1 interface=backupPrimary-bond;
add bridge=bridge1 interface=backupReplica-bond;
add bridge=bridge1 interface=truenas-bond;
Peer2
/interface bonding
add mlag-id=10 mode=802.3ad name=opnsense01-bond slaves=sfp-sfpplus16;
add mlag-id=11 mode=802.3ad name=hyper1-bond slaves=sfp-sfpplus2;
add mlag-id=12 mode=802.3ad name=hyper2-bond slaves=sfp-sfpplus5;
add mlag-id=13 mode=802.3ad name=hyper3-bond slaves=sfp-sfpplus9;
add mlag-id=14 mode=802.3ad name=hyper4-bond slaves=sfp-sfpplus13;
add mlag-id=15 mode=802.3ad name=backupPrimary-bond slaves=sfp-sfpplus8;
add mlag-id=16 mode=802.3ad name=backupReplica-bond slaves=sfp-sfpplus10;
add mlag-id=17 mode=802.3ad name=truenas-bond slaves=sfp-sfpplus6;


/interface bridge
add name=bridge1 vlan-filtering=yes

/interface bridge port
add bridge=bridge1 interface=opnsense01-bond;
add bridge=bridge1 interface=hyper1-bond;
add bridge=bridge1 interface=hyper2-bond;
add bridge=bridge1 interface=hyper3-bond;
add bridge=bridge1 interface=hyper4-bond;
add bridge=bridge1 interface=backupPrimary-bond;
add bridge=bridge1 interface=backupReplica-bond;
add bridge=bridge1 interface=truenas-bond;
Where I get confuse is how to create the 'trunk' vlan. Should each vlan be setup as a bridge like:
Peer1
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus2 vlan-ids=100
add bridge=bridge1 tagged=sfp-sfpplus5 vlan-ids=101
add bridge=bridge1 tagged=sfp-sfpplus6 vlan-ids=102

Peer2
/interface bridge vlan
add bridge=bridge1 tagged=sfp-sfpplus2 vlan-ids=100
add bridge=bridge1 tagged=sfp-sfpplus5 vlan-ids=101
add bridge=bridge1 tagged=sfp-sfpplus9 vlan-ids=102
How do I specify bridge and peer-port to enable MLAG? How do I decide which sfpplus is the bridge mlag?

I would also like the managment port to be use only for managment with vlan id1

I would really appreciate some assistance in finishing my script.

Thank you all in advance.

Who is online

Users browsing this forum: FurfangosFrigyes, lurker888, rplant and 20 guests