AOS-CX Switch Simulator

 View Only
last person joined: yesterday 

AOS-CX with Infra as a Code tools

This thread has been viewed 25 times
  • 1.  AOS-CX with Infra as a Code tools

    Posted Aug 29, 2023 04:45 AM

    We all know AOS-CX can successfully be used with GNS3, EVE-NG, or directly on top of VMWare ESXi or KVM.

    But, if you want to run it in a "Infrastructure-as-a-Code" fashion, now it is officially supported on Containerlab (https://containerlab.dev/), from release 0.44 (https://containerlab.dev/rn/0.44/)!.

    You just need to create your AOS-CX container with vrnetlab (https://containerlab.dev/manual/kinds/vr-aoscx/), and then you can create complex networking topologies simply writing a yaml file.

    Have a look at this example:

    name: mclag

    topology:

      nodes:

        coresw1:

          kind: vr-aoscx

          image: vrnetlab/vr-aoscx:20230531220439

          startup-config: coresw1.cfg

        coresw2:

          kind: vr-aoscx

          image: vrnetlab/vr-aoscx:20230531220439

          startup-config: coresw2.cfg

        access1:

          kind: vr-aoscx

          image: vrnetlab/vr-aoscx:20230531220439

          startup-config: access1.cfg

        access2:

          kind: vr-aoscx

          image: vrnetlab/vr-aoscx:20230531220439

          startup-config: access2.cfg

        host1:

          kind: linux

          image: alpine:latest

        host2:

          kind: linux

          image: alpine:latest

      links:

    # ISL on port 9

      - endpoints: ["coresw1:eth9", "coresw2:eth9"]

    # MCLAG between access1 and coresw{1,2}

      - endpoints: ["access1:eth1", "coresw1:eth1"]

      - endpoints: ["access1:eth2", "coresw2:eth1"]

    # MCLAG between access2 and coresw{1,2}

      - endpoints: ["access2:eth1", "coresw1:eth2"]

      - endpoints: ["access2:eth2", "coresw2:eth2"]

    # Link access1 (port 5) - host1

      - endpoints: ["access1:eth5", "host1:eth1"]

    # Link access2 (port 5) - host2

      - endpoints: ["access2:eth5", "host2:eth1"]

    Nice, isn't it? 😉

    Do you want more? Are you tired of manually configuring point-to-point interfaces and addressing, and creating OSPF or BGP configuration from scratch every time you run a lab?

    AOS-CX is officially supported also by netlab (https://netlab.tools/), "the swiss knife for network simulations".

    Netlab will help you be more proficient once you decide to drop GUI-based virtual networking labs and build your labs using CLI and infrastructure-as-code principles; it is a "wrapper on steroids" for containerlab (or vagrant/libvirt), which "under the hood" creates a clab (or vagrant) config file, start the lab, and configure your nodes using Ansible.

    As an example, if you have the following netlab topology file:

    module: [ bgp ]

    nodes:

      a:

        device: arubacx

        bgp.as: 65001

      b:

        device: arubacx

        bgp.as: 65002

      y:

        device: arubacx

        bgp.as: 65003

      linux:

        device: linux

        module: []

    links: [ a-b, b-y, y-linux ]

    and you start netlab, after some minutes you will have an infrastructure running 3 AOS-CX nodes, with P-t-P connectivity, and BGP peering configured.

    Easy!

    And of course you can extend netlab to load your additional ansible/jinja configuration templates, or take this as a starting point to apply your preferred configuration.

    I hope all this can be useful for you how much it was for me 😉