FRR: add ui fields for https://github.com/opnsense/plugins/issues/2091 and basic template to store carp setting into (to be unsed in the event handler)

This commit is contained in:
Ad Schellevis
2020-11-16 16:53:02 +01:00
committed by Ad Schellevis
parent 475d76b128
commit d4d0449dc9
4 changed files with 35 additions and 0 deletions
@@ -37,6 +37,18 @@
<label>Cost</label>
<type>text</type>
</field>
<field>
<id>interface.cost_demoted</id>
<label>Cost (when demoted)</label>
<type>text</type>
</field>
<field>
<id>interface.carp_depend_on</id>
<label>Depend on (carp)</label>
<type>dropdown</type>
<help>The carp VHID to depend on, when this virtual address is not in master state,
the interface cost will be set to the demoted cost (specified above).</help>
</field>
<field>
<id>interface.hellointerval</id>
<label>Hello Interval</label>
@@ -165,6 +165,17 @@
<MaximumValue>4294967295</MaximumValue>
<ValidationMessage>Cost must be between 0 and 4294967295.</ValidationMessage>
</cost>
<cost_demoted type="IntegerField">
<default></default>
<MinimumValue>0</MinimumValue>
<Required>N</Required>
<MaximumValue>4294967295</MaximumValue>
<ValidationMessage>Cost must be between 0 and 4294967295.</ValidationMessage>
</cost_demoted>
<carp_depend_on type="VirtualIPField">
<type>carp</type>
<Required>N</Required>
</carp_depend_on>
<hellointerval type="IntegerField">
<default></default>
<MinimumValue>0</MinimumValue>
@@ -1,5 +1,6 @@
bgpd.conf:/usr/local/etc/frr/bgpd.conf
ospfd.conf:/usr/local/etc/frr/ospfd.conf
ospfd_carp.conf:/usr/local/etc/frr/ospfd_carp.conf
ospf6d.conf:/usr/local/etc/frr/ospf6d.conf
ripd.conf:/usr/local/etc/frr/ripd.conf
frr:/etc/rc.conf.d/frr
@@ -0,0 +1,11 @@
{% if helpers.exists('OPNsense.quagga.ospf.interfaces.interface') %}
{% for interface in helpers.toList('OPNsense.quagga.ospf.interfaces.interface') %}
{% if interface.enabled == '1' %}
[interface_interface.interfacename]
interface={{interface.interfacename}}
default_cost={{interface.cost|default('10')}}
demoted_cost={{interface.cost_demoted|default('')}}
carp_depend_on={{interface.carp_depend_on|default('')}}
{% endif %}
{% endfor %}
{% endif %}