JUNOS Configuration Script

Purpose

This is a short description of what the configuration builder script does, and how to run it.
The script configures basic parameters, and makes configuring 100's of L2/L3VPN's etc much easier.
Quite useful in a lab environment

How to run

Both files should reside in the same directory.

$ ls -al

-rw-r--r--@   1 Sean  staff    146919 Dec  2 11:04 config_builder_v1.11.pl
-rw-r--r--@   1 Sean  staff     87040 Dec  3 09:22 config_builder_v1.11.xls



The script file looks for the excel spreadsheet on line 15
$configfile="config_builder_v1.11.xls";
You can adjust this to whatever you've called the file.

Then from any perl enabled box :
$ perl config_builder_v1.11.pl


This produces an output than can be used to cut & paste onto the router.


It may be easier to save to a file though ,
i.e.
$ perl config_builder_v1.11.pl -> routerconfig

Then merge the routerconfig file onto the router configuration file.

How to get it

You will need these 3 files

The script

Configuration Builder script
http://sites.google.com/site/junosconfigurator/home-page/Home/config_builder_v1.15.pl?attredirects=0



What you also need


Perl ! 
With the Spreadsheet:Parse:Excel plugin.
ActivePerl can do this for windows, which you can download from here
activestate

Caveats


Some old interfaces are not going to like the flexible-vlan-tagging, so you change this.
Only so- ge- xe- fe- ae- and as- interfaces allowed.
Others can be added, if desired.
I've found no reason why I should yet.

I'm not a programmer. I don't even know perl all that well, so this comes with no guarantee and no apologies if the programming looks like a dogs dinner !

There may be bugs ! If you find them, email sean1207@gmail.com and let me know !

The EXCEL spreadsheet


All Router parameters should be entered into the EXCEL spreadsheet. The perl script will read the spreadsheet.


Comments

Please send any comments to junosconfig@gmail.com

Sample Output


Very simple output below, check the Quick Reference Guide for much more

**core interface**
 
interfaces {
ae0 {
mtu 9192;
description "connection to adara";
unit 0 {
family inet {
address 10.177.182.2/30;
}
family iso;
family mpls;
}
}
}
 
**instance loopback interface**
 
interfaces {
lo0 {
unit 1000 {
family inet {
address 192.27.0.182;
}
}
}
}
 
**instance customer facing interface**
 
interfaces {
ge-0/0/0 {
description "connected to another_device";
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
unit 1000 {
vlan-id 1000;
family inet {
address 192.1.1.1/24 {
vrrp-group 101 {
virtual-address 192.1.1.10;
accept-data;
priority 200;
track {
interface so-0/3/0 {
priority-cost 100;
}
}
fast-interval 100;
}
}
}
}
}
}
 
**L3VPN routing instance**
 
routing-instances {
L3VPN-1000 {
routing-options {
autonomous-system 100;
}
instance-type vrf;
interface ge-0/0/0.1000;
interface lo0.1000;
route-distinguisher 192.27.0.182:1000;
vrf-target target:100:1000;
vrf-table-label;
protocols {
bgp {
traceoptions {
file bgp-debug-l3vpn1000;
flag open detail;
}
group external {
peer-as 1000;
local-address 192.1.1.1;
neighbor 192.1.1.2;
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
authentication-key juniper;
}
}
}
}
}

** some protocol samples **

