Add Leafs to Data Center
Final Deployment
  • Introduction
  • NaC Introduction
  • Manual Validation
  • CXTM Introduction
  • CXTM Projects
  • CXTM Test Cases
  • CXTM Test Automation
  • CXTM Git Integration
  • CXTM Batches
  • CXTM Notifications
  • Final Deployment
  • CXTM Reporting
  • CXTM References
  • Bonus Content

Add Leafs to Data Center

In this section, you will expand your Nexus fabric by adding Leaf-3 (L3) and Leaf-4 (L4) switches to the data center topology. This represents a typical Day 2 operational change where you scale your network infrastructure to accommodate growth, increase capacity, or enhance redundancy based on evolving business requirements.

Step 1 - Update Deployment Inventory File

First, you need to update the inventory.nac.yaml file to include the L3 and L4 switches.

  1. Select the data/inventory.nac.yaml file from the file explorer on the left side menu to open and edit it.

  2. Add the L3 and L4 devices to the inventory file. Your complete inventory should look like this:

  3. 
    ---
    nxos:
      devices:
        - name: S1
          url: https://10.15.107.21
        - name: S2
          url: https://10.15.107.22
        - name: L1
          url: https://10.15.107.23
        - name: L2
          url: https://10.15.107.24
        - name: L3
          url: https://10.15.107.25
        - name: L4
          url: https://10.15.107.26
    
            

    📋 Alternative: You can also copy and paste the entire inventory configuration below to replace the complete content of the data/inventory.nac.yaml file, then proceed to step 3 to save.

    ---
    nxos:
      devices:
        - name: S1
          url: https://10.15.107.21
        - name: S2
          url: https://10.15.107.22
        - name: L1
          url: https://10.15.107.23
        - name: L2
          url: https://10.15.107.24
        - name: L3
          url: https://10.15.107.25
        - name: L4
          url: https://10.15.107.26
    
        

  4. Press Ctrl + s to save the inventory.nac.yaml file.

    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Step 2 - Update S1 (Spine-1)

