Copy this scripts to /var/db/scripts/op directory and add this to your router configuration:
system {
scripts {
op {
file show-lsp-interface.slax;
}
}
}
This script prints extended view of all MPLS LSPs one per line. Line format depends on LSP type:
ingress:
i <LSP name> <LSP dst IP» <next-hop> <next-hop interface> <next-hop interface description>
egress:
e <LSP name> <LSP src IP» <prev-hop> <prev-hop interface> <prev-hop interface description>
transit:
t <LSP name> <LSP src IP» <LSP dst IP» <prev-hop> <next-hop> <prev-hop interface> <next-hop interface> <prev-hop interface description> <next-hop interface description>
Here is an example output:
cougar@r9-Tln-TIX> op show-lsp-interface t name dst next-hop if ifdescr I r9-Tln-TIX->r20-Tln-VS1 212.47.200.14 212.47.201.99 ae0.95 -> r20-ae0-95-Tln-TIX I r9-Tln-TIX->r20-Tln-TIX 212.47.200.20 212.47.201.99 ae0.95 -> r20-ae0-95-Tln-TIX t name src prev-hop if ifdescr E r20-Tln-TIX->r9-Tln-TIX 212.47.200.20 212.47.201.99 ae0.95 -> r20-ae0-95-Tln-TIX E r20-Tln-VS1->r9-Tln-TIX 212.47.200.14 212.47.201.99 ae0.95 -> r20-ae0-95-Tln-TIX t name src dst prev-hop next-hop src-if dst-if src-ifdescr dst-ifdescr T r9-Fra-Anct->r20-Tln-TIX 217.28.250.9 212.47.200.20 212.47.201.86 212.47.201.99 xe-5/3/0.1 ae0.95 -> r9-xe-5-3-0-1-Tln-Linx -> r20-ae0-95-Tln-TIX T r9-Tln-Linx->r2-Vno-Lnrg 212.47.200.4 217.28.248.2 212.47.201.86 212.47.201.99 xe-5/3/0.1 ae0.95 -> r9-xe-5-3-0-1-Tln-Linx -> r20-ae0-95-Tln-TIX
In case of some link congestion or other issues when you'd like to see what LSPs are going via particular link, it is very handy to take this list and match against interface name.
More information regarding this script is available at http://juniper.cluepon.net/index.php/OS_show-lsp-interface