mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
net/frr: merge version 1.3 from master for #578
This commit is contained in:
parent
b48b368072
commit
55f583d011
19 changed files with 135 additions and 57 deletions
|
|
@ -1,5 +1,5 @@
|
|||
PLUGIN_NAME= frr
|
||||
PLUGIN_VERSION= 1.2
|
||||
PLUGIN_VERSION= 1.3
|
||||
PLUGIN_COMMENT= The FRRouting Protocol Suite
|
||||
PLUGIN_DEPENDS= frr ruby
|
||||
PLUGIN_CONFLICTS= quagga
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@
|
|||
<type>text</type>
|
||||
<help>The name of your Prefix-List, please choose one near to the result you want to achieve.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>prefixlist.version</id>
|
||||
<label>IP Version</label>
|
||||
<type>select_multiple</type>
|
||||
<help>Set the IP version to use.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>prefixlist.seqnumber</id>
|
||||
<label>Number</label>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<model>
|
||||
<mount>//OPNsense/quagga/bgp</mount>
|
||||
<description>BGP Routing configuration</description>
|
||||
<version>1.0.0</version>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
|
|
@ -15,7 +16,6 @@
|
|||
<networks type="CSVListField">
|
||||
<default></default>
|
||||
<Required>N</Required>
|
||||
<mask>/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2},)*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2})$/</mask>
|
||||
</networks>
|
||||
<redistribute type="OptionField">
|
||||
<Required>N</Required>
|
||||
|
|
@ -37,10 +37,9 @@
|
|||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
</enabled>
|
||||
<address type="TextField">
|
||||
<address type="NetworkField">
|
||||
<default></default>
|
||||
<Required>Y</Required>
|
||||
<mask>/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/</mask>
|
||||
</address>
|
||||
<remoteas type="IntegerField">
|
||||
<default></default>
|
||||
|
|
@ -154,6 +153,14 @@
|
|||
<default></default>
|
||||
<Required>Y</Required>
|
||||
</name>
|
||||
<version type="OptionField">
|
||||
<default>IPv4</default>
|
||||
<Required>Y</Required>
|
||||
<OptionValues>
|
||||
<IPv4>IPv4</IPv4>
|
||||
<IPv6>IPv6</IPv6>
|
||||
</OptionValues>
|
||||
</version>
|
||||
<seqnumber type="IntegerField">
|
||||
<default></default>
|
||||
<Required>Y</Required>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<model>
|
||||
<mount>//OPNsense/quagga/general</mount>
|
||||
<description>Quagga Routing configuration</description>
|
||||
<version>1.0.0</version>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<model>
|
||||
<mount>//OPNsense/quagga/ospf</mount>
|
||||
<description>OSPF Routing configuration</description>
|
||||
<version>1.0.0</version>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<model>
|
||||
<mount>//OPNsense/quagga/ospf6</mount>
|
||||
<description>OSPFv3 Routing configuration</description>
|
||||
<version>1.0.0</version>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<model>
|
||||
<mount>//OPNsense/quagga/rip</mount>
|
||||
<description>RIP Routing configuration</description>
|
||||
<version>1.0.0</version>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
|
|
|
|||
|
|
@ -162,9 +162,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
<script>
|
||||
|
||||
function quagga_update_status() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
|
|
@ -84,9 +84,7 @@ function translate(x) {
|
|||
return x;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
ajaxCall(url="/api/quagga/diagnostics/showipbgp", sendData={}, callback=function(data,status) {
|
||||
content = _.template($('#overviewtpl').html())(data['response'])
|
||||
|
|
|
|||
|
|
@ -96,9 +96,8 @@ dataconverters = {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status'])
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
ajaxCall(url="/api/quagga/diagnostics/generalroutes", sendData={}, callback=function(data,status) {
|
||||
content = _.template($('#routestpl').html())(data['response'])
|
||||
$('#routing').html(content)
|
||||
|
|
|
|||
|
|
@ -428,9 +428,7 @@ dataconverters = {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status'])
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
ajaxCall(url="/api/quagga/diagnostics/ospfoverview", sendData={}, callback=function(data,status) {
|
||||
content = _.template($('#overviewtpl').html())(data['response'])
|
||||
|
|
|
|||
|
|
@ -331,9 +331,7 @@ dataconverters = {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status'])
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
ajaxCall(url="/api/quagga/diagnostics/ospfv3overview", sendData={}, callback=function(data,status) {
|
||||
content = _.template($('#overviewtpl').html())(data['response'])
|
||||
|
|
|
|||
|
|
@ -41,18 +41,14 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
formatTokenizersUI();
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
});
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
// link save button to API set action
|
||||
$("#saveAct").click(function(){
|
||||
saveFormToEndpoint(url="/api/quagga/general/set", formid='frm_general_settings',callback_ok=function(){
|
||||
$("#saveAct_progress").addClass("fa fa-spinner fa-pulse");
|
||||
ajaxCall(url="/api/quagga/service/reconfigure", sendData={}, callback=function(data,status) {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
$("#saveAct_progress").removeClass("fa fa-spinner fa-pulse");
|
||||
});
|
||||
}, true);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
updateServiceControlUI('quagga');
|
||||
});
|
||||
|
||||
$("#logtable").bootgrid({
|
||||
ajax: true,
|
||||
navigation: 0,
|
||||
|
|
|
|||
|
|
@ -132,9 +132,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
<script>
|
||||
|
||||
function quagga_update_status() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
|
|
|||
|
|
@ -77,9 +77,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
<script>
|
||||
|
||||
function quagga_update_status() {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
|
|
|||
|
|
@ -43,18 +43,14 @@ $(document).ready(function() {
|
|||
$('.selectpicker').selectpicker('refresh');
|
||||
});
|
||||
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
|
||||
// link save button to API set action
|
||||
$("#saveAct").click(function(){
|
||||
saveFormToEndpoint(url="/api/quagga/rip/set",formid='frm_rip_settings',callback_ok=function(){
|
||||
$("#saveAct_progress").addClass("fa fa-spinner fa-pulse");
|
||||
ajaxCall(url="/api/quagga/service/reconfigure", sendData={}, callback=function(data,status) {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
updateServiceControlUI('quagga');
|
||||
$("#saveAct_progress").removeClass("fa fa-spinner fa-pulse");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,16 +17,6 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }}
|
|||
!
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.asnumber') and OPNsense.quagga.bgp.asnumber != '' %}
|
||||
router bgp {{ OPNsense.quagga.bgp.asnumber }}
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.networks') %}
|
||||
{% for network in OPNsense.quagga.bgp.networks.split(',') %}
|
||||
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' %}
|
||||
|
|
@ -34,17 +24,36 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
|
|||
{% if 'updatesource' in neighbor and neighbor.updatesource != '' %}
|
||||
neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
address-family ipv4 unicast
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.networks') %}
|
||||
{% for network in OPNsense.quagga.bgp.networks.split(',') %}
|
||||
{% if ':' not in network %}
|
||||
network {{ network }}
|
||||
{% endif %}
|
||||
{% 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') and ':' not in OPNsense.quagga.bgp.neighbors.neighbor.address %}
|
||||
{% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %}
|
||||
{% if neighbor.enabled == '1' and ':' not in neighbor.address %}
|
||||
{% if 'nexthopself' in neighbor and neighbor.nexthopself == '1' %}
|
||||
neighbor {{ neighbor.address }} next-hop-self
|
||||
neighbor {{ neighbor.address }} next-hop-self
|
||||
{% endif %}
|
||||
{% if 'defaultoriginate' in neighbor and neighbor.defaultoriginate == '1' %}
|
||||
neighbor {{ neighbor.address }} default-originate
|
||||
neighbor {{ neighbor.address }} default-originate
|
||||
{% endif %}
|
||||
{% if neighbor.linkedPrefixlistIn|default("") != "" %}
|
||||
{% for prefixlist in neighbor.linkedPrefixlistIn.split(",") %}
|
||||
{% set prefixlist2_data = helpers.getUUID(prefixlist) %}
|
||||
{% if prefixlist2_data != {} and prefixlist2_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist2_data.name }} in
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist2_data.name }} in
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
@ -52,7 +61,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
|
|||
{% for prefixlist in neighbor.linkedPrefixlistOut.split(",") %}
|
||||
{% set prefixlist_data = helpers.getUUID(prefixlist) %}
|
||||
{% if prefixlist_data != {} and prefixlist_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist_data.name }} out
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist_data.name }} out
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
@ -60,7 +69,7 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
|
|||
{% for aspath in neighbor.linkedRoutemapIn.split(",") %}
|
||||
{% set routemap2_data = helpers.getUUID(aspath) %}
|
||||
{% if routemap2_data != {} and routemap2_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap2_data.name }} in
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap2_data.name }} in
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
@ -68,19 +77,91 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
|
|||
{% for aspath in neighbor.linkedRoutemapOut.split(",") %}
|
||||
{% set routemap_data = helpers.getUUID(aspath) %}
|
||||
{% if routemap_data != {} and routemap_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap_data.name }} out
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap_data.name }} out
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %}
|
||||
{% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %}
|
||||
{% if neighbor.enabled == '1' and ':' in neighbor.address %}
|
||||
no neighbor {{ neighbor.address }} activate
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
exit-address-family
|
||||
!
|
||||
address-family ipv6 unicast
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.networks') and ':' in OPNsense.quagga.bgp.networks %}
|
||||
{% for network in OPNsense.quagga.bgp.networks.split(',') %}
|
||||
{% if ':' in network %}
|
||||
network {{ network }}
|
||||
{% endif %}
|
||||
{% 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' and ':' in neighbor.address %}
|
||||
neighbor {{ neighbor.address }} activate
|
||||
{% if 'nexthopself' in neighbor and neighbor.nexthopself == '1' %}
|
||||
neighbor {{ neighbor.address }} next-hop-self
|
||||
{% endif %}
|
||||
{% if 'defaultoriginate' in neighbor and neighbor.defaultoriginate == '1' %}
|
||||
neighbor {{ neighbor.address }} default-originate
|
||||
{% endif %}
|
||||
{% if neighbor.linkedPrefixlistIn|default("") != "" %}
|
||||
{% for prefixlist in neighbor.linkedPrefixlistIn.split(",") %}
|
||||
{% set prefixlist2_data = helpers.getUUID(prefixlist) %}
|
||||
{% if prefixlist2_data != {} and prefixlist2_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist2_data.name }} in
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if neighbor.linkedPrefixlistOut|default("") != "" %}
|
||||
{% for prefixlist in neighbor.linkedPrefixlistOut.split(",") %}
|
||||
{% set prefixlist_data = helpers.getUUID(prefixlist) %}
|
||||
{% if prefixlist_data != {} and prefixlist_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} prefix-list {{ prefixlist_data.name }} out
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if neighbor.linkedRoutemapIn|default("") != "" %}
|
||||
{% for aspath in neighbor.linkedRoutemapIn.split(",") %}
|
||||
{% set routemap2_data = helpers.getUUID(aspath) %}
|
||||
{% if routemap2_data != {} and routemap2_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap2_data.name }} in
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if neighbor.linkedRoutemapOut|default("") != "" %}
|
||||
{% for aspath in neighbor.linkedRoutemapOut.split(",") %}
|
||||
{% set routemap_data = helpers.getUUID(aspath) %}
|
||||
{% if routemap_data != {} and routemap_data.enabled == '1' %}
|
||||
neighbor {{ neighbor.address }} route-map {{ routemap_data.name }} out
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
exit-address-family
|
||||
!
|
||||
{% if helpers.exists('OPNsense.quagga.bgp.prefixlists.prefixlist') %}
|
||||
{% for prefixlist in helpers.sortDictList(OPNsense.quagga.bgp.prefixlists.prefixlist, 'name', 'seqnumber' ) %}
|
||||
{% if prefixlist.enabled == '1' %}
|
||||
{% if prefixlist.enabled == '1' and ':' not in prefixlist.network %}
|
||||
ip prefix-list {{ prefixlist.name }} seq {{ prefixlist.seqnumber }} {{ prefixlist.action }} {{ prefixlist.network }}
|
||||
{% endif %}
|
||||
!
|
||||
{% if prefixlist.enabled == '1' and ':' in prefixlist.network %}
|
||||
ipv6 prefix-list {{ prefixlist.name }} seq {{ prefixlist.seqnumber }} {{ prefixlist.action }} {{ prefixlist.network }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
!
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
defaultrouter="NO"
|
||||
frr_enable="{% if helpers.exists('OPNsense.quagga.general.enabled') and OPNsense.quagga.general.enabled == '1' %}YES{% else %}NO{% endif %}"
|
||||
|
||||
{% if helpers.exists('OPNsense.quagga.general.enabled') and OPNsense.quagga.general.enabled == '1' %}
|
||||
|
|
@ -14,5 +13,3 @@ if helpers.exists('OPNsense.quagga.ripng.enabled') and OPNsense.quagga.ripng.ena
|
|||
if helpers.exists('OPNsense.quagga.isis.enabled') and OPNsense.quagga.isis.enabled == '1' %} isisd{% endif %}"
|
||||
#frr_flags="...."
|
||||
#frr_extralibs_path="... ..."
|
||||
#router_enable="NO"
|
||||
watchfrr_enable="YES"
|
||||
|
|
|
|||
Loading…
Reference in a new issue