[j-nsp] Configuring 200+ BGP sessions via script

Niall Donaghy niall.donaghy at geant.org
Mon Sep 17 09:30:55 EDT 2018


Hi Matthew,

Similarly to how James achieved his goals, I have a Bash script that does the same thing in different ways: it generates Juniper set commands and uses SSH.

The basic steps, eg: 'wget <URL>', 'cat config.txt | ssh -T', etc. are all one-liners.
Depending on your requirements and scripting-fu, this can be written, tested, deployed in a few hours.

Before writing my own script for this purpose (several years ago), I did look around for OSS solutions.
I find these kinds of tools don't require much development or maintenance, whereas integrating with other OSS tools often requires a lot of learning, integration, and/or custom code.
Any missing features or quirks in implementation require you to rectify with your own automation, or request patches, or patch the code yourself.

It was my preference to go as the crow flies and write my own. YMMV, HTH, my 2c, etc.

Niall


Niall Donaghy
Senior Network Engineer
GÉANT
T: +44 (0)1223 371393
M: +44 (0) 7557770303
Skype: niall.donaghy-dante
PGP Key ID: 0x77680027
nic-hdl: NGD-RIPE

Networks • Services • People 
Learn more at www.geant.org​
​​ 
GÉANT Vereniging (Association) is registered with the Chamber of Commerce in Amsterdam with registration number 40535155 and operates in the UK as a branch of GÉANT Vereniging. Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands. UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK.  



-----Original Message-----
From: juniper-nsp [mailto:juniper-nsp-bounces at puck.nether.net] On Behalf Of James Bensley
Sent: 12 September 2018 17:57
To: matthew at corp.crocker.com; juniper-nsp <juniper-nsp at puck.nether.net>
Subject: Re: [j-nsp] Configuring 200+ BGP sessions via script

On Wed, 12 Sep 2018 at 13:17, Matthew Crocker <matthew at corp.crocker.com> wrote:
>
>
> Hello,
>
> I’m turning up some peering in New York in the coming weeks (NYIIX, DE-CIX) and will need to configure several hundred BGP sessions.   Is there an easy (open source) way of managing the BGP sessions & generating automatic configurations?  Would be great if you could pull down from peeringdb and crank out BGP group configs.
>
> Thanks

Other better options have been provided however, they are peering specific. You could use this as an opportunity to step towards automating other bits of config changes (if you haven't already).

I went through the same issue a couple of years ago. I wrote an ugly Python script that would query peering DB for all peers on a specific LAN that didn't have a restrictive peering policy and build the config using OpenConfig YANG models, serialise it as JSON, and send it over gRPC to ASR9000 devices:
https://null.53bits.co.uk/index.php?page=example-2-public-peering-using-openconfig

You could write a better script than mine but then use your new script as a stepping stone to automate other stuff using YANG models.

Cheers,
James.
_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net https://puck.nether.net/mailman/listinfo/juniper-nsp


More information about the juniper-nsp mailing list