Well, my good buddy John over at LameJournal recently wrote a cool article on how to use some little nuances in Juniper EX virtual chassis naming behavior to catch glimpses of which member you might have connected to (even via console). If you are unfamiliar with Juniper’s EX series switch Virtual Chassis technology, you may think I’m crazy when I mention not knowing which switch member you are connected to when connecting via the serial console. In a Juniper Virtual Chassis, when you connect to the serial console of ANY VC switch member, it will automatically redirect you to the master switch upon successful login. Pretty cool, right? Well, not if you are trying to know which actual member you’re logged into.

John’s EX naming article gave us some hints to see which member you actually connected to, versus the master switch (aka master routing engine in Juniper speak), but while John’s solution with apply-groups was pretty clever, a colleague of mine said that would never work in his production environment.

If you are like me, that comment might have perplexed you, considering how elegant John’s solution seemed, but believe me, my colleague (who is a pretty bright guy) had a valid complaint. He happens to be an avid SNMP guru, and he said that if all the members in the VC have a distinct name, then using his favorite SNMP monitoring tool (a custom-built work of art), it would throw off all aggregated statistics for the VC, as they would now be indexed independently based on the reported device name, thus defeating part of the purpose of this being managed as one device. One of the ideas that came to mind, was “can we use some sort of banner message?” — Yes, yes we can.

So the real answer to this question lies in a couple of features available in JUNOS. We will still use the apply-group mentality from John’s post, but we will not remove the common VC name, as we need that for the SNMP statistical aggregation for the entire VC. So if we’re not using the apply groups for the names, then what are we using them for? To set member specific banner information for each member. JUNOS allows for pre-login banners as well as post-login banners. By using both of these, we are able to implement a pretty cool solution. See below:

Here’s the set version of the config I implemented for a 3 member VC config.

NSG@labsw01> show configuration groups | display set
 set groups member0 system host-name labsw01a
 set groups member0 system login announcement "You are now logged in to: labsw01a\n"
 set groups member0 system login message "You are now logged in to: labsw01a"
 set groups member1 system host-name labsw01b
 set groups member1 system login announcement "You are now logged in to: labsw01b\n"
 set groups member1 system login message "You are now logged in to: labsw01b"
 set groups member2 system host-name labsw01c
 set groups member2 system login announcement "You are now logged in to: labsw01c\n"
 set groups member2 system login message "You are now logged in to: labsw01c"

Also, the host-name is still set under the system stanza as “labsw01”

So now…when we connect to the console port of member 3 (aka labsw01c), we see this:

You are now logged in to: labsw01c
labsw01 (ttyu0)
login: NSG
Logging to master
 Password:
--- JUNOS 12.3R3.4 built 2013-06-14 00:08:02 UTC
You are now logged in to: labsw01b
 {master:1}
 NSG@labsw01>

Voila! We now satisfy the common host-name needed by the SNMP collection tools, and we can see which device we connect to via the actual console, as well as knowing which member we are redirected to after login. Even with highly schizophrenic EX switches, problem solved. 🙂

(BTW, look for a coming article from yours truly regarding apply-group usefulness)

2 thoughts on “Wait…what was your name again?

Leave a Reply