Skip to content

stop command#

The node's lifecycle command set consists of start, stop, and restart commands that allow users to individually control the lifecycle of the nodes in a deployed lab. The most common use case is to restart or stop+start the nodes that are stuck in some bad shape or require a reboot while keeping their dataplane interfaces intact.

With these commands you don't need to respin the whole topology when all you need is to restart a few nodes.

Description#

The stop command stops one or more nodes in a deployed lab while keeping dataplane links intact. For each selected node, containerlab parks veth interfaces in a dedicated namespace before stopping the container.

All command line arguments can be also provided via environment variables (CLI flags take precedence). The environment variable names are constructed by prepending CLAB_ to the flag name, then adding the command path and ending with the flag name in its full form, all in uppercase and with hyphens replaced by underscores.

For example, the --max-workers flag for the deploy command can be set via CLAB_DEPLOY_MAX_WORKERS environment variable. Or CLAB_INSPECT_ALL=1 to set --all flag for the inspect command. Or CLAB_TOPO=srlinux.dev/clab-srl clab dep -c to deploy a lab with the topology passed via environment variable.

Usage#

containerlab [global-flags] stop [local-flags]

Flags#

topology | name#

Use the global --topo | -t flag to reference the lab topology file, or use the global --name flag to reference an already deployed lab by name.

One of --topo or --name is required.

node#

Use local --node | -n to select nodes to stop.

The flag is repeatable and also supports comma-separated values:

containerlab stop -t mylab.clab.yml --node r1 --node r2
containerlab stop -t mylab.clab.yml --node r1,r2

If --node is omitted, all nodes in the selected lab are stopped.

Limitations#

Node lifecycle operations (stop, start, restart) currently support only a subset of nodes:

  • only veth dataplane links are supported
  • root-namespace-based nodes are not supported
  • nodes with auto-remove enabled are not supported
  • only single-container nodes are supported
  • network-mode: container:<...> users/providers are not supported

Examples#

Stop a single node by topology file#

containerlab stop -t mylab.clab.yml --node r1

Stop multiple nodes by lab name#

containerlab stop --name mylab --node r1,r2

Stop all nodes in a lab#

containerlab stop -t mylab.clab.yml
containerlab stop --name mylab