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

  +------------+
  |  AS 65100  |
  |            |
  |  spine-01  |
  +------------+
        | swp1
        |
        |
        | swp2
  +------------+
  |  AS 65200  |
  |            |
  |  leaf-01   |
  +------------+

spine-01's loopback IPs are:
- 10.0.0.1/32
- 2001:1:1:1::1/128

leaf-01's loopback IPs:
- 10.0.0.2/32
- 2001:1:1:1::2/128

We want to configure spine-01 and leaf-01 to be "unnumbered" BGP peers and to
advertise the subnets for their loopback IPs. An "unnumbered" BGP peer actually
peers to the IPv6 link-local address but it is unnumbered in the sense that we
do not have to configure an IP address on the interface. To configure BGP for
unnumbered peering on an interface use:

    net add bgp neighbor <interface> interface remote-as (internal|external)

We must now specify which address-families our peer is "active" for. The
ipv4 unicast address-family is active by default but to advertise
routes for other address-families they must be "activated" per peer:

    net add bgp ipv6 unicast neighbor <interface> activate

Last but not least we want to tell BGP to advertise our loopback subnets. Use
the 'network' command to configure BGP to originate a prefix into the BGP table:

    net add bgp network <ipv4/prefixlen>
    net add bgp ipv6 unicast network <ipv6/prefixlen>

net commands
============
spine-01# net add bgp autonomous-system 65100
spine-01# net add bgp router-id 10.0.0.1
spine-01# net add bgp neighbor swp1 interface remote-as external
spine-01# net add bgp ipv6 unicast neighbor swp1 activate
spine-01# net add bgp ipv6 unicast network 2001:1:1:1::1/128
spine-01# net add bgp network 10.0.0.1/32
spine-01# net pending
spine-01# net commit

leaf-01# net add bgp autonomous-system 65200
leaf-01# net add bgp router-id 10.0.0.2
leaf-01# net add bgp neighbor swp2 interface remote-as external
leaf-01# net add bgp ipv6 unicast neighbor swp2 activate
leaf-01# net add bgp ipv6 unicast network 2001:1:1:1::2/128
leaf-01# net add bgp network 10.0.0.2/32
leaf-01# net pending
leaf-01# net commit


Verification
============
spine-01# net show bgp summary