Before adding the new leaf switches, you need to update the Spine switch configurations to include interfaces and BGP neighbors for the L3 and L4 connections.

  1. Select the data/S1.nac.yaml file from the file explorer to open it.

  2. Add the following ethernet interfaces connections towards L3 and L4 switches.

  3. 
    
                - id: 1/3
                  description: "connected to L3 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.1/30
                - id: 1/13
                  description: "connected to L3 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.5/30
                - id: 1/4
                  description: "connected to L4 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.1/30
                - id: 1/14
                  description: "connected to L4 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.5/30
    
            

  4. Add the following BGP neighbor configurations towards L3 and L4 switches

  5. 
    
                      - ip: 10.1.13.2
                        remote_as: "65013"
                        description: "L3-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/3"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.13.6
                        remote_as: "65013"
                        description: "L3-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/13"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.14.2
                        remote_as: "65014"
                        description: "L4-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/4"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.14.6
                        remote_as: "65014"
                        description: "L4-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/14"
                        address_families:
                          - address_family: ipv4-unicast
    
            

    📋 Alternative: You can also copy and paste the entire S1 configuration below to replace the complete content of the data/S1.nac.yaml file, then proceed to step 4 to save.

    
    
    ---
    nxos:
      devices:
        - name: S1
          url: https://10.15.107.21
          configuration:
            system:
              hostname: S1
            feature:
              bgp: true
              lldp: true
              udld: true
            ip_prefix_lists:
              - name: REDISTRIBUTE_PREFIXES
                entries:
                  - seq: 10
                    action: permit
                    prefix: 10.0.0.1/32
                    criteria: exact
            route_maps:
              - name: fabric-rmap-redist-subnet
                entries:
                  - order: 10
                    action: permit
                    match_ip_prefix_list: REDISTRIBUTE_PREFIXES
            interfaces:
              loopbacks:
                - id: 0
                  ip:
                    address: 10.0.0.1/32
              ethernets:
                - id: "1/1"
                  description: "connected to L1 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.11.1/30
                - id: "1/11"
                  description: "connected to L1 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.11.5/30
                - id: "1/2"
                  description: "connected to L2 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.12.1/30
                - id: "1/12"
                  description: "connected to L2 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.12.5/30
                - id: 1/3
                  description: "connected to L3 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.1/30
                - id: 1/13
                  description: "connected to L3 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.5/30
                - id: 1/4
                  description: "connected to L4 Ethernet1/29"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.1/30
                - id: 1/14
                  description: "connected to L4 Ethernet1/30"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.5/30
            routing:
              bgp:
                asn: "65535"
                vrfs:
                  - vrf: default
                    router_id: 10.0.0.1
                    address_families:
                      - address_family: ipv4-unicast
                        maximum_paths: 4
                        redistributions:
                          - protocol: direct
                            protocol_instance: "none"
                            route_map: fabric-rmap-redist-subnet
                    neighbors:
                      - ip: 10.1.11.2
                        remote_as: "65011"
                        description: "L1-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/1"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.11.6
                        remote_as: "65011"
                        description: "L1-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/11"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.12.2
                        remote_as: "65012"
                        description: "L2-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/2"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.12.6
                        remote_as: "65012"
                        description: "L2-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/12"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.13.2
                        remote_as: "65013"
                        description: "L3-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/3"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.13.6
                        remote_as: "65013"
                        description: "L3-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/13"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.14.2
                        remote_as: "65014"
                        description: "L4-Eth1/29"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/4"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.14.6
                        remote_as: "65014"
                        description: "L4-Eth1/30"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/14"
                        address_families:
                          - address_family: ipv4-unicast
    
        

  6. Press Ctrl + s to save the S1.nac.yaml file.

    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Update S2 (Spine-2) Configuration

  1. Select the data/S2.nac.yaml file from the file explorer to open it.

  2. Add the following ethernet interfaces for L3 and L4 connections after the existing L2 interfaces in the ethernets section:

  3. 
    
                - id: 1/3
                  description: "connected to L3 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.1/30
                - id: 1/13
                  description: "connected to L3 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.5/30
                - id: 1/4
                  description: "connected to L4 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.1/30
                - id: 1/14
                  description: "connected to L4 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.5/30
    
            

  4. Add the following BGP neighbors for L3 and L4 after the existing L2 neighbors in the neighbors section:

  5. 
    
                      - ip: 10.1.23.2
                        remote_as: "65013"
                        description: "L3-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/3"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.23.6
                        remote_as: "65013"
                        description: "L3-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/13"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.2
                        remote_as: "65014"
                        description: "L4-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/4"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.6
                        remote_as: "65014"
                        description: "L4-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/14"
                        address_families:
                          - address_family: ipv4-unicast
    
            

    📋 Alternative: You can also copy and paste the entire S2 configuration below to replace the complete content of the data/S2.nac.yaml file, then proceed to step 4 to save.

    
    
    ---
    nxos:
      devices:
        - name: S2
          url: https://10.15.107.22
          configuration:
            system:
              hostname: S2
            feature:
              bgp: true
              lldp: true
              udld: true
            ip_prefix_lists:
              - name: REDISTRIBUTE_PREFIXES
                entries:
                  - seq: 10
                    action: permit
                    prefix: 10.0.0.2/32
                    criteria: exact
            route_maps:
              - name: fabric-rmap-redist-subnet
                entries:
                  - order: 10
                    action: permit
                    match_ip_prefix_list: REDISTRIBUTE_PREFIXES
            interfaces:
              loopbacks:
                - id: 0
                  ip:
                    address: 10.0.0.2/32
              ethernets:
                - id: "1/1"
                  description: "connected to L1 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.21.1/30
                - id: "1/11"
                  description: "connected to L1 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.21.5/30
                - id: "1/2"
                  description: "connected to L2 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.22.1/30
                - id: "1/12"
                  description: "connected to L2 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.22.5/30
                - id: 1/3
                  description: "connected to L3 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.1/30
                - id: 1/13
                  description: "connected to L3 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.5/30
                - id: 1/4
                  description: "connected to L4 Ethernet1/31"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.1/30
                - id: 1/14
                  description: "connected to L4 Ethernet1/32"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.5/30
            routing:
              bgp:
                asn: "65535"
                vrfs:
                  - vrf: default
                    router_id: 10.0.0.2
                    address_families:
                      - address_family: ipv4-unicast
                        maximum_paths: 4
                        redistributions:
                          - protocol: direct
                            protocol_instance: "none"
                            route_map: fabric-rmap-redist-subnet
                    neighbors:
                      - ip: 10.1.21.2
                        remote_as: "65011"
                        description: "L1-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/1"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.21.6
                        remote_as: "65011"
                        description: "L1-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/11"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.22.2
                        remote_as: "65012"
                        description: "L2-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/2"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.22.6
                        remote_as: "65012"
                        description: "L2-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/12"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.23.2
                        remote_as: "65013"
                        description: "L3-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/3"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.23.6
                        remote_as: "65013"
                        description: "L3-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/13"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.2
                        remote_as: "65014"
                        description: "L4-Eth1/31"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/4"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.6
                        remote_as: "65014"
                        description: "L4-Eth1/32"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/14"
                        address_families:
                          - address_family: ipv4-unicast
    
        

  6. Press Ctrl + s to save the S2.nac.yaml file.

    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Step 3 - Create L3 (Leaf-3) Switch Configuration File

