User Tools

Site Tools


virtualization:containerlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
virtualization:containerlab [2023/02/28 12:11] jotasandokuvirtualization:containerlab [2025/09/04 21:48] (current) jotasandoku
Line 19: Line 19:
 create a simple topology file.\\  create a simple topology file.\\ 
 [[https://github.com/jotasantos/netsim-labs/blob/master/netsim-ceos-flowpec_a/topology.yml|This]] is an example but **be sure the ceos version corresponds to the one we imported**. In our case ceos:4.28.1F [[https://github.com/jotasantos/netsim-labs/blob/master/netsim-ceos-flowpec_a/topology.yml|This]] is an example but **be sure the ceos version corresponds to the one we imported**. In our case ceos:4.28.1F
- 
-  netlab up 
-  sudo 
-  sudo containerlab destroy -t clab.yml 
-  netlab up    # and configuration will be persistent 
  
  
 +----
  
 **__LIFECYCLE NETLAB PROJECT - CONTAINERLAB__** **__LIFECYCLE NETLAB PROJECT - CONTAINERLAB__**
 \\ \\
-First use+FIRST USE:
   netlab create ./topology.yml   netlab create ./topology.yml
-  containerlab deploy -t clab.yml +  sudo containerlab deploy -t clab.yml 
-  netlab initial+  netlab initial     # Important 1st time so netlab applues all configurations.
   ! work on the lab, saving all work with 'wr mem'   ! work on the lab, saving all work with 'wr mem'
-  containerlab destroy -t clab.yml+  netlab collect 
 +  sudo containerlab destroy -t clab.yml
  
-here I come back to work on the lab +**SUBSEQUENT USES:** 
-  containerlab deploy -t clab.yml +  sudo containerlab deploy -t clab.yml 
-  work on the lab, saving all work with 'wr mem' +  ansible-playbook -i hosts.yml pusheos.yml 
-  containerlab destroy -t clab.yml+  # work on the lab 
 +  netlab collect  
 +  sudo containerlab destroy -t clab.yml
  
  
Line 139: Line 138:
  
 ---- ----
 +TCPDUMP IN CONTAINERLAB:
 +\\
 +
 +  * Official guide: [[https://containerlab.dev/manual/wireshark/]]
 +  * netlab wrapper: ''netlab capture rtr eth1 icmp -l'' / ''netlab capture rtr eth1 -U -s0 -w - | sudo wireshark -k -i -''
 +    * more info : [[https://netlab.tools/netlab/capture/]]
 +  * We run tcpdump over the cname of the container in question:
 +  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
 +
 +
 +----
 +** INSPECT LAB WITH NETLAB **
 +  netlab report addressing
 +  netlab report wiring
 +  netlab show reports
 +
  
  
virtualization/containerlab.1677586296.txt.gz · Last modified: (external edit)