TIP: Searching where a specific statement is applied
In many cases, searching inside the configuration file for where a specific info is applied can be tiring specially if the configuration file is large.
For example, searching the entire configuration:
- if we need to locate where a certain prefix is configured: within Prefix-list, and/or within term in policy-statement and/or in a static/aggregate route.
- if we need to find where a specific policy is applied: in a routing protocol and/or in a routing-instance and/or as a nested policy within another policy.
- if we need to know where a community or a firewall filter or an LSP is applied.
lab@test# show | match xxx | display set
Searching for where the filter named "my-filter" is applied -> output shows that it's applied at lo0 (input) and ge-1/1/1 (output)
lab@test> show conf | match my-filter | display set
set interfaces ge-1/1/1 unit 16 family inet filter output my-filter
set interfaces lo0 unit 0 family inet filter input my-filter
set firewall filter my-filter term term-1 from source-address 220.127.116.11/24
set firewall filter my-filter term term-1 then accept
set firewall filter my-filter term term-2 from destination-port telnet
set firewall filter my-filter term term-2 then reject
set firewall filter my-filter term term-3 then accept