# 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
========
- A two tier Clos network with at least 3 spines
- host-11 is connected to leaf-11 via leaf-11 swp3
- host-21 is connected to leaf-21 via leaf-21 swp3
- host-11 and host-21 are in VLAN 100
- host-11 and host-21 need to communicate with each other via layer2


net commands
============
In order to avoid a single point of failure you should declare multiple switches
as LNV service nodes. Each spine will have a unique loopback IP and an anycast
loopback IP that is shared by all service nodes.  The VTEPs will point to this
anycast IP while the service nodes use their unique loopback IP to communicate
with one another.

In this example we declare spine-1, spine-2 and spine-3 as LNV service nodes

spine-1# net add lnv service-node source 10.0.0.1
spine-1# net add lnv service-node anycast-ip 10.9.9.9
spine-1# net add lnv service-node peers 10.0.0.1 10.0.0.2 10.0.0.3

spine-2# net add lnv service-node source 10.0.0.2
spine-2# net add lnv service-node anycast-ip 10.9.9.9
spine-2# net add lnv service-node peers 10.0.0.1 10.0.0.2 10.0.0.3

spine-3# net add lnv service-node source 10.0.0.3
spine-3# net add lnv service-node anycast-ip 10.9.9.9
spine-3# net add lnv service-node peers 10.0.0.1 10.0.0.2 10.0.0.3


Next we configure leaf-11 and leaf-21 as VTEPs and point them towards
the service nodes' 10.9.9.9 anycast IP

leaf-11# net add loopback lo ip address 10.0.0.11/32
leaf-11# net add loopback lo vxrd-src-ip 10.0.0.11
leaf-11# net add loopback lo vxrd-svcnode-ip 10.9.9.9

leaf-21# net add loopback lo ip address 10.0.0.21/32
leaf-21# net add loopback lo vxrd-src-ip 10.0.0.21
leaf-21# net add loopback lo vxrd-svcnode-ip 10.9.9.9


Finally we create a vxlan interface and place that interface in VLAN 100
We also place the host facing interface in VLAN 100

leaf-11# net add vxlan vxlan10100 vxlan local-tunnelip 10.0.0.11
leaf-11# net add vxlan vxlan10100 bridge access 100
leaf-11# net add interface swp3 bridge access 100

leaf-21# net add vxlan vxlan10100 vxlan local-tunnelip 10.0.0.21
leaf-21# net add vxlan vxlan10100 bridge access 100
leaf-21# net add interface swp3 bridge access 100


Verification
============
net show lnv
