I've scheduled to write a post regarding Junos load balancing but I must carry out more tests before writing it.
So I decided to post my code of a troubleshooting 'op' script which allows to display in one command all protocols related information of a given Interface.
The 'op' script is called allinone.slax. It has been tested from release 10.2. You can simply download it : here
After that just upload it in the directory /var/db/scripts/op/ of your router and activate the script by entering the following command :
edit exclusive
set system scripts op file allinone.slax
commit sync and-quit
Now, you can play with it. The command is called by the following command :
lab@bob> op allinone ?
Possible completions:
<[Enter]> Execute this command
<name> Argument name
detail Display detailed output
instance Specified instance name
interface Specified interface name
protocols 'all' or 'o' ospf 'i' isis 'm' mpls 'l' ldp 'r' rsvp 'p' pim ex.: iml for isis mpls ldp
You can provide 3 parameters :
- interface : Mandatory – the interface name
- instance : Optional – the routing-instance name (default master instance)
- protocols : Optional – the protocols that you want to view (default all protocols)
The command supports OSPF, ISIS, MPLS, LDP, RSVP and PIM protocols. For example if you want to show all information for all the protocols just enter :
lab@bob> op allinone interface xe-1/0/0.0
Tue Feb 11 14:38:39 2012
Interface : xe-1/0/0.0
Description : From Bob to Patrick
-------------------
OSPF informations :
-------------------
Interface : xe-1/0/0.0
Area : 0.0.0.0
Sync LDP : in sync
Auth inf : MD5
Cost : 125
Hello Time : 10
Adjacency info:
Neighbor IP : 10.253.193.18
State : Full
-------------------
ISIS informations :
-------------------
Interface : xe-1/0/0.0
Level : 3
Sync LDP : in sync
Adjacency info:
Neighbor : patrick
State : Up
Level(s) info :
Level 1 metric 3 hello-time 3.000
Level 2 metric 25 hello-time 3.000
Auth info :
Level 1 IIH Auth : MD5 CSN Auth: None PSN Auth: None
Level 2 IIH Auth : None CSN Auth: None PSN Auth: None
-------------------
MPLS informations :
-------------------
Interface : xe-1/0/0.0
State : Up
Admin Group : red
-------------------
LDP informations :
-------------------
Interface : xe-1/0/0.0
Neighbor addr : 10.253.193.18
Holdtime : 15
Type : discovered
-------------------
RSVP informations :
-------------------
Interface : xe-1/0/0.0
State : Ena/Up
Hello Time : 9
Aggregate ? : NoAggregate
Protection ? : NoLinkProtection
Subscription : 100%
Available BW : 10Gbps
-------------------
PIM informations :
-------------------
Interface : xe-1/0/0.0
State : Up / NotDR
IP version : 4
Mode : Sparse
Join count : 10 (S;G) / 0 (*;G)
Adjacency info:
Neighbor : 10.253.193.18
State : UP since 00:15:40
Otherwise, if you prefer to show only ISIS, MPLS and LDP information, just enter :
lab@bob> op allinone interface xe-1/0/0.0 protocols iml
Tue Feb 14 14:57:34 2012
Interface : xe-1/0/0.0
Description : From Bob to Patrick
-------------------
ISIS informations :
-------------------
Interface : xe-1/0/0.0
Level : 3
Sync LDP : in sync
Adjacency info:
Neighbor : patrick
State : Up
Level(s) info :
Level 1 metric 3 hello-time 3.000
Level 2 metric 25 hello-time 3.000
Auth info :
Level 1 IIH Auth : MD5 CSN Auth: None PSN Auth: None
Level 2 IIH Auth : None CSN Auth: None PSN Auth: None
-------------------
MPLS informations :
-------------------
Interface : xe-1/0/0.0
State : Up
Admin Group : red
-------------------
LDP informations :
-------------------
Interface : xe-1/0/0.0
Neighbor addr : 10.253.193.18
Holdtime : 15
Type : discovered
David.