# Copyright (C) 2016-2017 Cumulus Networks, inc.
#
# All Rights reserved.
#
# This software is subject to the Cumulus Networks End User License Agreement available
# at the following locations:.
#
# Internet: https://cumulusnetworks.com/downloads/eula/latest/view/
#
# Cumulus Linux systems: /usr/share/cumulus/EULA.txt

Scenario
========


            --------------                   --------------
           |              | swp49     swp49 |              |
           |    spine1    |=================|    spine2    |
           |   10.0.0.1   | swp50     swp50 |   10.0.0.2   |
            --------------                   --------------
          swp1 |      | swp2               swp1 |      | swp2
               |       -----------   -----------       |
	       |                   X                   |
               |       -----------   -----------       |
         swp51 |      | swp52             swp51 |      | swp52
            --------------                   --------------
           |              | swp49     swp49 |              |
           |    leaf01    |=================|    leaf02    |
           |   10.0.1.1   | swp50     swp50 |   10.0.1.2   |
            --------------                   --------------
                   | swp1                           | swp1
                   |           ---------            |
                   |          |         |           |
                    ----------| host-11 |-----------
                              |         |
                               ---------

We want to create a L2-MLAG leaf-spine network with VLAN trunks to the hosts;
these networks are traditionally used in virtualization use cases.

In this example We create an MLAG peering relationships between spine1/spine2 as
well as leaf01/leaf02 on their swp49 and swp50 interfaces.  We'll distribute vlans
100-500 through the whole network, trunking VLANs 100-120 to host-11 (with vlan
100 untagged).

You will need to configure spine1/spine2 and leaf01/leaf02, the steps for each
pair are very similar.


- create the peering; select one switch to be primary and the other secondary
  - backup-ip is an optional (recommened) IP address that is separately reachable

- create VLANs 100-500

- create the mlag downlinks on the spines
  - spine1 and spine2 MUST use the same clag-id for the downlink to the leaf-pair

- create the mlag uplinks on the leafs
  - leaf01 and leaf02 MUST use the same clag-id for the uplink to the spine-pair

- configure a host facing interface for clag
  - leaf01 and leaf02 MUST use the same clag-id for host-11

- connect the clag to host-11 to vlans 100-120, with vlan 100 untagged

- review and commit

net commands
============

spine1# net add clag peer sys-mac 44:38:39:FF:00:00 interface swp49-50 primary backup-ip 10.0.0.2
spine1# net add vlan 100-500
spine1# net add bridge stp treeprio 16384
spine1# net add clag port bond bond-leaf-01-02 interface swp1,swp2 clag-id 1
spine1# net pending
spine1# net commit

spine2# net add clag peer sys-mac 44:38:39:FF:00:00 interface swp49-50 secondary backup-ip 10.0.0.1
spine2# net add vlan 100-500
spine2# net add bridge stp treeprio 16384
spine2# net add clag port bond bond-leaf-01-02 interface swp1,swp2 clag-id 1
spine2# net pending
spine2# net commit

leaf01# net add clag peer sys-mac 44:38:39:FF:00:01 interface swp49-50 primary backup-ip 10.0.1.2
leaf01# net add vlan 100-500
leaf01# net add clag port bond bond-to-spines interface swp51-52 clag-id 100
leaf01# net add clag port bond bond-to-host-11 interface swp1 clag-id 1
leaf01# net add bond bond-to-host-11 bridge trunk vlans 100-120
leaf01# net add bond bond-to-host-11 bridge pvid 100
leaf01# net pending
leaf01# net commit

leaf02# net add clag peer sys-mac 44:38:39:FF:00:01 interface swp49-50 secondary backup-ip 10.0.1.1
leaf02# net add vlan 100-500
leaf02# net add clag port bond bond-to-spines interface swp51-52 clag-id 100
leaf02# net add clag port bond bond-to-host-11 interface swp1 clag-id 1
leaf02# net add bond bond-to-host-11 bridge trunk vlans 100-120
leaf02# net add bond bond-to-host-11 bridge pvid 100
leaf02# net pending
leaf02# net commit

Verification
============
spine1# net show interface
spine1# net show clag
leaf01# net show interface
leaf01# net show clag
