Skip to content

Commit

Permalink
net/frr - BGP weight option and bug fix for disable-connected-check o…
Browse files Browse the repository at this point in the history
…ption (opnsense#2993)

* net/frr add bgp weight attribute and move disable-connected-check to the correct place. it looked like "community lists" missed a toggle action, added that as well.
  • Loading branch information
AdSchellevis authored Jun 3, 2022
1 parent 7395539 commit 3370683
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ public function setRoutemapAction($uuid)
return $this->setBase('routemap', 'routemaps.routemap', $uuid);
}

public function toggleCommunitylistAction($uuid)
{
return $this->toggleBase('communitylists.communitylist', $uuid);
}

public function toggleNeighborAction($uuid)
{
return $this->toggleBase('neighbors.neighbor', $uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<advanced>true</advanced>
<help>Set a password for BGP authentication.</help>
</field>
<field>
<id>neighbor.weight</id>
<label>Weight</label>
<type>text</type>
<advanced>true</advanced>
<help>Specify a default weight value for the neighbor’s routes.</help>
</field>
<field>
<id>neighbor.localip</id>
<label>Local Initiater IP</label>
Expand Down
6 changes: 6 additions & 0 deletions net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
<password type="TextField">
<Required>N</Required>
</password>
<weight type="IntegerField">
<default></default>
<Required>N</Required>
<MinimumValue>0</MinimumValue>
<MaximumValue>65535</MaximumValue>
</weight>
<localip type="NetworkField">
<Required>N</Required>
</localip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
{% if 'password' in neighbor and neighbor.password != '' %}
neighbor {{ neighbor.address }} password {{ neighbor.password }}
{% endif %}
{% if 'weight' in neighbor and neighbor.weight != '' %}
neighbor {{ neighbor.address }} weight {{ neighbor.weight }}
{% endif %}
{% if 'disable_connected_check' in neighbor and neighbor.disable_connected_check == '1' %}
neighbor {{ neighbor.address }} disable-connected-check
{% endif %}
{% if ':' not in neighbor.address and 'updatesource' in neighbor and neighbor.updatesource != '' %}
neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }}
{% endif %}
Expand Down Expand Up @@ -106,9 +112,6 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
{% if 'asoverride' in neighbor and neighbor.asoverride == '1' %}
neighbor {{ neighbor.address }} as-override
{% endif %}
{% if 'disable_connected_check' in neighbor and neighbor.disable_connected_check == '1' %}
neighbor {{ neighbor.address }} disable-connected-check
{% endif %}
{% if neighbor.linkedPrefixlistIn|default("") != "" %}
{% for prefixlist in neighbor.linkedPrefixlistIn.split(",") %}
{% set prefixlist2_data = helpers.getUUID(prefixlist) %}
Expand Down

0 comments on commit 3370683

Please sign in to comment.