Every networking engineer would pick up some command as favorite one in IOS, IOS-XE, IOS-XR, NX-OS, Junos...
For me, one of the most useful commands in IOS-XR would be "formal".
What is the purpose of this command and how to use it?
Networkers which had opportunity to work with Junos like to use command "display set" when they want to figure out where in configuration key-word is appearing and shown like ready to use as config template. Example, I know that in network vrf TEST1 is configured, but it is annoying to search trough configuration to figure out where this vrf is used. If I just use command "display set", there is less job to do and it is time saving command.
>show configuration routing-instances TEST1 | display set
set routing-instances TEST1 instance-type vrf
set routing-instances TEST1 routing-options auto-export
set routing-instances TEST1 protocols bgp group HQ-WAN type external
set routing-instances TEST1 protocols bgp group HQ-WAN authentication-key /* SECRET-DATA */
set routing-instances TEST1 protocols bgp group HQ-WAN peer-as 64111
set routing-instances TEST1 protocols bgp group HQ-WAN neighbor 192.168.3.1 description "HQ-WAN"
set routing-instances TEST1 protocols bgp group HQ-WAN neighbor 192.168.3.1 import ALLOW_DEFAULT
set routing-instances TEST1 protocols bgp group HQ-WAN neighbor 192.168.3.1 export ALLOW-CONNECTED
set routing-instances TEST1 description "Layer 3 VPN for TEST1 Network"
set routing-instances TEST1 interface ae1.13 set routing-instances TEST1 interface ae2.14
set routing-instances TEST1 route-distinguisher 64501:2045
set routing-instances TEST1 vrf-import RT_IMPORT_TEST1
set routing-instances TEST1 vrf-export RT_EXPORT_TEST1
set routing-instances TEST1 vrf-table-label
What about Cisco images?
Well, show run | in TEST1, will not show, not even close, what we got from "didplay set" output in Junos.
But, Cisco has made progress in that direction with IOS-XR, providing more flexible configuration with section per future/protocol...
And yes, it has something very close to Junos "display set" command, it is "formal". Let's take a look in next example for vrf TEST1.
show run formal | in "vrf TEST1"
And voila:
vrf TEST1
vrf TEST1 description *** Layer 3 VPN for TEST1 Network ***
vrf TEST1 address-family ipv4 unicast
vrf TEST1 address-family ipv4 unicast import route-target 64501:500
vrf TEST1 address-family ipv4 unicast import route-target 64501:503
vrf TEST1 address-family ipv4 unicast export route-target 64501:504 interface Bundle-Ether5.12
vrf TEST1 interface Bundle-Ether5.13 vrf TEST1 interface Bundle-Ether5.14 vrf TEST1 router bgp 64501
vrf TEST1 router bgp 64501 vrf TEST1 rd 64501:2045 router bgp 64501
vrf TEST1 address-family ipv4 unicast router bgp 64501
vrf TEST1 neighbor 192.168.3.1 router bgp 64501
vrf TEST1 neighbor 192.168.3.1 remote-as 64111 router bgp 64501
vrf TEST1 neighbor 192.168.3.1 ebgp-multihop 2 router bgp 64501
vrf TEST1 neighbor 192.168.3.1 description Test_WAN router bgp 64501
vrf TEST1 neighbor 192.168.3.1 update-source Bundle-Ether5.12 router bgp 64501
vrf TEST1 neighbor 192.168.3.1 address-family ipv4 unicast router bgp 64501
vrf TEST1 neighbor 192.168.3.1 address-family ipv4 unicast route-policy ALLOW_DEFAULT in router bgp 64501
vrf TEST1 neighbor 192.168.3.1 address-family ipv4 unicast route-policy ALLOW-CONNECTED out router bgp 64501
vrf TEST1 neighbor 192.168.3.1 address-family ipv4 unicast soft-reconfiguration inbound
Junos display set and IOS-XR formal save me a lot of time and effort

