### FortiOS Initial Device Configuration Example Source: https://netlab.tools/labs/fortios Example of an initial configuration for FortiOS devices, including admin user setup, interface configuration, and DNS settings. This configuration is applied during the initial boot process. ```fortios Creating initial configuration for FortiGate 6.x/7.0/7.4/7.6 ============================================================ Initial configuration for the FortiGate device is prepared in a bootstrap CD-ROM image. Once the device boots and the configuration is applied: * Log in with username 'admin' and password 'admin' * Check the applied configuration with "diagnose debug cloudinit show" * Optionally, add any other configuration you might want to have burned into the vagrant box * Execute "execute shutdown". * Disconnect from console if needed (ctrl-] usually works). If you don't like our initial configuration and would like to start with a pristine one: 1. Execute "virsh change-media vm_box sda --eject" in another shell 2. Run "execute factoryreset" on the console 3. Log in with username 'admin' and empty password 4. Set the new 'admin' password to 'admin' 5. Apply your initial configuration In the past, the following initial configuration was recommended ==================================================== config system admin edit "vagrant" set accprofile "super_admin" set ssh-public-key1 "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" set password ENC SH28SLSP20eURl8us/aceUFwjdJOggVKBfSQSP8eZi2dyoNferE+lgfmTIitbE= next end config system interface edit "port1" set vdom "root" set mode dhcp set allowaccess ping https ssh http fgfm next end config system dns set primary 1.1.1.1 end ==================================================== ``` -------------------------------- ### Example topology.yml file Source: https://netlab.tools/_sources/install/linux.md.txt A sample topology configuration file for testing the netlab installation. ```yaml --- defaults: device: frr module: [ ospf ] nodes: [ s1, s2, s3 ] links: [ s1-s2, s2-s3, s1-s2-s3 ] ``` -------------------------------- ### Install Custom Linux Software Source: https://netlab.tools/_sources/example/linux.md.txt After a lab is started, log into a Linux host and use package managers like apt-get to install custom software. This example installs rsyslog. ```bash # apt-get update # apt-get install rsyslog ``` -------------------------------- ### List available installation scripts Source: https://netlab.tools/_sources/netlab/install.md.txt View the list of available installation scripts and their descriptions. ```text $ netlab install ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Script ┃ Installs ┃ ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ ubuntu │ Mandatory and nice-to have Debian/Ubuntu packages │ │ libvirt │ QEMU, KVM, libvirt, and Vagrant │ │ containerlab │ Docker and containerlab │ │ ansible │ Ansible and prerequisite Python libraries │ │ grpc │ GRPC libraries and Nokia GRPC Ansible collection │ │ graph │ GraphViz and D2 software │ └──────────────┴───────────────────────────────────────────────────┘ ``` -------------------------------- ### Configure Batch VM Startup Source: https://netlab.tools/_sources/labs/libvirt.md.txt Set `defaults.providers.libvirt.batch_size` and `defaults.providers.libvirt.batch_interval` to control the number of virtual machines started in parallel and the interval between batches. This example sets a batch size of 2 and an interval of 10 seconds. ```yaml provider: libvirt defaults.device: cumulus defaults.providers.libvirt.batch_size: 2 defaults.providers.libvirt.batch_interval: 10 nodes: [ a,b,c,x,z ] module: [ ospf ] links: [ a-x, a-z, b-x, b-z, c-x, c-z ] ``` -------------------------------- ### Start Lab Without Configuration Source: https://netlab.tools/dev/config/initial Use this command to start a lab environment without applying any configurations to the devices. This is useful for initial setup before generating configurations. ```bash netlab up --no-config -d ``` -------------------------------- ### Display netlab install help Source: https://netlab.tools/_sources/netlab/install.md.txt View the command-line interface options for the netlab install utility. ```text netlab install -h usage: netlab install [-h] [-v] [-q] [-y] [-u] [--all] [script ...] Install additional software positional arguments: script Run the specified installation script options: -h, --help show this help message and exit -v, --verbose Verbose logging -q, --quiet Be as quiet as possible -y, --yes Run the script without prompting for a confirmation -u, --user Install Python libraries into user .local directory --all Run all installation scripts Run "netlab install" with no arguments to get install script descriptions ``` -------------------------------- ### Install Containerlab with netlab Source: https://netlab.tools/labs/clab Use this command to install Containerlab on Ubuntu. For other Linux distributions, refer to the official Containerlab installation guide. ```bash netlab install containerlab ``` -------------------------------- ### Install Additional Software with netlab Source: https://netlab.tools/_sources/install/ubuntu.md.txt Installs required software components like Ansible, libvirt, and Containerlab using the netlab install command. Execute commands individually if multiple installations fail. ```bash netlab install ubuntu ansible libvirt containerlab ``` -------------------------------- ### netlab topology example Source: https://netlab.tools/install/linux A sample topology.yml file to test the netlab installation. This configuration uses FRR as the default device and includes OSPF module with three nodes and defined links. ```yaml --- defaults: device: frr module: [ ospf ] nodes: [ s1, s2, s3 ] links: [ s1-s2, s2-s3, s1-s2-s3 ] ``` -------------------------------- ### Install GuestFS Tools Source: https://netlab.tools/_sources/labs/cumulus_nvue.md.txt Installs the `guestfs-tools` package, which is required for disk image manipulation with `virt-customize`. ```bash sudo apt install guestfs-tools ``` -------------------------------- ### Install netlab and Components in Virtual Environment Source: https://netlab.tools/_sources/install/ubuntu.md.txt Installs the networklab Python package using pip3 and then uses the netlab install command to set up other necessary software components within the activated virtual environment. ```bash pip3 install networklab netlab install ubuntu containerlab libvirt ansible ``` -------------------------------- ### Graphite Topology Configuration Example Source: https://netlab.tools/_sources/extool/graphite.md.txt Example topology file demonstrating the use of graphite.icon and graphite.level attributes for nodes. ```yaml module: [ bgp, ospf ] bgp.as: 65000 nodes: a: b: c: d: rr: bgp.rr: True id: 1 graphite.icon: server y: bgp.as: 65100 module: [ bgp ] graphite.level: 2 linux1: module: [] device: linux graphite.icon: host graphite.level: 3 linux2: module: [] device: linux graphite.level: 3 linux3: module: [] device: linux graphite.level: 3 links: - a-b - a-c - b-d - c-d - b-rr - d-rr - c-y - d-y - y-linux1 - y: linux2: linux3: - y: ``` -------------------------------- ### Install Netlab and Dependencies on Ubuntu Source: https://netlab.tools/_sources/install/ubuntu-vm.md.txt Commands to update system packages, install Python pip, and set up the Netlab environment. Note that installing as root is used here for single-purpose VMs, and Ubuntu 24.04 may require --break-system-packages. ```bash sudo apt-get update sudo apt-get install -y python3-pip sudo pip3 install --ignore-installed networklab netlab install -y ubuntu ansible libvirt containerlab ``` -------------------------------- ### Display EXOS Initial Configuration Recipe Source: https://netlab.tools/labs/exos Use this command to view the required setup steps and CLI commands for configuring an EXOS VM for Vagrant. ```text Creating initial configuration for Extreme EXOS Vagrant box =========================================================== * Wait for the 'login' prompt and 'Authentication Service (AAA) on the master node is now available for login' message * Log in as 'admin' (no password) Answers the never-ending list of setup questions: * Disable auto-provision: yes * Management port: skip * Disable MSTP: no * Enable enhanced security: no * Disable Telnet: yes * Enable SNMPv2: no * Enable SNMPv3: no * Turn off unconfigured ports by default: yes * Failsafe username/password: no When you get to the end of the list, you can see the CLI commands you just generated and a list of generally useful commands. After that, you'll eventually get to the EXOS prompt (* EXOS-VM.1): Enter these commands one at a time. There will be extra prompts, so do not copy and paste everything at once. Skip the text in brackets; it is included only as an explanation. * configure account admin password (old password is empty, new one is admin) * enable ssh * create account admin vagrant vagrant * create sshd2 user-key vagrant AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== * configure sshd2 user-key vagrant add user vagrant * unconfigure vlan Mgmt ip (remove current IP from management VLAN) * enable dhcp vlan Mgmt (enable DHCP on management VLAN) * save configuration Disconnect from the console (Ctrl+] usually works). For convenience, here is a copy-and-paste version of the commands above, use with caution: ==================================================== configure account admin password admin admin enable ssh y create account admin vagrant vagrant create sshd2 user-key vagrant AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== configure sshd2 user-key vagrant add user vagrant unconfigure vlan Mgmt ip enable dhcp vlan Mgmt save configuration y ==================================================== ``` -------------------------------- ### Install and Start rsyslogd Source: https://netlab.tools/_sources/example/linux.md.txt This script updates package lists, installs the rsyslog package, and then starts the rsyslogd service. Ensure the script begins with '#!/bin/bash' for netlab's Ansible playbook. ```bash #!/bin/bash apt-get update apt-get install rsyslog -y rsyslogd ``` -------------------------------- ### NX-OS Initial Device Configuration Example Source: https://netlab.tools/_sources/labs/nxos.md.txt This is an example of the initial device configuration for NX-OS devices, as displayed by the `netlab libvirt config nxos` command. This configuration is typically copy-pasted during the box-building process. ```text hostname nxos interface Management0/0 ip address dhcp no shutdown ! interface Ethernet1/1 no shutdown ! interface Ethernet1/2 no shutdown ! interface Ethernet1/3 no shutdown ! interface Ethernet1/4 no shutdown ! feature ssh feature telnet feature ospf feature bgp feature lacp feature vpc feature nxapi ! ntp server 10.0.0.1 ntp server 10.0.0.2 ! logging server 10.0.0.1 logging server 10.0.0.2 ! radius-server host 10.0.0.1 key 7 "cisco" radius-server host 10.0.0.2 key 7 "cisco" ! username admin role network-admin password 7 "cisco" ! line vty transport input ssh telnet ! end ``` -------------------------------- ### Start Lab with Multilab Plugin via CLI Source: https://netlab.tools/_sources/plugins/multilab.md.txt Use the `netlab up` command with the `--plugin multilab` and `-s` arguments to specify the multilab ID and start a lab instance. Ensure each instance runs in a different working directory. ```bash # Start the lab with the multilab plugin # netlab up --plugin multilab -s defaults.multilab.id=12 topology.yml ``` -------------------------------- ### Display NX-OS Initial Device Configuration Recipe Source: https://netlab.tools/_sources/labs/nxos.md.txt This command displays the build recipe for the initial device configuration of NX-OS devices. This is useful for understanding the configuration steps required during the box-building process. ```bash netlab libvirt config nxos ``` -------------------------------- ### Example Topology for Link Naming Source: https://netlab.tools/_sources/links.md.txt This example topology demonstrates how link names are assigned to interfaces. Interfaces connected to links with no 'name' attribute get default names based on the link type. ```yaml nodes: - r1 - r2 - r3 links: - r1-r2 - [ r1, r2, r3 ] - r1: r2: name: P2P link - r1: r2: r3: name: LAN link ``` -------------------------------- ### Create Initial Device Configurations Source: https://netlab.tools/dev/config/initial Execute this command to generate the initial device configurations and save them to the 'config' directory. This step is performed after starting the lab without configuration. ```bash netlab initial -o ``` -------------------------------- ### Display Status of a Failed or Missing Provider Source: https://netlab.tools/netlab/show This example shows how the command reports the status of a provider that is not installed or not functioning correctly. It includes error messages encountered during the status check. ```bash $ netlab show providers -p virtualbox Status of virtualbox (Vagrant with Virtualbox): Executing: VBoxManage -h Error executing VBoxManage -h: [Errno 2] No such file or directory: 'VBoxManage' Status: N/A ``` -------------------------------- ### List all configuration modules Source: https://netlab.tools/netlab/show Display a summary of all available configuration modules and the devices that support them. ```bash $ netlab show modules netlab Configuration modules and supported devices =========================================================================== bfd: srlinux, sros, iosv, csr, nxos, eos, vyos, arubacx bgp: cumulus, cumulus_nvue, eos, frr, csr, iosv, nxos, asav, vsrx, vyos, routeros, srlinux, sros, dellos10, routeros7, vmx, iosxr, arubacx, vptx eigrp: csr, iosv, nxos evpn: sros, srlinux, frr, eos, vyos, dellos10, cumulus, nxos, arubacx, vptx gateway: eos, cumulus, iosv, csr, nxos, sros, srlinux, vyos, dellos10, arubacx isis: eos, frr, csr, iosv, nxos, asav, vsrx, srlinux, sros, vyos, vmx, iosxr, vptx mpls: eos, iosv, csr, routeros, vyos, routeros7, sros, vmx, vsrx, frr, vptx, arubacx ospf: arcos, cumulus, cumulus_nvue, eos, fortios, frr, csr, iosv, nxos, vsrx, vyos, routeros, srlinux, sros, dellos10, routeros7, vmx, iosxr, arubacx, vptx sr: csr, eos, srlinux, sros, vsrx, vmx, vptx srv6: sros vlan: eos, iosv, csr, vyos, dellos10, srlinux, routeros, nxos, frr, cumulus, sros, routeros7, vmx, vsrx, arubacx, vptx vrf: eos, iosv, csr, routeros, dellos10, vyos, cumulus_nvue, nxos, srlinux, frr, cumulus, sros, routeros7, vmx, vsrx, arubacx, vptx vxlan: eos, nxos, vyos, csr, dellos10, srlinux, frr, cumulus, sros, arubacx, vptx ``` -------------------------------- ### Define dummy device parameters Source: https://netlab.tools/_sources/dev/devices.md.txt Example configuration file for a dummy device, defining interface templates and default provider settings. ```yaml interface_name: eth{ifindex} loopback_interface_name: Loopback{ifindex} libvirt: image: none clab: image: none external: image: none group_vars: ansible_connection: paramiko_ssh ansible_network_os: none ``` -------------------------------- ### Cisco IOS Static Configuration Example Source: https://netlab.tools/_sources/dev/config/initial.md.txt Enables LLDP, disables DNS lookup, and removes banners on Cisco IOS devices. This configuration is part of the static setup for a device. ```text no ip domain lookup ! lldp run ! no banner exec no banner login no banner incoming ``` -------------------------------- ### Dell OS10 Initial Device Configuration Recipe Source: https://netlab.tools/labs/dellos10 This is the build recipe displayed by `netlab libvirt config dellos10`. It outlines the steps for initial device configuration, including login, disabling zero-touch, saving configuration, and setting up user credentials and SSH keys. ```text Creating initial configuration for Dell OS10 ============================================= * Wait for the 'login' prompt, and then wait again some more minutes * Login as 'admin' (password: 'admin') * Disable zero-touch ('ztd cancel') * Save configuration ('write memory') and reload the box ('reload') * Login as 'admin' (password: 'admin') * Enter configuration mode ('configure') * Copy-paste the following configuration NOTE: the management traffic is isolated in a dedicated management VRF (management). ============================================= ! interface mgmt1/1/1 no ip address dhcp no ipv6 address exit ! ip vrf management interface management exit ! interface mgmt1/1/1 no shutdown ip address dhcp exit ! service simple-password username vagrant password vagrant role sysadmin priv-lvl 15 username vagrant sshkey "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" ! end ============================================= * Save configuration ('write memory') and reload the box ('reload') * Wait until the reload is completed * Disconnect from console (ctrl-] usually works). ``` -------------------------------- ### Execute Shell Commands with kubectl Source: https://netlab.tools/_sources/plugins/kind.md.txt Use the `clab.exec` parameter on a control-plane node to run shell commands, such as `kubectl get services`, to configure your KinD cluster. These commands execute after the container starts but before network configuration. ```bash #!/bin/bash kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml ``` -------------------------------- ### Enable Port Forwarding for All Libvirt Nodes Source: https://netlab.tools/_sources/labs/libvirt.md.txt Configure default port forwarding for all libvirt nodes using the `defaults.providers.libvirt.forwarded` dictionary. This example sets the starting host port for SSH to 2000, and maps SSH ports for R1 and R2 based on their node IDs. ```yaml defaults.providers.libvirt.forwarded: ssh: 2000 defaults.device: cumulus nodes: r1: r2: id: 42 ``` -------------------------------- ### Generate Initial FortiOS Configuration Recipe Source: https://netlab.tools/labs/fortios This command displays the build recipe for the initial FortiOS device configuration, which is applied via a CD-ROM image during the first boot. ```bash netlab libvirt config fortios ``` -------------------------------- ### Start Virtual Devices with Containerlab Source: https://netlab.tools/_sources/example/github.md.txt This output shows the process of starting virtual network devices using Containerlab, including network creation and container deployment. It displays the status and IP addresses of the running containers. ```bash ┌──────────────────────────────────────────────────────────────────────────────────┐ │ STARTING clab nodes │ └──────────────────────────────────────────────────────────────────────────────────┘ provider clab: executing sudo -E containerlab deploy -t clab.yml INFO[0000] Containerlab v0.54.2 started INFO[0000] Parsing & checking topology file: clab.yml INFO[0000] Creating docker network: Name="netlab_mgmt", IPv4Subnet="192.168.121.0/24", IPv6Subnet="", MTU=1500 INFO[0000] Creating lab directory: /home/pipi/net101/tools/X/clab-X INFO[0000] Creating container: "r2" INFO[0000] Creating container: "r1" INFO[0000] Created link: r1:eth1 <--> X_1:r1_eth1 INFO[0000] Created link: r1:eth2 <--> r2:eth2 INFO[0000] Created link: r2:eth1 <--> X_2:r2_eth1 INFO[0000] Adding containerlab host entries to /etc/hosts file INFO[0000] Adding ssh config for containerlab nodes +---+-----------+--------------+------------------------------+-------+---------+--------------------+--------------+ | # | Name | Container ID | Image | Kind | State | IPv4 Address | IPv6 Address | +---+-----------+--------------+------------------------------+-------+---------+--------------------+--------------+ | 1 | clab-X-r1 | b9835b4ef5d2 | quay.io/frrouting/frr:10.0.1 | linux | running | 192.168.121.101/24 | N/A | | 2 | clab-X-r2 | 25962c45a991 | quay.io/frrouting/frr:10.0.1 | linux | running | 192.168.121.102/24 | N/A | +---+-----------+--------------+------------------------------+-------+---------+--------------------+--------------+ ``` -------------------------------- ### Install netlab Python Package Source: https://netlab.tools/install Use this command to install the netlab Python package on a system with prerequisites already installed. This command also installs necessary Python dependencies and creates the 'netlab' command-line tool. ```bash python3 -m pip install networklab ``` -------------------------------- ### Display Box-Building Recipe - Usage Source: https://netlab.tools/netlab/libvirt Shows the command-line arguments for displaying box-building recipe guidelines for Vagrant network devices. Specify the network device for which you want the configuration. ```bash % netlab libvirt config -h usage: netlab libvirt config [-h] {eos,dellos10,fortios,nxos,iosxr,arubacx,sonic,cat8000v,asav,vptx,vsrx,routeros7,csr,iosvl2,iosv} Display Vagrant network device box configuration guidelines positional arguments: {eos,dellos10,fortios,nxos,iosxr,arubacx,sonic,cat8000v,asav,vptx,vsrx,routeros7,csr,iosvl2,iosv} Network device you want to create options: -h, --help show this help message and exit ``` -------------------------------- ### Test netlab Installation (Containerlab) Source: https://netlab.tools/_sources/install/ubuntu.md.txt Tests the netlab installation specifically for the Containerlab provider. This command verifies that Containerlab is correctly installed and functional. ```bash netlab test clab ``` -------------------------------- ### Display Cisco IOSv initial configuration recipe Source: https://netlab.tools/labs/iosv Use this command to retrieve the configuration template required during the box-building process. ```bash netlab libvirt config iosv ``` -------------------------------- ### Install Python3 and pip3 on Ubuntu Source: https://netlab.tools/_sources/install/ubuntu.md.txt Installs Python3 and pip3 using the apt package manager. This is a prerequisite for installing the netlab Python package. ```bash sudo apt-get update && sudo apt-get install -y python3-pip ``` -------------------------------- ### Set VM Batch Startup using Environment Variables Source: https://netlab.tools/labs/libvirt Configure batch size and interval for VM startup using netlab environment variables without modifying lab topology or defaults. ```bash $ export NETLAB_PROVIDERS_LIBVIRT_BATCH__SIZE=2 $ export NETLAB_PROVIDERS_LIBVIRT_BATCH__INTERVAL=10 ``` -------------------------------- ### Install eos-downloader Source: https://netlab.tools/_sources/labs/ceos.md.txt Install the eos-downloader utility via pip. ```bash pip install eos-downloader ``` -------------------------------- ### Start a service manually Source: https://netlab.tools/example/linux Command to start the rsyslog daemon. ```bash # rsyslogd ``` -------------------------------- ### Display Summary of Virtualization Providers Source: https://netlab.tools/netlab/show This command provides an overview of all supported virtualization providers and their current operational status (OK, FAIL, or N/A). It's helpful for a quick check of the environment. ```bash $ netlab show providers Supported virtualization providers +------------+--------------------------+--------+ | provider | description | status | +============+==========================+========+ | clab | containerlab with Docker | OK | | external | External devices | OK | | libvirt | Vagrant with libvirt/KVM | OK | | virtualbox | Vagrant with Virtualbox | N/A | +------------+--------------------------+--------+ ``` -------------------------------- ### Start a Virtual Lab Source: https://netlab.tools/netlab/up The 'netlab up' command creates virtualization provider configuration, transformed topology snapshots, and network automation configuration files. It then starts the virtual lab, performs provider-specific initialization, and deploys device configurations unless flags like --no-config or --reload-config are used. ```APIDOC ## POST /api/netlab/up ### Description Starts a virtual lab by creating necessary configuration files and initializing the lab environment. ### Method POST ### Endpoint /api/netlab/up ### Parameters #### Query Parameters - **topology** (string) - Optional - Topology file or URL (default: topology.yml) - **--log** (boolean) - Optional - Enable basic logging - **-v, --verbose** (boolean) - Optional - Verbose logging (add multiple flags for increased verbosity) - **-q, --quiet** (boolean) - Optional - Report only major errors - **--defaults [DEFAULTS ...]** (array of strings) - Optional - Local topology defaults file - **-d DEVICE, --device DEVICE** (string) - Optional - Default device type - **-p PROVIDER, --provider PROVIDER** (string) - Optional - Override virtualization provider - **--plugin PLUGIN** (string) - Optional - Additional plugin(s) - **-s SETTINGS, --set SETTINGS** (string) - Optional - Additional parameters added to topology file - **--no-config** (boolean) - Optional - Do not configure lab devices - **-r RELOAD, --reload-config RELOAD** (string) - Optional - Reload saved configurations from specified directory - **--no-tools** (boolean) - Optional - Do not start the external tools - **--dry-run** (boolean) - Optional - Print the commands that would be executed, but do not execute them - **--fast-config** (boolean) - Optional - Use fast device configuration (Ansible strategy = free) - **--snapshot [SNAPSHOT]** (string) - Optional - Use netlab snapshot file created by a previous lab run ### Request Example ```json { "topology": "http://example.com/topology.yml", "provider": "virtualbox", "no_config": false } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the lab has started successfully. #### Response Example ```json { "message": "Virtual lab started successfully." } ``` ``` -------------------------------- ### Install Ansible Galaxy Collection for Dell OS10 Source: https://netlab.tools/_sources/labs/dellos10.md.txt Install the official Ansible collection for Dell OS10 to manage devices with Ansible. This command fetches and installs the necessary modules. ```bash ansible-galaxy collection install dellemc.os10 ``` -------------------------------- ### Topology File Example Source: https://netlab.tools/_sources/netlab/create.md.txt This is an example topology file using the containerlab provider to set up a lab with three Cumulus VX devices. It specifies the default device type, provider, modules, nodes, and links. ```yaml defaults: device: cumulus provider: clab module: [ ospf ] nodes: [ s1, s2, s3 ] links: [ s1-s2, s2-s3 ] ``` -------------------------------- ### Display netlab initial help Source: https://netlab.tools/netlab/initial View the command-line interface options for the netlab initial command. ```bash $ netlab initial -h usage: netlab initial [-h] [--log] [-v] [-q] [-i] [-m [MODULE]] [-l LIMIT] [-c] [--ready] [--fast] [-o [OUTPUT]] [--clean] [--instance INSTANCE] Initial device configurations options: -h, --help show this help message and exit --log Enable basic logging -v, --verbose Verbose logging (add multiple flags for increased verbosity) -q, --quiet Report only major errors -i, --initial Deploy just the initial configuration -m, --module [MODULE] Deploy module-specific configuration (optionally including a list of modules separated by commas) -l, --limit LIMIT Limit the operation to a subset of nodes -c, --custom Deploy custom configuration templates (specified in "config" group or node attribute) --ready Wait for devices to become ready --fast Use "free" strategy in Ansible playbook for faster configuration deployment -o, --output [OUTPUT] Create a directory with initial configurations instead of deploying them (default output directory: config) --clean Clean up the output directory before creating the initial configuration --instance INSTANCE Specify lab instance to configure All other arguments are passed directly to ansible-playbook ``` -------------------------------- ### Install vagrant-libvirt plugin Source: https://netlab.tools/_sources/install/linux.md.txt Installs the required version of the vagrant-libvirt plugin for KVM support. ```bash vagrant plugin install libvirt --plugin-version=0.12.2 ``` -------------------------------- ### List installed Vagrant boxes for EOS Source: https://netlab.tools/example/release This command lists installed Vagrant boxes, showing their names and providers. Vagrant automatically selects the highest version number if multiple boxes with the same name are installed. ```bash $ vagrant box list|grep eos arista/veos (libvirt, 4.28.3M) arista/veos (libvirt, 4.31.2F) ``` -------------------------------- ### List initial configuration module features Source: https://netlab.tools/netlab/show Shows device support for features like system MTU and unnumbered interfaces within the initial configuration module. ```bash $ netlab show modules -m initial Devices and features supported by initial module +--------------+------------+-----------------+----------+ | device | system_mtu | ipv4.unnumbered | ipv6.lla | +==============+============+=================+==========+ | arubacx | | | | +--------------+------------+-----------------+----------+ | asav | | | | +--------------+------------+-----------------+----------+ | csr | | x | x | +--------------+------------+-----------------+----------+ | cumulus | | x | x | +--------------+------------+-----------------+----------+ | cumulus_nvue | | x | x | +--------------+------------+-----------------+----------+ | dellos10 | | x | x | +--------------+------------+-----------------+----------+ | eos | x | x | x | +--------------+------------+-----------------+----------+ | fortios | | | | +--------------+------------+-----------------+----------+ | frr | | x | x | ``` -------------------------------- ### Display OpenBSD Build Recipe Source: https://netlab.tools/_sources/labs/openbsd.md.txt Command to display the build recipe for the OpenBSD VM configuration. ```bash netlab libvirt config openbsd ``` -------------------------------- ### Display vPTX Build Recipe Source: https://netlab.tools/labs/vptx Displays the configuration recipe for a Juniper vPTX device. ```bash netlab libvirt config vptx ``` -------------------------------- ### Display IOSvL2 Build Recipe Source: https://netlab.tools/_sources/labs/iosvl2.md.txt Use this command to display the build recipe for the IOSvL2 Vagrant box, which includes initial device configuration steps. ```bash netlab libvirt config iosvl2 ``` -------------------------------- ### BGP Example Table of Contents Source: https://netlab.tools/_sources/module/bgp.md.txt ReStructuredText directive for including BGP example documentation files. ```rst .. toctree:: :maxdepth: 1 bgp_example/simple.md bgp_example/ibgp.md bgp_example/ebgp.md ``` -------------------------------- ### CLI: netlab install Source: https://netlab.tools/netlab/install Executes internal installation scripts to configure the environment with necessary software and libraries. ```APIDOC ## netlab install ### Description Installs additional software required for netlab, including Ubuntu packages, Ansible, libvirt, and containerlab. ### Method CLI Command ### Parameters #### Positional Arguments - **script** (string) - Optional - The specific installation script to run (e.g., ubuntu, libvirt, containerlab, ansible, graph, grpc). #### Options - **-h, --help** (flag) - Optional - Show help message and exit. - **-v, --verbose** (flag) - Optional - Enable verbose logging. - **-q, --quiet** (flag) - Optional - Be as quiet as possible. - **-y, --yes** (flag) - Optional - Run the script without prompting for confirmation. - **-u, --user** (flag) - Optional - Install Python libraries into the user .local directory. - **--all** (flag) - Optional - Run all available installation scripts. ``` -------------------------------- ### Install EXOS Ansible Collection Source: https://netlab.tools/_sources/caveats.md.txt Command to install the deprecated community.network collection required for EXOS configuration. ```shell ansible-galaxy collection install community.network ``` -------------------------------- ### Build ArubaOS-CX Libvirt Box (Older netlab releases) Source: https://netlab.tools/_sources/labs/arubacx.md.txt For netlab releases older than 1.8.2, unpack the OVA file first and then use this command to build the box. This method requires manual unpacking of the OVA. ```bash tar xvf _ova-file-name_ netlab libvirt package arubacx _vmdk-disk-file-name_ ``` -------------------------------- ### Device Readiness Check Source: https://netlab.tools/netlab/initial Details on how 'netlab initial' checks device readiness before configuration deployment and how to execute this step independently. ```APIDOC ## Wait for Devices to Become Ready ### Description The `netlab initial` command begins with a device readiness check to ensure devices are prepared for configuration deployment. This step can be executed independently using the `--ready` option. ### Reasons for Device Unreadiness - Virtualization providers may prematurely report devices as ready. - Some devices require additional time after SSH server availability to become fully operational (e.g., Cisco Nexus OS, Juniper vPTX). ### Verification Methods - **SSH Reachability**: `netlab` checks SSH server reachability for containers configured via SSH. - **Device-Specific Ansible Tasks**: For devices needing extra time, `netlab` uses specific Ansible tasks to verify readiness. ### Configuration Tip To use an Ansible playbook for SSH server checks, set the `defaults.netlab.initial.ready.ssh` topology default to `ansible` (preferably in a user defaults file). ```