LSA issue #December 9, 2016 at 02:27PM

There is a popular saying that you don't need to be a programmer to automate your network. Might be true, though you definitely won't succeed in automation tasks without basic Regular Expressions knowledge, that you should take for granted.
Sad thing that regular expressions are not an easy nut to crack, and with this post we would like to share with you useful resources that will help you meet and greet RegExps!

#TipsTricks #Programming

http://ift.tt/xGwhyj — Mastering Regular Expressions, 3rd Edition.

http://ift.tt/1vDrJcd — a free and massive tutorial on RegExps

http://ift.tt/2fOuDYM — regexps collection for different tasks

https://regex101.com/ — the best online regexp engine to test and validate your regexps

http://ift.tt/1OR8EKT — solving regexps just for fun

http://ift.tt/1T6FiJy — book a place on your desk to hang this RE cheatsheet
By: via LSA

Read More...

BGP VPLS explained (Nokia & Juniper)

00_title

It may very well be that VPLS days are numbered and EVPN is to blame. Nevertheless, it would be naive to expect VPLS extinction in the near future. With all its shortcomings VPLS is still very well standardized, interop-proven and has a huge footprint in MPLS networks of various scale.

In this post I will cover theory and configuration parts for one particular flavor of VPLS signalling — BGP VPLS (aka Kompella VPLS) defined in RFC4761. I’ll start with simple single home VPLS scenario while multi-homing techniques and some advanced configurations will appear in separate post later.

In this topic the following SW releases were used:

Read More...

Basic IPv6 configuration for Nokia and Juniper routers

This is a quick IPv6 interface configuration tutorial for Nokia 7750 VSR (SROS) and Juniper vMX routers.

Read More...

Using guestfish to modify VM disk image

EarIier I wrote about some ways to modify VM disk images used by Unetlab. Basically it boils down to running a VM, console to it and change things through its shell. Obviously, this approach is no way near a handy way to do small changes like:

  • loading basic config
  • adding license files

In this post I will talk about guestfish utility which is a part of libguestfs tools set. With guestfish one could easily get a shell-like access to the filesystem located on a disk image (qcow2, vmdk, iso and many others). That is how authors of libguestfs tools describe it:

libguestfs is a set of tools for accessing and modifying virtual machine (VM) disk images. You can use this for viewing and editing files inside guests, scripting changes to VMs, monitoring disk used/free statistics, creating guests, P2V, V2V, performing backups, cloning VMs, building VMs, formatting disks, resizing disks, and much more.

libguestfs can access almost any disk image imaginable. It can do it securely — without needing root and with multiple layers of defence against rogue disk images. It can access disk images on remote machines or on CDs/USB sticks. It can access proprietary systems like VMware and Hyper-V.

To demonstrate the way how guestfish works I will solve a particular task of adding a license file to Nokia (Alcatel-Lucent) 7750 Virtual Service Router (VSR) by embedding it to the disk image itself. Tune in!

Read More...

BGP Route Reflection diagram

feature

I had plans to cover Nokia (Alcatel-Lucent) BGP Route Reflectors (BGP RR) in a full-featured post, but… But a lot of new stuff suddenly hit me as I joined Nuage Networks team.

Ok, lyrics aside, during my preparation for BGP exam I noticed that BGP route reflectors behavior defined throughout several chapters and there was no summary diagram (or cheatlist) that covered route reflectors decisions and actions. So, here you are:

This diagram shows the complete decision path of a BGP RR when it needs to reflect a route, including action items for different kind of neighbors (Non-client, Client, regular peer).

Note, that Nokia’s (Alcatel-Lucent) definitions were used for RIB structures (RIB-In, RIB-Out), though the decisions that RR has to make should no differ between vendors.

Download high-resolution file.

Read More...

STP/RSTP election process

Just a quick reminder on STP election process (thanks to Dmitry Figol):

  1. Choose Root bridge:
    1. lowest Bridge ID (priority + system mac)
    2. all ports on a Root bridge are designated
  2. Choose Root port on each non-root bridge:
    1. lowest path cost to the root
    2. lowest neighbor Bridge ID
    3. lowest neighbor’s Port ID (port priority + internal port number)
    4. lowest local Port ID (port priority + internal port number)
  3. Choose Designated port on each segment.
    1. bridge with the lowest root path cost
    2. bridge with the lowest Bridge ID
    3. interface with the lowest Port ID
  4. All other ports are non-designated/blocking

Read More...

Making a docker container for a Flask application

plaza_docker_ft

Recently I presented to you a project called PLAZA which basically serves as a Web UI for python scripts. It was a pleasure to see that this project was welcomed well and some folks even asked how they can get PLAZA to play with. My fault, I wanted to release it so bad that I missed the part describing how to actually get it.

One way to get PLAZA that was available since the beginning – is cloning the github repo and building python virtual environment with all the packages. And I understand that nowadays this way seems too complicated and the case is ideal for learning some docker!

Join me in this journey for integrating a simple Flask application into a docker container.

Read More...

Building Web front end for Python scripts with Flask

featured

Recently I revived my relationship with Python in an effort to beat routine tasks appearing here and there. So I started to write some pocket scripts and, luckily, was not the only one on this battlefield – my colleagues also have a bunch of useful scripts. With all those pieces of code sent in email, cloned from repos, grabbed on network shares I started to wonder how much easier would it be if someone aggregated all of them, made a Web UI and shared this experience.

Thus, I started to build web front-end to python scripts with these goals in mind:

  • allow people with zero python knowledge to use the scripts by interaction through simple Web UI;
  • make script’s output more readable by leveraging modern CSS and HTML formatting;
  • aggregate all the scripts in one repo but in a separate sandboxed directories to increase code manageability.

This short demo should give you some taste of what it is:

Disclaimer: I am nowhere near even a junior python or web developer. And what makes matters worse is that I used (a lot) very dangerous coding paradigm – SDD – Stackoverflow Driven Development. So, hurt me plenty if you see some awful mistakes.

Read More...

Retrieving network elements backup from 5620 SAM

Last week I faced a routine (and quite common) task to get the latest backups of current configuration and BOF files for ~700 routers on a customers network. Sure thing sane man would use some automatization techniques, which could be:

  • 5620 SAM scripts
  • some scripting language to grab latest backups from the global NE backup location on a SAM server

I tried it both ways and invite you under the cut to read about it.

Read More...

Workaround for virtualenvwrapper for windows postactivate script

Virtualenvwrapper’s windows port (virtualenvwrapper-win) helps to manage your venvs on windows platform, yet it is not so straigtforward about using hooks like postactivate. That is what official documentation has to say about this:

Hooks

To run some commands after mkvirtualenv you can use hooks. First you need to define VIRTUALENVWRAPPER_HOOK_DIR variable. If it is set mkvirtualenv will run postmkvirtualenv.bat script from that directory. Version 1.2.0 (16-03-2015)

I tried to set VIRTUALENVWRAPPER_HOOK_DIR and place postactivate.bat there, but it didnt work out. The workaround I found for emulating postactivate behaviour is to edit postactivate.bat which is located in %WORKON_HOME%\<VENV_NAME>\Scripts

Read More...