Create the configuration file L3.nac.yaml for Leaf-3 switch (L3) in the data directory. This YAML file defines the complete configuration for the Leaf-3 switch including system settings, VLANs, interfaces, and BGP routing.

  1. Copy and paste the below command in the VS Code Server terminal window to create the L3.nac.yaml file in the data directory.

  2. 
    code-server -r data/L3.nac.yaml
    
            

  3. Copy the following code into your newly created L3.nac.yaml file.

  4. 
    
    ---
    nxos:
      devices:
        - name: L3
          url: https://10.15.107.25
          configuration:
            system:
              hostname: L3
            feature:
              bgp: true
              interface_vlan: true
              lldp: true
              udld: true
            vlan:
              vlans:
                - id: 103
                  name: VLAN103
            ip_prefix_lists:
              - name: REDISTRIBUTE_PREFIXES
                entries:
                  - seq: 10
                    action: permit
                    prefix: 10.0.3.3/32
                    criteria: exact
                  - seq: 20
                    action: permit
                    prefix: 10.254.103.0/24
                    criteria: exact
            route_maps:
              - name: fabric-rmap-redist-subnet
                entries:
                  - order: 10
                    action: permit
                    match_ip_prefix_list: REDISTRIBUTE_PREFIXES
            interfaces:
              loopbacks:
                - id: 0
                  ip:
                    address: 10.0.3.3/32
              vlans:
                - id: 103
                  description: "SVI for VLAN 103"
                  ip:
                    address: 10.254.103.1/24
              ethernets:
                - id: "1/1"
                  description: "host3-ens2"
                  switchport:
                    mode: access
                    access_vlan: 103
                - id: "1/2"
                  description: "host4-ens2"
                  switchport:
                    mode: access
                    access_vlan: 103
                - id: "1/29"
                  description: "connected to S1 Ethernet1/3"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.2/30
                - id: "1/30"
                  description: "connected to S1 Ethernet1/13"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.13.6/30
                - id: "1/31"
                  description: "connected to S2 Ethernet1/3"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.2/30
                - id: "1/32"
                  description: "connected to S2 Ethernet1/13"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.23.6/30
            routing:
              bgp:
                asn: "65013"
                vrfs:
                  - vrf: default
                    router_id: 10.0.3.3
                    address_families:
                      - address_family: ipv4-unicast
                        maximum_paths: 4
                        redistributions:
                          - protocol: direct
                            protocol_instance: "none"
                            route_map: fabric-rmap-redist-subnet
                    neighbors:
                      - ip: 10.1.13.1
                        remote_as: "65535"
                        description: "S1-Eth1/3"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/29"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.13.5
                        remote_as: "65535"
                        description: "S1-Eth1/13"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/30"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.23.1
                        remote_as: "65535"
                        description: "S2-Eth1/3"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/31"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.23.5
                        remote_as: "65535"
                        description: "S2-Eth1/13"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/32"
                        address_families:
                          - address_family: ipv4-unicast
    
            

  5. Press Ctrl + s to save the L3.nac.yaml file.

    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Step 4 - Create L4 (Leaf-4) Switch Configuration File

