User Tools

Site Tools


virtualization:netsim

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:netsim [2022/09/25 17:15] jotasandokuvirtualization:netsim [2025/01/26 17:52] (current) jotasandoku
Line 6: Line 6:
     * Data_models-todo     * Data_models-todo
     * templates_location-todo     * templates_location-todo
 +The application is installed in ''/usr/local/lib/python3.10/dist-packages/netsim''. There you can find files like ''/defaults/addressing.yml'' where we can customize ips or change them to ipv6
  
 ---- ----
Line 19: Line 19:
   #!/bin/bash   #!/bin/bash
   apt remove needrestart -y    apt remove needrestart -y 
 +  sudo add-apt-repository universe
   apt-get update -y    apt-get update -y 
   apt install python3-pip -y    apt install python3-pip -y 
   python3 -m pip install netsim-tools   python3 -m pip install netsim-tools
 +  ! (consider) python3 -m  pip3 install --upgrade pyopenssl cryptography
   !   !
   ! APPLY THIS MANUALLY   ! APPLY THIS MANUALLY
Line 46: Line 48:
   netlab down   netlab down
  
-! here I come back to work on the lab+Here I come back to work on the lab
   vagrant up   vagrant up
   netlab initial   netlab initial
Line 55: Line 57:
   netlab down   netlab down
  
 +Containerlab saves automatically the nodes configuration. If we want versioning control on out lab we can push the content to github. Nowever this uses quite a lot of space. We can prevent git to push the nodes configuration with the ''.gitignore'' below. If we need to share the devices configuration, use the command with ''tarball'' also below to save/share configs: 
 +  cat .gitignore 
 +  **/archive/ 
 +  **/schedule/ 
 +  **/flash/ 
 +  **/.vagrant/ 
 +  vault.key 
 +  .Python 
 +  [Bb]in 
 +  [Ii]nclude 
 +  [Ll]ib 
 +  [Ll]ib64 
 +  [Ll]ocal 
 +  [Ss]cripts 
 +  pyvenv.cfg 
 +  .venv 
 +  .env 
 +  pip-selfcheck.json 
 +  ! This to save all the containerlab configs at once: 
 +  netlab clab tarball
 ---- ----
  
Line 64: Line 85:
   cat /var/lib/libvirt/dnsmasq/virbr0.*     cat /var/lib/libvirt/dnsmasq/virbr0.*  
   vim /etc/libvirt/qemu/networks/vagrant-libvirt.xml     vim /etc/libvirt/qemu/networks/vagrant-libvirt.xml  
- 
----- 
- 
-https://blog.ipspace.net/2021/04/katacoda-netsim-containerlab-frr.html 
  
 ---- ----
Line 99: Line 116:
   vagrant box add nexus9300v.9.3.5.box --name cisco/nexus9300v   vagrant box add nexus9300v.9.3.5.box --name cisco/nexus9300v
   vagrant mutate cisco/nexus9300v libvirt   vagrant mutate cisco/nexus9300v libvirt
 +
 +
 +----
 +FOLDERS AND DEV ADVICES:
 +\\
 +See: [[https://netlab.tools/dev/module-attributes/]]
 +  * configuration templates snippets: 
 +    * ..netsim/ansible/templates/{module}/{vendor}.j2
 +      * example: ..netsim/ansible/templates/evpn/eos.j2
 +  * Module attributes for an individual module are stored (together with other module-specific data) in netsim/modules/<modname>.yml file.
 +
 +
 +
 +  # Default loopback, LAN, and P2P prefixes
 +  loopback:
 +    ipv6: 2001:db8:0::/48
 +  router_id:
 +    ipv4: 10.0.0.0/24
 +    prefix: 32
 +  lan:
 +    ipv6: 2001:db8:3e8::/48
 +  p2p:
 +    ipv6: 2001:db8:3e9::/48
 +  mgmt:
 +    ipv4: 192.168.121.0/24
 +    start: 100
 +    mac: 08-4F-A9-00-00-00
 +  l2only:
 +  vrf_loopback:
 +    ipv6: 2001:db8:3ea::/48
 +    
 +TCPDUMP IN NETLAB:
 +[[https://netlab.tools/netlab/capture/]]
 +  netlab up -p libvirt:p2p_bridge    # otherwise impossible to capture in lobvirt p2p links
 +  netlab capture r1 GigabitEthernet0/3 icmp -l
 +  netlab capture r1 GigabitEthernet0/3 -U -s0 -w - | sudo wireshark -k -i -
  
virtualization/netsim.1664126133.txt.gz · Last modified: (external edit)