# 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
========

            --------------                   --------------
           |    spine1    |                 |    spine2    |
           |   10.0.0.1   |                 |   10.0.0.2   |
           |  AS - 65000  |                 |  AS - 65000  |
            --------------                   --------------
          swp1 |      | swp2               swp1 |      | swp2
               |       -----------   -----------       |
	       |                   X                   |
               |       -----------   -----------       |
         swp51 |      | swp52             swp51 |      | swp52
            --------------                   --------------
           |    leaf01    |                 |    leaf02    |
           |   10.0.0.3   | swp49     swp49 |   10.0.1.4   |
           |  10.0.1.250  |=================|  10.0.1.251  |
           |  10.0.1.254  | swp50     swp50 |  10.0.1.254  |
           |  AS - 65003  |                 |  AS - 65004  |
            --------------                   --------------
                   | swp1                           | swp1
                   |           ---------            |
                   |          |         |           |
                    ----------| host-11 |-----------
                              |         |
                               ---------

We want to create a L3 leaf-spine network with BGP unnumbered and connect the
hosts using MLAG for network/link redundancy.  These networks are typically used
in container applications, network virtualization (i.e. VMware NSX), and
high scale compute application deployments.

In this example, we configure BGP unnumbered on the spine switches and peer them
with the leafs.  We also create an MLAG peering relationship between
leaf01/leaf02 on their swp49 and swp50, create SVIs for reachability, and
advertise the rack subnet.

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

- create the unnumbered BGP L3 fabric

- 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 VLAN 100 with SVIs on each leaf and an virtual address for the router

- 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 vlan 100 untagged

- review and commit


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

spine1# net add bgp autonomous-system 65000
spine1# net add loopback lo ip address 10.0.0.1/32
spine1# net add bgp router-id 10.0.0.1
spine1# net add bgp ipv4 unicast network 10.0.0.1/32
spine1# net add bgp neighbor swp1-2 interface remote-as external
spine1# net add bgp ipv4 unicast neighbor swp1-2 activate
spine1# net add bgp bestpath as-path multipath-relax
spine1# net pending
spine1# net commit

spine2# net add bgp autonomous-system 65000
spine2# net add loopback lo ip address 10.0.0.2/32
spine2# net add bgp router-id 10.0.0.2
spine2# net add bgp ipv4 unicast network 10.0.0.2/32
spine2# net add bgp neighbor swp1-2 interface remote-as external
spine2# net add bgp ipv4 unicast neighbor swp1-2 activate
spine2# net add bgp bestpath as-path multipath-relax
spine2# net pending
spine2# net commit

leaf01# net add bgp autonomous-system 65003
leaf01# net add loopback lo ip address 10.0.0.3/32
leaf01# net add bgp router-id 10.0.0.3
leaf01# net add bgp ipv4 unicast network 10.0.0.3/32
leaf01# net add bgp neighbor swp51-52 interface remote-as external
leaf01# net add bgp ipv4 unicast neighbor swp51-52 activate
leaf01# net add clag peer sys-mac 44:38:39:FF:00:01 interface swp49-50 primary backup-ip 10.0.0.4
leaf01# net add vlan 100 ip address 10.0.1.250/24
leaf01# net add vlan 100 ip address-virtual 00:00:5E:00:01:01 10.0.1.254/24
leaf01# net add bgp ipv4 unicast network 10.0.1.0/24
leaf01# net add clag port bond bond-to-host-11 interface swp1 clag-id 1
leaf01# net add bond bond-to-host-11 bridge access 100
leaf01# net add bond bond-to-host-11 stp bpduguard
leaf01# net pending
leaf01# net commit

leaf02# net add bgp autonomous-system 65004
leaf02# net add loopback lo ip address 10.0.0.4/32
leaf02# net add bgp router-id 10.0.0.4
leaf02# net add bgp ipv4 unicast network 10.0.0.4/32
leaf02# net add bgp neighbor swp51-52 interface remote-as external
leaf02# net add bgp ipv4 unicast neighbor swp51-52 activate
leaf02# net add clag peer sys-mac 44:38:39:FF:00:01 interface swp49-50 secondary backup-ip 10.0.0.3
leaf02# net add vlan 100 ip address 10.0.1.251/24
leaf02# net add vlan 100 ip address-virtual 00:00:5E:00:01:01 10.0.1.254/24
leaf02# net add bgp ipv4 unicast network 10.0.1.0/24
leaf02# net add clag port bond bond-to-host-11 interface swp1 clag-id 1
leaf02# net add bond bond-to-host-11 bridge access 100
leaf02# net add bond bond-to-host-11 stp bpduguard
leaf02# net pending
leaf02# net commit


Verification
============
spine1# net show interface
spine1# net show bgp summary
spine1# net show route
leaf01# net show interface
leaf01# net show clag