Create the configuration file L4.nac.yaml for Leaf-4 switch (L4) in the data directory. This YAML file defines the complete configuration for the Leaf-4 switch including system settings, VLANs, interfaces, and BGP routing.

  1. Copy and paste the below command in the VS Code Server terminal window to create the L4.nac.yaml file in the data directory.

  2. 
    code-server -r data/L4.nac.yaml
    
            

  3. Copy the following code into your newly created L4.nac.yaml file.

  4. 
    
    ---
    nxos:
      devices:
        - name: L4
          url: https://10.15.107.26
          configuration:
            system:
              hostname: L4
            feature:
              bgp: true
              interface_vlan: true
              lldp: true
              udld: true
            vlan:
              vlans:
                - id: 104
                  name: VLAN104
            ip_prefix_lists:
              - name: REDISTRIBUTE_PREFIXES
                entries:
                  - seq: 10
                    action: permit
                    prefix: 10.0.4.4/32
                    criteria: exact
                  - seq: 20
                    action: permit
                    prefix: 10.254.104.0/24
                    criteria: exact
            route_maps:
              - name: fabric-rmap-redist-subnet
                entries:
                  - order: 10
                    action: permit
                    match_ip_prefix_list: REDISTRIBUTE_PREFIXES
            interfaces:
              loopbacks:
                - id: 0
                  ip:
                    address: 10.0.4.4/32
              vlans:
                - id: 104
                  description: "SVI for VLAN 104"
                  ip:
                    address: 10.254.104.1/24
              ethernets:
                - id: "1/1"
                  description: "host3-ens3"
                  switchport:
                    mode: access
                    access_vlan: 104
                - id: "1/2"
                  description: "host4-ens3"
                  switchport:
                    mode: access
                    access_vlan: 104
                - id: "1/29"
                  description: "connected to S1 Ethernet1/4"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.2/30
                - id: "1/30"
                  description: "connected to S1 Ethernet1/14"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.14.6/30
                - id: "1/31"
                  description: "connected to S2 Ethernet1/4"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.2/30
                - id: "1/32"
                  description: "connected to S2 Ethernet1/14"
                  switchport:
                    enabled: false
                  ip:
                    address: 10.1.24.6/30
            routing:
              bgp:
                asn: "65014"
                vrfs:
                  - vrf: default
                    router_id: 10.0.4.4
                    address_families:
                      - address_family: ipv4-unicast
                        maximum_paths: 4
                        redistributions:
                          - protocol: direct
                            protocol_instance: "none"
                            route_map: fabric-rmap-redist-subnet
                    neighbors:
                      - ip: 10.1.14.1
                        remote_as: "65535"
                        description: "S1-Eth1/4"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/29"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.14.5
                        remote_as: "65535"
                        description: "S1-Eth1/14"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/30"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.1
                        remote_as: "65535"
                        description: "S2-Eth1/4"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/31"
                        address_families:
                          - address_family: ipv4-unicast
                      - ip: 10.1.24.5
                        remote_as: "65535"
                        description: "S2-Eth1/14"
                        update_source_interface_type: ethernet
                        update_source_interface_id: "1/32"
                        address_families:
                          - address_family: ipv4-unicast
    
            

  5. Press Ctrl + s to save the L4.nac.yaml file.

    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Continue to the next section to execute the complete GitLab CI/CD pipeline with all stages.