Skip to content

Commit e4ef5a9

Browse files
committed
Tweaks, FRR support
1 parent cad4e8f commit e4ef5a9

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

docs/node/debug.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ You can enable debugging *before* configuring network devices with this simple t
3333
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).
3434
4. Start device configuration with **netlab initial**
3535

36-
Finally, you might be worried that the symptoms you're experiencing depend on the time after the device boots, so you want to enable debugging as soon as possible. In that case, you can use the node **debug** attribute (on devices for which we implemented it), which is a list of device-specific debugging parameters that will be executed at the very beginning of the initial device configuration.
36+
(node-debug-attribute)=
37+
Finally, you might be worried that the symptoms you're experiencing depend on the time after the device boots, so you want to enable debugging as soon as possible. In that case, you can use the node **debug** attribute (on [devices for which we implemented it](platform-initial-extra)), which is a list of device-specific debugging parameters that will be executed at the very beginning of the initial device configuration.
3738

3839
**Caveats:**
3940

40-
* The contents of the **debug** attribute are device-specific. *netlab* currently does not have multi-vendor **debug** capabilites. The values of the **debug** attribute must be relevant to the underlying network device, or you'll get configuration errors during the initial configuration
41+
* The contents of the **debug** attribute are device-specific. *netlab* currently does not have multi-vendor **debug** capabilites.
42+
* The values of the **debug** attribute are not checked. They must be relevant to the underlying network device, or you'll get configuration errors during the initial configuration
43+
* _netlab_ does not check whether the initial configuration template of the device you're using includes debugging support. See the [initial device configuration support tables](platform-initial-extra) for more details.
4144
* The initial device configuration template supplies the mandatory prefix (for example, **do debug**). You only have to list the debugging conditions, for example:
4245

4346
```

docs/platforms.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,14 @@ The following interface addresses are supported on various platforms:
283283
* See [Initial Configuration Integration Tests Results](https://release.netlab.tools/_html/coverage.initial) for up-to-date details.
284284
```
285285

286+
(platform-initial-extra)=
287+
Some platforms can enable additional functionality during the initial device configuration:
288+
289+
| Operating system | Enable<br>[debugging](node-debug-attribute) |
290+
|------------------|:-:|
291+
| Cisco IOS/IOS XE[^18v]||
292+
| FRRouting ||
293+
286294
## Supported Configuration Modules
287295

288296
(platform-routing-support)=
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% macro enable_debugging(debug,limit='',prefix='do debug') %}
2+
{% for dbg in debug|default([]) if dbg and (limit == '' or limit in dbg) %}
3+
{% if loop.first %}
4+
!
5+
! Enable debugging
6+
{% endif %}
7+
{{ prefix }} {{ dbg }}
8+
{% endfor %}
9+
{% endmacro %}

netsim/ansible/templates/initial/frr.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ echo "service integrated-vtysh-config" >/etc/frr/vtysh.conf
129129
cat >/tmp/config <<CONFIG
130130
hostname {{ inventory_hostname }}
131131
!
132+
{% if debug is defined %}
133+
log file /tmp/logging
134+
{% from '_debug_commands.j2' import enable_debugging %}
135+
{{ enable_debugging(debug,prefix='debug') }}
136+
{% endif %}
137+
!
132138
{#
133139
These commands set the corresponding net.ipv4 / net.ipv6 variables.
134140
As we don't want to assume the default values, we set them explicitly
@@ -183,4 +189,5 @@ interface {{ i.ifname }}
183189
do write
184190
CONFIG
185191
vtysh -f /tmp/config
192+
!
186193
exit 0

netsim/ansible/templates/initial/ios.j2

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ hostname {{ inventory_hostname }}
22
!
33
no ip domain lookup
44
logging buffered 256000
5-
{% for dbg in debug|default([]) %}
6-
{% if loop.first %}
7-
!
8-
! Enable debugging
9-
{% endif %}
10-
do debug {{ dbg }}
11-
{% endfor %}
5+
{% from '_debug_commands.j2' import enable_debugging %}
6+
{{ enable_debugging(debug) }}
127
!
138
lldp run
149
!

0 commit comments

Comments
 (0)