# netlab: Execute a Command on Multiple Devices

DevFeed: [netlab: Execute a Command on Multiple Devices](<https://devfeed.tech/articles/netlab-execute-a-command-on-multiple-devices-11169.md>)

Original publisher: [Read original article](<https://blog.ipspace.net/2025/04/netlab-exec/>)

Published: 2025-04-16T05:47:00Z

Content type: tutorial

Language: en

Sources: [ipSpace.net blog](<https://devfeed.tech/sources/ipspace-net-blog.md>)

Topics: [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Network](<https://devfeed.tech/topics/network.md>), [BGP](<https://devfeed.tech/topics/bgp.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [Shell](<https://devfeed.tech/topics/shell.md>), [Cisco](<https://devfeed.tech/topics/cisco.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [bgp](<https://devfeed.tech/tags/bgp.md>), [cisco](<https://devfeed.tech/tags/cisco.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [filter](<https://devfeed.tech/tags/filter.md>), [flag](<https://devfeed.tech/tags/flag.md>), [netlab](<https://devfeed.tech/tags/netlab.md>), [network](<https://devfeed.tech/tags/network.md>)

## AI overview

A tutorial on using netlab exec to run the same command across multiple network devices. It explains how to quote shell metacharacters, filter Cisco IOS output, reduce connection-status noise, and handle an unresolved trailing connection message.

## Source excerpt

When I was updating the Network Migration with BGP Local-AS Feature blog post, I wanted to execute the same command (show ip bgp) on all routers in my network. Not a problem: since Dan Partelly added the netlab exec command, it's as simple as netlab exec * show ip bgp. Well, not exactly; there are still a few quirks. Read more ...