Hard to describe what I'm asking. For example, here's a section of my config, with the full hierarchy:
interfaces {
ge-0/1/9 {
vlan-tagging;
unit 100 {
description "my cool interface";
vlan-id 100;
family inet {
address 192.168.66.66/25;
}
}
}
}
So now I want to see what's up on the interface where I have that "66" IP. Hooray | match
!
But this:
me@router> show configuration | match 66
address 192.168.66.66/25;
... is not that useful. This:
me@router> show configuration | match 66 | display set
set interfaces ge-0/1/9 unit 100 family inet address 192.168.66.66/25
me@router> show configuration interfaces ge-0/1/9.100
description "my cool interface";
vlan-id 100;
family inet {
address 192.168.66.66/25;
}
... is better. But what I'd really like is that whole config chunk from above, with one easy show
command. Something like this:
me@router> show configuration | match 66 | display section
interfaces {
ge-0/1/9 {
unit 100 {
description "my cool interface";
vlan-id 100;
family inet {
address 192.168.66.66/25;
}
}
}
}
I know | display section
doesn't exist on Junos, but is there any way to get an output like this?
show configuration | find 66
(and then possibly scroll a few lines back)?/
<enter> brings you to the next search result? I guess you could do some tricks with slax if you feel brave enough, or code something using netconf, pyez, if you really want what you describe. I don' think it's possible the way you describe it without any additional work.