From 92e2c6dac9b742dc3b6cdfb39df0e0306b5820f9 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Jun 2017 14:57:02 +0200 Subject: [PATCH] Update to bgpd.conf templating (#186) * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * Update bgpd.conf * fixed problem with enable/disable items disabling an item was not recognized by template * Update dialogEditBGPASPath.xml * bump to 1.3.1 small updates to templating and a typo in help which is not accepted by quagga itself * Small typo, last one Sorry * Added redistribute While chasing a bug for multiple redistributes I found that I completely forgot to add redistribution to templating. I'll use this PR since it's a small change * Remove PIM removed PIM as it is not valid with BGP config --- net/quagga/Makefile | 2 +- .../OPNsense/Quagga/forms/dialogEditBGPASPath.xml | 2 +- .../opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml | 1 - .../service/templates/OPNsense/Quagga/bgpd.conf | 13 +++++++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/net/quagga/Makefile b/net/quagga/Makefile index 3d8ef8617..06f8711d8 100644 --- a/net/quagga/Makefile +++ b/net/quagga/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= quagga -PLUGIN_VERSION= 1.3.0 +PLUGIN_VERSION= 1.3.1 PLUGIN_COMMENT= Quagga Routing Suite PLUGIN_DEPENDS= quagga ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPASPath.xml b/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPASPath.xml index 1a3f42f7d..d195d6081 100644 --- a/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPASPath.xml +++ b/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPASPath.xml @@ -21,6 +21,6 @@ aspath.as text - The AS pattern you want to match, regexp allowed (e.g. *$ or _1$). It's not validated so please be careful! + The AS pattern you want to match, regexp allowed (e.g. .$ or _1$). It's not validated so please be careful! diff --git a/net/quagga/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/quagga/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index f5c952faa..349e223c5 100644 --- a/net/quagga/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/quagga/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -27,7 +27,6 @@ Connected routes (directly attached subnet or host) Intermediate System to Intermediate System (IS-IS) Kernel routes (not installed via the zebra RIB) - Protocol Independent Multicast (PIM) Routing Information Protocol (RIP) Statically configured routes diff --git a/net/quagga/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/quagga/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index f57033bc2..3783dfaba 100644 --- a/net/quagga/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/quagga/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -14,6 +14,11 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} network {{ network }} {% endfor %} {% endif %} +{% if helpers.exists('OPNsense.quagga.bgp.redistribute') and OPNsense.quagga.bgp.redistribute != '' %} +{% for bgp_redistribute in OPNsense.quagga.bgp.redistribute.split(',') %} + redistribute {{ bgp_redistribute }} +{% endfor %} +{% endif %} {% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %} {% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %} {% if neighbor.enabled == '1' %} @@ -30,7 +35,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if neighbor.linkedPrefixlistIn|default("") != "" %} {% for prefixlist in neighbor.linkedPrefixlistIn.split(",") %} {% set prefixlist2_data = helpers.getUUID(prefixlist) %} -{% if prefixlist2_data != '' %} +{% if prefixlist2_data != {} and prefixlist2_data.enabled == '1' %} neighbor {{ neighbor.address }} prefix-list {{ prefixlist2_data.name }} in {% endif %} {% endfor %} @@ -38,7 +43,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if neighbor.linkedPrefixlistOut|default("") != "" %} {% for prefixlist in neighbor.linkedPrefixlistOut.split(",") %} {% set prefixlist_data = helpers.getUUID(prefixlist) %} -{% if prefixlist_data != '' %} +{% if prefixlist_data != {} and prefixlist_data.enabled == '1' %} neighbor {{ neighbor.address }} prefix-list {{ prefixlist_data.name }} out {% endif %} {% endfor %} @@ -46,7 +51,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if neighbor.linkedRoutemapIn|default("") != "" %} {% for aspath in neighbor.linkedRoutemapIn.split(",") %} {% set routemap2_data = helpers.getUUID(aspath) %} -{% if routemap2_data != '' %} +{% if routemap2_data != {} and routemap2_data.enabled == '1' %} neighbor {{ neighbor.address }} route-map {{ routemap2_data.name }} in {% endif %} {% endfor %} @@ -54,7 +59,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if neighbor.linkedRoutemapOut|default("") != "" %} {% for aspath in neighbor.linkedRoutemapOut.split(",") %} {% set routemap_data = helpers.getUUID(aspath) %} -{% if routemap_data != '' %} +{% if routemap_data != {} and routemap_data.enabled == '1' %} neighbor {{ neighbor.address }} route-map {{ routemap_data.name }} out {% endif %} {% endfor %}