KNE Lab with BGP and traffic via Arista cEOSLab as a DUT
Overview
This lab demonstrates validation of Arista cEOSLab DUT for basic BGP peering, prefix announcements and passing of traffic between announced subnets. To run OTG protocols and flows, Keysight Elastic Network Generator Community Edition with Ixia-c test ports is used.
To run the lab, OpenConfig KNE is used on top of a KIND cluster – K8s environment running inside a single Docker container.
OTG test logic is executed using otgen
CLI client running in a dedicated K8s POD:
Lab configuration
Diagram
Layer 3 topology and generated traffic flows
OTG
The lab uses OTG configuration created by otgen
with the following properties:
Prerequisites
- Arista cEOSLab Docker image. You can register on Arista support website as a Guest to download the image
- Linux host or VM with sudo permissions. See possible deployment options here
build-essential
packagecurl
utilitygit
utility- Docker
Quick start
-
Clone this repository
-
To run all the steps necessary to prepare the KNE environment and start the lab, execute:
-
Validate the OTG API endpoint is available:
-
Run
otgen
to establish BGP session withr1
, announce routes and send traffic between them:kubectl exec -it otgen -- /bin/bash export OTG_API="https://service-https-keng-controller.keng-ceos.svc.cluster.local:8443" otgen create device -n otg1 -p p1 -l eth1 --ip 192.0.2.1 --prefix 30 --gw 192.0.2.2 | \ otgen add device -n otg2 -p p2 -l eth2 --ip 192.0.2.5 --prefix 30 --gw 192.0.2.6 | \ otgen add bgp -d otg1 --asn 1111 --route 198.51.100.0/24 | \ otgen add bgp -d otg2 --asn 2222 --route 203.0.113.0/24 | \ otgen add flow -n f-1-2 --tx otg1 --rx otg2 --src 198.51.100.1 --dst 203.0.113.1 --count 1000 --rate 100 --size 128 | \ otgen add flow -n f-2-1 --tx otg2 --rx otg1 --dst 198.51.100.1 --src 203.0.113.1 --count 2000 --rate 200 --size 256 | \ otgen --log info run -k -m flow | otgen transform -m flow | otgen display -m table exit
-
If you would like to monitor status of BGP sessions from
r1
perspective, launch a separate SSH session and run: -
To stop the
keng-ceos
lab, use -
To remove the KIND cluster with KNE, use
Virtual machine setup examples
Multipass VM
multipass launch 20.04 -n knevm -c8 -m16G -d64G
multipass shell knevm
sudo apt update && sudo apt upgrade -y
sudo apt install build-essential -y
sudo apt install docker.io curl git -y
sudo usermod -aG docker $USER
logout
Google Cloud Compute Instance
-
Deploy the instance
MYIP=`curl -s ifconfig.me` MYIPSTR="$(echo $MYIP | sed 's/\./-/g')" gcloud compute firewall-rules create otg-demo-allow-ssh-${MYIPSTR} --description="Allow tcp 22 ingress to any instance tagged as otg-demo-kne" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:22 --source-ranges="$MYIP/32" --target-tags=otg-demo-kne gcloud compute instances create otg-demo-kne \ --subnet=default \ --machine-type=e2-standard-16 \ --image-family=ubuntu-2004-lts \ --image-project=ubuntu-os-cloud \ --boot-disk-size=100GB \ --boot-disk-device-name=otg-demo-kne \ --tags=otg-demo-kne gcloud compute ssh otg-demo-kne sudo apt update && sudo apt upgrade -y sudo apt install build-essential docker.io -y sudo usermod -aG docker $USER logout
-
Terminate the instance