protocols {
rsvp {
traceoptions {
file rsvp-debug;
flag error detail;
}
interface all {
authentication-key "$9$GTjkPFnCBIc5QIcylLXUjH"; ## SECRET-DATA
link-protection;
}
interface fxp0.0 {
disable;
}
}
mpls {
traceoptions {
file mpls-debug;
flag error;
}
smart-optimize-timer 60;
no-propagate-ttl;
icmp-tunneling;
optimize-timer 60;
label-switched-path gienah_2_adara {
to 192.27.0.182;
ldp-tunneling;
}
label-switched-path gienah_2_miranda {
to 192.27.0.211;
ldp-tunneling;
link-protection;
}
label-switched-path gienah_2_portia {
to 192.27.0.212;
ldp-tunneling;
node-link-protection;
}
label-switched-path gienah_2_sulafat {
to 192.27.0.250;
ldp-tunneling;
fast-reroute;
}
interface all;
}
bgp {
traceoptions {
file bgp-debug;
flag open detail;
}
mtu-discovery;
log-updown;
group internal {
type internal;
local-address 192.27.0.132;
family inet {
any;
}
family inet-vpn {
any;
}
family l2vpn {
signaling;
}
authentication-key "$9$lSyv87wYojHm-VHmfT/9evW"; ## SECRET-DATA
export nhs;
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
neighbor 192.27.0.182;
neighbor 192.27.0.211;
}
group internalv6 {
type internal;
local-address ::192:27:0:132;
family inet6 {
any;
}
authentication-key "$9$FpX56CuRhr8X-O1X-VwaJ369"; ## SECRET-DATA
neighbor ::192:27:0:182;
neighbor ::192:27:0:211;
}
group as10000 {
authentication-key "$9$j4H5FCA0Ihr"; ## SECRET-DATA
neighbor 100.1.1.2 {
peer-as 10000;
}
neighbor 100.1.1.3 {
peer-as 10000;
}
}
group as10000-v6 {
local-address 3ffe::1:1:1;
neighbor 3ffe::1:1:2 {
peer-as 10000;
}
neighbor 3ffe::1:1:3 {
peer-as 10000;
}
}
}
isis {
traceoptions {
file isis-debug;
flag hello detail;
}
reference-bandwidth 100g;
lsp-lifetime 65535;
spf-options delay 50;
level 2 wide-metrics-only;
level 1 disable;
interface ge-0/0/0.0 {
ldp-synchronization;
point-to-point;
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
interface xe-0/0/0.0 {
ldp-synchronization;
point-to-point;
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
interface ge-5/0/0.100;
interface ge-5/0/0.101;
interface ge-5/0/1.100;
interface ge-5/0/1.101;
interface ae0.0 {
ldp-synchronization;
point-to-point;
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
interface lo0.0;
}
ospf {
traceoptions {
file ospf-debug;
flag hello detail;
}
spf-options {
delay 50;
}
traffic-engineering;
reference-bandwidth 100g;
area 0.0.0.0 {
interface lo0.0;
interface xe-0/0/0.0 {
interface-type p2p;
ldp-synchronization;
authentication {
md5 1 key "$9$iqPQ/CuEclFnclKMN-Hqm"; ## SECRET-DATA
}
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
interface ge-0/0/0.0 {
interface-type p2p;
ldp-synchronization;
authentication {
md5 1 key "$9$C6aSpORreW-VYhSVYgojiAp0"; ## SECRET-DATA
}
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
}
}
ospf3 {
traceoptions {
file ospf3-debug;
flag hello detail;
}
spf-options {
delay 50;
}
reference-bandwidth 100g;
area 0.0.0.0 {
interface lo0.0;
interface xe-0/0/0.0;
interface ge-0/0/0.0;
interface ae0.0;
}
}
ldp {
traceoptions {
file ldp-debug;
flag error detail;
}
track-igp-metric;
interface ge-0/0/0.0;
interface xe-0/0/0.0;
interface ae0.0;
interface lo0.0;
session 192.27.0.101 {
authentication-key "$9$hzKyeWNdsJGiLxGik.zFcyl"; ## SECRET-DATA
}
session 192.27.0.132 {
authentication-key "$9$EO9SlM7-waZj8XZjHqQzhSr"; ## SECRET-DATA
}
}
pim {
traceoptions {
file pim-debug;
flag join detail;
}
rp {
static {
address 192.27.0.255;
}
}
interface all {
bfd-liveness-detection {
minimum-interval 300;
multiplier 3;
}
}
interface fxp0.0 {
disable;
}
interface ge-5/0/0.100;
interface ge-5/0/0.101;
interface ge-5/0/1.100;
interface ge-5/0/1.101;
}
l2circuit {
neighbor 192.27.0.101 {
interface ge-0/0/0.202 {
virtual-circuit-id 202;
}
}
neighbor 192.27.0.132 {
interface ge-0/0/1.206 {
virtual-circuit-id 206;
}
}
}
}

ĉ
Sean Clarke,
12 Feb 2009, 03:13
ċ
config_builder_v1.15.pl
(157k)
Sean Clarke,
26 Apr 2009, 13:12
Ĉ
Sean Clarke,
26 Apr 2009, 13:12
Comments