Skip to content

restart 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 restart command restarts one or more nodes in a deployed lab by performing a lifecycle-aware stop+start operation.

For running nodes, containerlab parks dataplane interfaces before stop and restores them on start. For already stopped nodes, containerlab performs the start/restore phase.

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] restart [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 restart.

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

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

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

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#

Restart a single node by topology file#

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

Restart multiple nodes by lab name#

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

Restart all nodes in a lab#

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