Reinstall Junos from Loader with a USB

So as we were playing around with Ansible on our SRX’s we ended up breaking one of them. The status light became red and we got stuck at the db> prompt.  We tried different commands from that prompt and nothing worked, the device was rebooting and a ‘file system full’ error was showing up and after 30-40 seconds we were again at the db> prompt.

Continue reading

Use Juniper Device Console Port with Ansible

junos-ansibleAnsible is a very powerful tool for automating provisioning and maintenance tasks on Junos devices using the Py-EZ module. Usually you require at least SSH or Netconf set on the device for ansible to work but there will be times a student breaks your ansible-able configuration. Using the Juniper device’s console port we can have Ansible re-upload a configuration. In this guide we are just establishing a connection using the USB to RJ-45 console port and getting the Junos device information.
Continue reading

Create Observium Virtual Machine with Vagrant

Observium is a management software that runs on any device that can run a web server like Apache with PHP so we plan to run it on a Banana Pi. Observium will use SNMP to manage 16 Juniper SRX240 and 8 EX4200 devices. I wanted to test SNMPv3 settings on Junos and Observium virtually before moving into production. This guide assumes you have Vagrant and Virtualbox installed already. This script spins up an Ubuntu or Debian box and runs this shell script to automatically install Observium.

Continue reading

Use Python for Batch Commands on Junos Vagrant Machines

junos-pythonSometimes you have to enter a long list of commands to configure some service on Juniper devices. While it’s great practice for learning the command line sometimes you want things to go quickly. We were setting up Observium to manage SNMP on SRX devices in the lab and setting SNMP up is a long list of 20-something commands. This guide will show you how to use a text file filled with Junos commands and have python connect to the Juniper device and execute them all for you. It works on Linux (tested on Debian and Ubuntu) and Windows 8, 10.
Continue reading

Use Python with Junos Vagrant Virtual Machines

vagrant-junosIf you want to test using python to control Junos devices, you can do so with your Juniper Vagrant virtual machines. It makes it very easy to spin up and destroy Juniper virtual machines using Vagrant and Virtualbox. You can also test without having a physical Juniper ERX, SRX or other Junos device. This will work on Windows as long as you have installed Python 2.7.10 and make python part of your PATH variable (can be done during installation).
Continue reading