This is an old revision of the document!
RUN NETLAB INSTANCE IN OCI CLOUD
mkdir images scp cEOS-lab-4.28.1F.tar.xz ubuntu@x.x.x.x:/home/ubuntu/images/cEOS-lab-4.28.1F.tar.xz sudo docker import ../images/cEOS-lab-4.28.1F.tar.xz ceos:4.28.1F sudo docker image ls # verify the image is there and the TAG is correct alias c='netlab connect'
create a simple topology file.
This is an example but be sure the ceos version corresponds to the one we imported. In our case ceos:4.28.1F
LIFECYCLE NETLAB PROJECT - CONTAINERLAB
! FIRST USE:
netlab create ./topology.yml sudo containerlab deploy -t clab.yml netlab initial # Important 1st time so netlab applues all configurations. ! work on the lab, saving all work with 'wr mem' netlab collect sudo containerlab destroy -t clab.yml
! SUBSEQUENT USES:
sudo containerlab deploy -t clab.yml ansible-playbook -i hosts.yml pusheos.yml # work on the lab netlab collect sudo containerlab destroy -t clab.yml
To run containerlab in its simplest way, we just define the topology file (clab.yml) and the we start it with:
containerlab deploy --topo clab.yml
docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} {{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' | sed 's#^/##'; # This just to show/remember the mgmt IPs
With docker run -it I connect to the container itself
ssh admin@the-ip , you connect to vEOS
containerlab destroy --topo evpn-multivendor.yml
For the topology file syntax we resource to the lab-examples
Create lab for containerized Arista EOS (ceos):
! FIRST, WE INSTALL ALL REQUIRED COMPONENTS
! all under root
! Download the ceos image
sudo apt install python3-pip -y
sudo python3 -m pip install netsim-tools
! install docker engine
sudo docker import cEOS-lab-4.27.0F.tar ceos:4.27.0F
netlab install ubuntu ansible containerlab
# bash -c "$(curl -sL https://get-clab.srlinux.dev)" # this installs containerlab
# export PATH="netsim-tools:$PATH"
# source <(containerlab completion bash)
!
! HERE TO CREATE OUR SPECIFIC LAB (we defined in our new topology file)
netlab create ./topology.yml # topology to have " defaults.devices.eos.clab.image: ceos:4.27.0F "
containerlab deploy -t clab.yml
netlab initial
!
netlab connect dis01
! we modify the lab here. Then we save it as below. Contents in 'config' folder (.cfg files)
netlab collect
netlab down
!
! TO GO BACK TO THE LAB WE HAVE BEEN WORKING ON. Basically creates the cEOS instances again and pushes the configuration you saved before via ansible
containerlab deploy -t clab.yml
sed -i 's/interface Management1/interface Management0/g' config/* # solves issues with config push between vEOS > cEOS
netlab initial
ansible-playbook -i hosts.yml pusheos.yml
!
! pusheos.yml is a simple ansible playbook to push the configurations:
---
- hosts: eos
gather_facts: True
tasks:
- name: load configuration from files
eos_config:
src: config/{{inventory_hostname}}.cfg
!! END
Create lab for FRR:
! all under root sudo apt install python3-pip -y sudo python3 -m pip install netsim-tools ! install docker engine netlab install ubuntu ansible bash -c "$(curl -sL https://get-clab.srlinux.dev)" export PATH="netsim-tools:$PATH" source <(containerlab completion bash) ! Add the topology file with provider: clab and device: frr netlab create ./topology.yml containerlab deploy -t clab.yml ! If issues starting, do this https://jtechclass.com/containerlab-the-future-of-your-virtual-network-lab-part-2/ netlab initial netlab connect dis01 netlab down
Create lab for Aristas EOS (vr-veos (vm in container)):
git clone https://github.com/hellt/vrnetlab && cd vrnetlab
git checkout v0.2.3
cat README.md
!
netlab create ./topology.yml
! change
kind: vr-veos
image: vrnetlab/vr-veos:4.27.0F
!
containerlab deploy -t clab.yml
docker logs -f clab-netsim-project-d-dis51 ! to follow the booting
* [[https://containerlab.srlinux.dev/manual/kinds/vr-veos/]]
TCPDUMP IN CONTAINERLAB:
netlab capture rtr eth1 icmp -l / netlab capture rtr eth1 -U -s0 -w - | sudo wireshark -k -i -sudo containerlab inspect –all # find the name (cname)
docker exec clab-simple_ipv4-rtr ip a | grep '^[^[:space:]] # finds the interfaces for the cname clab-simple.. ssh $containerlab_host_address "ip netns exec $lab_node_name tcpdump -nni $if_name" # Enable non-sudo users to capture: https://askubuntu.com/questions/348712/there-are-no-interfaces-on-which-a-capture-can-be-done ssh ubuntu@143.47.236.251 "sudo ip netns exec clab-vxlan1-s1 tcpdump -U -nni et1 -w -" | wireshark -k -i -
SAVE WORK AND COME BACK # from your lab folder
netlab collect -o saved # important, folder is not called 'saved' otherwise overwritten netlab down --cleanup
netlab up netlab config saved