Skip to content
Guides & References

Junos interface descriptions

Worked example for Juniper Junos interfaces: every interface is disabled or has a description of its own, so no port is unaccounted for.

Policy LibraryUpdated
Platform
juniper-junos
Minimum version
rConfig 8.0.2
Editions
Pro, Vector, Enterprise
On this page

Junos interface descriptions

A rule that checks every interface. A description says what is plugged in, and a port that is on with no description is one nobody can account for. It comes from the junos-interfaces policy template.

Every example on this page was checked with rConfig Pro's policy engine on

Each of the 2 configs below was run through rConfig Pro’s evaluator with the rule above it, and gave the result shown. The configs are sanitised excerpts of the sample configs that come with the template.

All the rules come from junos-interfaces.policy in the policy templates (v1.5.0). Import the whole file with Import Templates (see importing a policy template), or copy one rule into your own definition. The Juniper Junos templates page lists the file’s known limitations. Run the rules against show configuration | display set.

Rule Method Since
Every interface disabled or described must_not_match_regex 8.0.2

Every interface disabled or described

This rule passes an interface if it has a description line or a disable line of its own. It fails if any interface has neither. The rule is a single regex, so the report does not name the interface.

Definition
// Every interface is disabled or has a description (set interfaces <name> disable or set interfaces <name> description)
#[must_not_match_regex]
/(?:\A|^(?!set interfaces (\S+) [^\n]*\nset interfaces \1 )[^\n]*\n)set interfaces (?!interface-range )(\S+) (?!disable$|description )[^\n]*(?:\nset interfaces \2 (?!disable$|description )[^\n]*)*$(?!\nset interfaces \2 )/m
passPassing config: Hardened EX2300 sample (Junos 23.2, synthetic)
set interfaces ge-0/0/22 disable
set interfaces ge-0/0/22 unit 0 family ethernet-switching interface-mode access
set interfaces xe-0/1/0 description "Uplink to br-gwy-fw01 ge-0/0/1"
set interfaces xe-0/1/0 unit 0 family ethernet-switching interface-mode trunk
set interfaces irb description "Routed VLAN interfaces"
set interfaces irb unit 99 description "Switch management"
set interfaces irb unit 99 family inet address 192.0.2.21/24
set interfaces lo0 description "Routing engine loopback"
set interfaces lo0 unit 0 family inet filter input PROTECT-RE

Why: ge-0/0/22 is disabled. xe-0/1/0, irb and lo0 each have a description.

failFailing config: Unhardened EX2300 sample (Junos 15.1, synthetic)
set interfaces xe-0/1/0 description "Uplink to br-gwy-fw01 ge-0/0/1"
set interfaces xe-0/1/0 unit 0 family ethernet-switching interface-mode trunk
set interfaces irb unit 99 description "Switch management"
set interfaces irb unit 99 family inet address 192.0.2.22/24
set interfaces lo0 unit 0 family inet filter input PROTECT-RE

Why: irb has a description only on unit 99, and lo0 has none, so neither has one of its own.

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

Framework mapping. The rule provides evidence towards these controls. It does not certify anything.

Framework Reference
ISO/IEC 27001:2022 Annex A A.8.20

Tested with: sample excerpts from Junos 15.1 (synthetic) and Junos 23.2 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


Type to search.