Saturday 25 January 2014

F, G and H

Now where did I put it?


Finding where I, or someone else, put something is part of being human.  This is especially so when configuring and troubleshooting routers - configuration files are rarely short, and there's always more than one of them, subtly related to each other.

Here's some tips to help if you're working with Routlets - in increasing order of usefulness.

Find


No surprise here.  If you open a router configuration in Routlets, you can press Ctrl+F to search the configuration file.  You can do the same through the Junos CLI ( show | match ), though the editor shows the match in the context of the rest of the configuration file.

Go to


Junos configuration files are very neatly structured by section, and every section has a unique edit path, e.g. you'll see [edit interfaces ge-0/0/0 unit 0] in the CLI.  If you're a true CLI junky, you may have tried typing "cd" instead of "edit" to change levels?

Similarly Routlets can hop around a configuration file by edit path - press Ctrl+G.  At each level in the edit path the next level sections are shown (like pressing ? on the CLI), but there are a couple more tricks to know.

Wildcards - to save stepping through all the levels, start the edit path with the asterisk '*' symbol.  This will cut to a match at any level in the configuration file.  This is usually quicker than using Ctrl+F to find a match, as all the matches are listed to be reviewed at a glance.

CapsForHyphen - is a way to separate matching sections.  For example, a common 'collision' in a Junos edit path is between the top-level sections "routing-options" and "routing-instances" - normally with the CLI it is necessary to type the matching letters before the auto complete can work.  An upper case letter can be used in Routlets to cut through.  Just type "rO" to match ahead to the "o" of "options", after the hyphen '-' symbol.

Search


For when you don't know which router to look on (e.g. where was the IP address configured) try Ctrl+H to search.  This is a free text search and works from an index - there's no need to connect to any router.  All the normal search engine rules apply too - e.g. search for one or more words near each other, combine searches with 'and' and 'or', or "quote a phrase" for an exact search.

It seems like a small thing, but if a word is selected anywhere in Routlets when a search is started, the search defaults to that word.  This can come in very handy when troubleshooting.  For example to hunt down the source of a route in the output from a show route command, select that IP address and press Ctrl+H.  This will quickly get you to the router concerned.

Summary


These features make it easy to find your way around a set of routers.  Of course they are there on the menus and toolbars in Routlets, but you may find you can remember the keystokes now.