Skip to content

Commit 9ae0aa2

Browse files
committed
Document device debugging approaches
1 parent c0317a0 commit 9ae0aa2

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

docs/node/debug.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
(node-debug)=
2+
# Debugging Network Devices
3+
4+
It's usually trivial to enable debugging on devices running in a virtual lab:
5+
6+
1. Log in to the affected devices
7+
2. Enable debugging
8+
3. Monitor debugging outputs in log files or an SSH session
9+
10+
However, you might want to enable specific debugging printouts every time you start a lab topology. That's pretty easy to do on most devices that allow you to execute regular commands (for example, the **debug** command) within the configuration mode:
11+
12+
1. Create a [custom configuration template](custom-config) that enables debugging, for example:
13+
14+
```
15+
do debug ipv6 routing
16+
do debug bgp ipv6 unicast import events
17+
do debug bgp ipv6 unicast import updates
18+
do debug bgp ipv6 unicast updates out
19+
```
20+
21+
2. Add the name of the custom configuration template to a node **config** list.
22+
23+
```{tip}
24+
This approach allows you to automate debugging in a [multi-vendor environment](custom-config-multivendor)
25+
```
26+
27+
Unfortunately (for debugging purposes), _netlab_ executes the custom configuration templates after configuring the network devices, which means you might lose the interesting part of the debugging information: what happens when the control-plane protocols start.
28+
29+
You can enable debugging *before* configuring network devices with this simple trick:
30+
31+
1. Execute **netlab up --no-config**
32+
2. If needed, execute **netlab initial --ready** to ensure the network devices are fully operational
33+
3. Log into the network devices and enable debugging, or use a custom configuration template and execute it with **netlab config _debugging_template_** (this approach yet again gives you multi-vendor capabilities).
34+
4. Start device configuration with **netlab initial**
35+
36+
```{warning}
37+
Some devices (for example, Arista EOS) accept debugging commands only after the corresponding control-plane protocol has been configured, making the above approach a non-starter.
38+
```
File renamed without changes.

docs/nodes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,6 @@ $ netlab inspect --node all id
321321
.. toctree::
322322
:maxdepth: 1
323323
324-
node-roles.md
324+
node/roles.md
325+
node/debug.md
325326
```

docs/tutorials.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Once you want to know more, check out these lab topology tutorials:
3131
* [Mix Containers and VMs in the Same Lab Topology](https://blog.ipspace.net/2023/02/netlab-vm-containers/)
3232
* [Using VLAN and VRF Links](https://blog.ipspace.net/2023/04/netlab-vrf-vlan-links/)
3333
* [](example-bridge)
34+
* [](node-debug)
3435

3536
## User Interface Tutorials
3637

0 commit comments

Comments
 (0)