Netops with Emacs and Org mode

Vincent Bernat

Org mode is a pack­age for Emacs to “keep notes, main­tain todo lists, plan­ning projects and au­thor­ing doc­u­ments.” It can ex­e­cute em­bed­ded snip­pets of code and cap­ture the out­put (through Ba­bel). It’s an in­valu­able tool for doc­u­ment­ing your in­fra­struc­ture and your op­erations.

Here are three (rel­a­tively) short videos ex­hibit­ing Org mode use in the con­text of net­work op­er­a­tions. In all of them, I am us­ing my own junos-mode which fea­tures the fol­low­ing perks:

  • syn­tax high­light­ing for con­fig­u­ra­tion files;
  • com­mit of con­fig­u­ra­tion snip­pets to re­mote de­vices; and
  • ex­e­cu­tion of re­mote commands.

Since some Junos de­vices can be quite slow, com­mits and re­mote ex­e­cu­tions are done asyn­chronously1 with the help of a Python helper.

In the first video, I take some notes about con­fig­ur­ing BGP add-path fea­ture (RFC 7911). It demon­strates all the avail­able fea­tures of junos-mode.

In the sec­ond video, I ex­e­cute a planned op­er­a­tion to en­able this fea­ture in pro­duc­tion. The doc­u­ment is a modus operandi and con­tains the con­fig­u­ra­tion to ap­ply and the com­mands to check if it works as ex­pected. At the end, the doc­u­ment be­comes a de­tailed re­port of the op­eration.

In the third video, a cook­book has been pre­pared to ex­e­cute some changes. I set some vari­ables and ex­e­cute the cook­book to ap­ply the change and check the result.