Posts

juniper copy scripts to other virtual-chassis

Recently added some op scripts and commit scripts on an juniper ex-4500 cluster with 3 members in the virtual-chassis. When you copy the scripts to the device it does not copy the scripts to the member devices you need to do this manually, you can do this from the device that contains the scripts to copy them over to the members in the virtual-chassis

to copy the scripts to the other members you can simply just do the following:

Below is the problem I saw on our devices:

juniper error: could not open op script: Permission denied

Permission denied when trying to open an op script

Recently I was updating an op-script and uploaded it with a different user and got the following error:

How to fix op script: Permission denied

It seems when you upload the script the permissions are only allowed for that particular user and no one else is able to read this file therefore we would update the permissions for the file using chmod, I believe there are other ways you can fix this but this is what i quickly figured out, see below the solution:

How to Install junos olive 12.1 on virtualbox

This guide below shows you where and how to download junos olive 12.1 and install it on virtualbox in very simple steps, you can then further extend this and create a mini lab, I’ve installed it to help me test my junos scripts.

1. download and install VirtualBox if you don’t already have it.
2. download the Juniper olive image: Download Juniper Junos Olive 12.1
3. double click the image file which will open in virtual-box

4. Apply the following base code if you would like access to the shell, I used a bridged interface which meant I was using my LAN (192.168.1.x/24) please select a free IP address in your LAN and adjust the config below, if you copy the encrypted hash the password is: [email protected]:

default username: root, with no password.

5. Open a shell and try access ssh [email protected]

Download Juniper Junos Olive 12.1

Note: From here you can download “JunOS Olive 12.1” VM image, you can run it with GNS3 or virtualbox for simulating juniper router. (Please note that this image is only provide to you for informational purpose and not to be used in production networks)

aspath-regex junos examples

I was working on looking at the juniper route table on a mx480 looking at the “show route receive-protocol bgp 38.104.127.169”.

Scenario 1: BGP including 3 or more or less AS paths with first element is constant

Reference:
Juniper : show route aspath-regex

Logging UP and DOWN events for routing protocols on juniper

Recently we found that having the junos logging level at notice level, we were not getting recovery events for our routing protocols, this is because juniper is logging DOWN events and UP events with different levels of severity (warning vs info).

In order to resolve this basically we can overwrite the severity levels of certain events we want to see all routing status information (up and down), and the below covers this.

Juniper logging config

additional config to show recorvery of routing protocols and bfd with notice level logging

Logging Results

OSPF flap logs

ISIS flap logs

BGP flap logs

Junos scripting in slax

If you are a newbie to the slax scripting here is an excellent online slax scripting engine and debug tool:

Junos Scripting references

troubleshooting on a junos device

Below a few quick tools for troubleshooting on a junos device