Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In addition to installing the requirements for running the Python code for CNaaS-NMS  you might also want a test environment so you can run integration tests for your newly developed code. For this you will need docker to run all the components of CNaaS, and a virtualization software to run some virtual switches. In this example we will use VirtualBox and Arista vEOS switches.

switch topologyImage Added

Create VMs

Download the VMDK for Arista vEOS (tested with vEOS-lab-4.22.3M.vmdk , possibly issues with early 4.23 releases?). Copy this file into three new VMDK files that we will use to create the actual VMs:

...

Then start VirtualBox and create three new VMs, using 2 GB memory each and choose to point them to an existing harddrive file (you will need to "add" the VMDK files you copied earlier to the "Virtual media manager" in VirtualBox). Choose Linux Fedora 64-bit as type and version.

After creating the new VMs, we need to configure the network adapters. Before we can do this go Go into the menu  File→Tools→Network Manager... in VirtualBox and create a new network called vboxnet1 for example, and enter IP 10.100.2.2 / 255.255.255.0 (no DHCP server). This will be used on NIC2 below. On Linux/MAC you need to allow this IP-range in by creating /etc/vbox/networks.conf and specifying allowed ranges there. For example, to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as 2001::/64 range put the following lines into /etc/vbox/networks.conf:

      * 10.0.0.0/8 192.168.0.0/16
      * 2001::/64

Then configure After creating the new VMs, we need to configure them with the following network adapters:

...

  • NIC1: NAT (Management1)
  • NIC2: Host-only adapter: cnaas vboxnet1 (Ethernet1)
  • NIC3: Internal network: link_d1a1 (Ethernet2)
  • NIC4: Internal network: link_d1d2 (Ethernet3)

...

  • NIC1: NAT (Management1)
  • NIC2: Host-only adapter: cnaas vboxnet1 (Ethernet1)
  • NIC3: Internal network: link_d2a1 (Ethernet2)
  • NIC4: Internal network: link_d1d2 (Ethernet3)

...

  • NIC1: NAT (Management1)
  • NIC2: Host-only adapter: cnaas vboxnet1 (Ethernet1)
  • NIC3: Internal network: link_d1a1 (Ethernet2)
  • NIC4: Internal network: link_d2a1 (Ethernet3)

...

hostname eosdist1
username admin privilege 15 role network-admin secret abc123abc123
vrf instance MGMT
interface Ethernet1
   no switchport
   vrf MGMT
   ip address 10.100.2.101/24
   no lldp transmit
   no lldp receive
interface Ethernet2
   description DOWNLINK
   switchport mode trunk
   channel-group 3 mode active
!
interface Port-Channel3
   description DOWNLINK
   switchport mode trunk
   port-channel lacp fallback individual
   port-channel lacp fallback timeout 3
!
interface Loopback1
   vrf MGMT
   ip address 10.100.3.101/32
!
interface Vlan1
   description ZTP DHCP
   vrf MGMT
   ip address 192.168.0.1/24
   ip helper-address 10.100.2.2
ip routing vrf MGMT
management api http-commands
   no shutdown
   !
   vrf MGMT
      no shutdown

...

Note: Don't forget to save configuration with write!

Mappings between VirtualBox and eosdist1 interfaces should be:

  • Adapter1/NIC1 in Virtualbox → should correspond to the interface called Management1 inside the VM.

...

  • Adapter2/NIC2(vboxnet1)Ethernet1 in the VM

...

  • .
  • Adapter3/NIC3 (link_d1a1) → Ethernet2 in the VM.
  • Adapter4/NIC4 (link_d1d2) → Ethernet3 in the VM.

Eosdist2 only needs a hostname of and so on.Eosdist2 only needs a hostname of "eosdist2" for the current tests to run, but you could also configure it in a similar way to eosdist1.

...

If the first command doesn't work something with the interface configuration might be wrong. If the second command doesn't work, it might be "ip route add" commands in the previous section is missing.

If you can not ping, the problem can be the firewall on your machine. The network is created by VirtualBox is on the host machine. The following commands show how to allow the communication for ping and ssh with nft:

sudo nft add rule inet filter input ip saddr { 10.100.2.101/24 } tcp dport 22 counter accept comment "allow-ssh-fr-vbox-eth"
sudo nft add rule inet filter input ip saddr { 10.100.2.101/24 } icmp type echo-request accept comment "allow-ping-fr-vbox-eth"

sudo nft add rule inet filter input ip saddr { 192.168.0.1/24 } tcp dport 22 counter accept comment "allow-ssh-fr-vbox-vl1"
sudo nft add rule inet filter input ip saddr { 192.168.0.1/24 } icmp type echo-request accept comment "allow-ping-fr-vbox-vl1"

Run integrationtests.sh

Git clone cnaas-nms and go to the directory test/ , there you will find a script called integrationtest.sh . This script will start the necessary docker containers and then begin running some tests for ZTP and so on. Before starting the docker containers we need to create a few volumes:

...