Squashed commit of the following:

commit 5087edf5211a41dc903c4ceca90e39c2d36616f6
Author: Ad Schellevis <ad@opnsense.org>
Date:   Sat Apr 13 17:56:09 2024 +0200

    net/frr - style cleanups for https://github.com/opnsense/plugins/pull/3759 , including the use of https://github.com/opnsense/core/commit/2d45b78f744059089078d56b3c108765b2d23608 to return all fields on search for the controller in question.

commit c121bb855d29cbb8cbf649b234d642c2120faa8c
Author: Franco Fichtner <franco@opnsense.org>
Date:   Tue Mar 5 17:23:56 2024 +0100

    net/frr: bump revision for change

commit 0091d4679d237dfb7d67f9817c65a040c1207d51
Author: Franco Fichtner <franco@opnsense.org>
Date:   Tue Feb 6 09:02:13 2024 +0100

    net/frr: wrap up next version

commit 41d7c2d12203ef5abdc15c8634c986f95e955f27
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 26 06:42:52 2024 +0100

    Update bgpd.conf

commit 63e4be87d070c8847582bf50186b2438b33f49ee
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 16:56:01 2024 +0100

    Update bgp.xml

commit 22880d7d4d248f4e8e00296d180572b0839b9a5a
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 16:50:16 2024 +0100

    Update bgpd.conf

commit e5b5ee38198d13dfb1be995acd75c7eb98fbb113
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 16:44:26 2024 +0100

    Update bgpd.conf

commit f7d7630d76766425aab780d7f1712d52dc9d8a08
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 16:42:43 2024 +0100

    add distance

commit 30e479ee559a04a9c32d53ce46db77899b5555ab
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 16:22:25 2024 +0100

    Update bgpd.conf

commit fbc89c7aeb88b73ac155e49b85a097bd2d527b7e
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 09:38:47 2024 +0100

    Update BGP.xml

commit f18d80733661da36ffc6bf1c0c7006b211a6b21c
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 09:36:21 2024 +0100

    Update BGP.xml

commit b10a53ac52f3d1c38be90d389892eb390ef0439a
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 08:33:33 2024 +0100

    typos

commit fd2d9d71b11e801ad52bb66e08be61aa1622917e
Author: Michael <m.muenz@gmail.com>
Date:   Fri Jan 12 07:58:49 2024 +0100

    bgp-group support
This commit is contained in:
Ad Schellevis
2024-04-13 17:59:05 +02:00
parent 7a5c968dc5
commit cfc2bdf89c
9 changed files with 336 additions and 79 deletions
+4
View File
@@ -14,6 +14,10 @@ Plugin Changelog
1.39
* Add plain password authentication to OSPF
* Set multihop value to 255 (contributed by Cogan Ng Jun Lin)
* Add distance to BGP
* Add BGP peer-group support
* Add plain password authentication to OSPF
* Set multihop value to 255 (contributed by Cogan Ng Jun Lin)
@@ -1,9 +1,9 @@
<?php
/*
* Copyright (C) 2015-2017 Deciso B.V.
* Copyright (C) 2015-2024 Deciso B.V.
* Copyright (C) 2017 Fabian Franz
* Copyright (C) 2017-2020 Michael Muenz <m.muenz@gmail.com>
* Copyright (C) 2017-2024 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,32 +39,11 @@ class BgpController extends ApiMutableModelControllerBase
public function searchNeighborAction()
{
return $this->searchBase(
'neighbors.neighbor',
array("enabled",
"description",
"address",
"remoteas",
"password",
"localip",
"updatesource",
"nexthopself",
"multihop",
"keepalive",
"holddown",
"connecttimer",
"defaultoriginate",
"asoverride",
"linkedPrefixlistIn",
"linkedPrefixlistOut",
"linkedRoutemapIn",
"linkedRoutemapOut")
);
return $this->searchBase('neighbors.neighbor');
}
public function getNeighborAction($uuid = null)
{
$this->sessionClose();
return $this->getBase('neighbor', 'neighbors.neighbor', $uuid);
}
@@ -85,15 +64,11 @@ class BgpController extends ApiMutableModelControllerBase
public function searchAspathAction()
{
return $this->searchBase(
'aspaths.aspath',
array("enabled", "description", "number", "action", "as" )
);
return $this->searchBase('aspaths.aspath');
}
public function getAspathAction($uuid = null)
{
$this->sessionClose();
return $this->getBase('aspath', 'aspaths.aspath', $uuid);
}
@@ -114,14 +89,11 @@ class BgpController extends ApiMutableModelControllerBase
public function searchPrefixlistAction()
{
return $this->searchBase(
'prefixlists.prefixlist',
array("enabled", "description", "name", "seqnumber", "action", "network" )
);
return $this->searchBase('prefixlists.prefixlist');
}
public function getPrefixlistAction($uuid = null)
{
$this->sessionClose();
return $this->getBase('prefixlist', 'prefixlists.prefixlist', $uuid);
}
@@ -142,14 +114,11 @@ class BgpController extends ApiMutableModelControllerBase
public function searchCommunitylistAction()
{
return $this->searchBase(
'communitylists.communitylist',
array("enabled", "description", "number", "seqnumber", "action", "community" )
);
return $this->searchBase('communitylists.communitylist');
}
public function getCommunitylistAction($uuid = null)
{
$this->sessionClose();
return $this->getBase('communitylist', 'communitylists.communitylist', $uuid);
}
@@ -170,15 +139,11 @@ class BgpController extends ApiMutableModelControllerBase
public function searchRoutemapAction()
{
return $this->searchBase(
'routemaps.routemap',
array("enabled", "description", "name", "action", "id", "match", "match2", "set")
);
return $this->searchBase('routemaps.routemap');
}
public function getRoutemapAction($uuid = null)
{
$this->sessionClose();
return $this->getBase('routemap', 'routemaps.routemap', $uuid);
}
@@ -197,6 +162,31 @@ class BgpController extends ApiMutableModelControllerBase
return $this->setBase('routemap', 'routemaps.routemap', $uuid);
}
public function searchPeergroupAction()
{
return $this->searchBase('peergroups.peergroup');
}
public function getPeergroupAction($uuid = null)
{
return $this->getBase('peergroup', 'peergroups.peergroup', $uuid);
}
public function addPeergroupAction()
{
return $this->addBase('peergroup', 'peergroups.peergroup');
}
public function delPeergroupAction($uuid)
{
return $this->delBase('peergroups.peergroup', $uuid);
}
public function setPeergroupAction($uuid)
{
return $this->setBase('peergroup', 'peergroups.peergroup', $uuid);
}
public function toggleCommunitylistAction($uuid)
{
return $this->toggleBase('communitylists.communitylist', $uuid);
@@ -221,4 +211,9 @@ class BgpController extends ApiMutableModelControllerBase
{
return $this->toggleBase('routemaps.routemap', $uuid);
}
public function togglePeergroupAction($uuid)
{
return $this->toggleBase('peergroups.peergroup', $uuid);
}
}
@@ -2,7 +2,7 @@
/*
* Copyright (C) 2017 Fabian Franz
* Copyright (C) 2017-2020 Michael Muenz <m.muenz@gmail.com>
* Copyright (C) 2017-2024 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,7 @@ class BgpController extends \OPNsense\Base\IndexController
$this->view->formDialogEditBGPPrefixLists = $this->getForm("dialogEditBGPPrefixLists");
$this->view->formDialogEditBGPCommunityLists = $this->getForm("dialogEditBGPCommunityLists");
$this->view->formDialogEditBGPRouteMaps = $this->getForm("dialogEditBGPRouteMaps");
$this->view->formDialogEditBGPPeergroups = $this->getForm("dialogEditBGPPeergroups");
$this->view->pick('OPNsense/Quagga/bgp');
}
}
@@ -11,6 +11,13 @@
<type>text</type>
<help>Your AS Number here</help>
</field>
<field>
<id>bgp.distance</id>
<label>BGP AD Distance</label>
<type>text</type>
<advanced>true</advanced>
<help>BGP routes usually have an administrative distance of 20. Here you can adjust these values, e.g. when you want to prefer OSPF learned routes.</help>
</field>
<field>
<id>bgp.routerid</id>
<label>Router ID</label>
@@ -169,4 +169,10 @@
<type>dropdown</type>
<help>Route-Map for outbound direction</help>
</field>
<field>
<id>neighbor.peergroup</id>
<label>Peer Group</label>
<type>dropdown</type>
<help>Peer Group this neighbor belongs to.</help>
</field>
</form>
@@ -0,0 +1,59 @@
<form>
<field>
<id>peergroup.enabled</id>
<label>Enabled</label>
<type>checkbox</type>
</field>
<field>
<id>peergroup.name</id>
<label>Name</label>
<type>text</type>
<help>Specify the name of this peergroup.</help>
</field>
<field>
<id>peergroup.remoteas</id>
<label>Remote AS</label>
<type>text</type>
<help>Remote AS for tthis peergroup.</help>
</field>
<field>
<id>peergroup.updatesource</id>
<label>Update-Source Interface</label>
<type>dropdown</type>
<help><![CDATA[Physical name of the IPv4 interface facing the peer. Please refer to the <a href="http://docs.frrouting.org/en/stable-7.4/bgp.html#clicmd-[no]neighborPEERupdate-source%3CIFNAME|ADDRESS%3E">FRR documentation</a> for more information.]]></help>
</field>
<field>
<id>peergroup.nexthopself</id>
<label>Next-Hop-Self</label>
<type>checkbox</type>
</field>
<field>
<id>peergroup.defaultoriginate</id>
<label>Send Defaultroute</label>
<type>checkbox</type>
</field>
<field>
<id>peergroup.linkedPrefixlistIn</id>
<label>Prefix-List In</label>
<type>dropdown</type>
<help>Prefix-List for inbound direction.</help>
</field>
<field>
<id>peergroup.linkedPrefixlistOut</id>
<label>Prefix-List Out</label>
<type>dropdown</type>
<help>Prefix-List for outbound direction.</help>
</field>
<field>
<id>peergroup.linkedRoutemapIn</id>
<label>Route-Map In</label>
<type>dropdown</type>
<help>Route-Map for inbound direction.</help>
</field>
<field>
<id>peergroup.linkedRoutemapOut</id>
<label>Route-Map Out</label>
<type>dropdown</type>
<help>Route-Map for outbound direction.</help>
</field>
</form>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/quagga/bgp</mount>
<description>BGP Routing configuration</description>
<version>1.0.8</version>
<version>1.0.9</version>
<items>
<enabled type="BooleanField">
<default>0</default>
@@ -13,6 +13,10 @@
<MinimumValue>1</MinimumValue>
<MaximumValue>4294967295</MaximumValue>
</asnumber>
<distance type="IntegerField">
<MinimumValue>1</MinimumValue>
<MaximumValue>255</MaximumValue>
</distance>
<routerid type="TextField">
<Required>N</Required>
<mask>/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/</mask>
@@ -60,8 +64,6 @@
<Required>Y</Required>
</address>
<remoteas type="IntegerField">
<default></default>
<Required>Y</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>4294967295</MaximumValue>
</remoteas>
@@ -211,7 +213,19 @@
<Multiple>N</Multiple>
<Required>N</Required>
</linkedRoutemapOut>
</neighbor>
<peergroup type="ModelRelationField">
<Model>
<template>
<source>OPNsense.quagga.bgp</source>
<items>peergroups.peergroup</items>
<display>name</display>
<group>name</group>
</template>
</Model>
<ValidationMessage>Related Peer Group item not found</ValidationMessage>
<Multiple>N</Multiple>
</peergroup>
</neighbor>
</neighbors>
<aspaths>
<aspath type="ArrayField">
@@ -395,5 +409,76 @@
</set>
</routemap>
</routemaps>
<peergroups>
<peergroup type="ArrayField">
<enabled type="BooleanField">
<default>1</default>
<Required>Y</Required>
</enabled>
<name type="TextField">
<Required>Y</Required>
</name>
<remoteas type="IntegerField">
<Required>Y</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>4294967295</MaximumValue>
</remoteas>
<updatesource type="InterfaceField">
<AllowDynamic>Y</AllowDynamic>
<filters>
<enable>/^(?!0).*$/</enable>
<type>/^(?!group).*$/</type>
</filters>
</updatesource>
<nexthopself type="BooleanField"/>
<defaultoriginate type="BooleanField"/>
<linkedPrefixlistIn type="ModelRelationField">
<Model>
<template>
<source>OPNsense.quagga.bgp</source>
<items>prefixlists.prefixlist</items>
<display>name</display>
<group>name</group>
</template>
</Model>
<ValidationMessage>Related Prefix-List item not found</ValidationMessage>
</linkedPrefixlistIn>
<linkedPrefixlistOut type="ModelRelationField">
<Model>
<template>
<source>OPNsense.quagga.bgp</source>
<items>prefixlists.prefixlist</items>
<display>name</display>
<group>name</group>
</template>
</Model>
<ValidationMessage>Related Prefix-List item not found</ValidationMessage>
<Multiple>N</Multiple>
<Required>N</Required>
</linkedPrefixlistOut>
<linkedRoutemapIn type="ModelRelationField">
<Model>
<template>
<source>OPNsense.quagga.bgp</source>
<items>routemaps.routemap</items>
<display>name</display>
<group>name</group>
</template>
</Model>
<ValidationMessage>Related Route-Map item not found</ValidationMessage>
</linkedRoutemapIn>
<linkedRoutemapOut type="ModelRelationField">
<Model>
<template>
<source>OPNsense.quagga.bgp</source>
<items>routemaps.routemap</items>
<display>name</display>
<group>name</group>
</template>
</Model>
<ValidationMessage>Related Route-Map item not found</ValidationMessage>
</linkedRoutemapOut>
</peergroup>
</peergroups>
</items>
</model>
@@ -1,6 +1,6 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
OPNsense® is Copyright © 2014 2024 by Deciso B.V.
Copyright (C) 2017 Fabian Franz
Copyright (C) 2017 - 2020 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
@@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
<li><a data-toggle="tab" href="#prefixlists">{{ lang._('Prefix Lists') }}</a></li>
<li><a data-toggle="tab" href="#communitylists">{{ lang._('Community Lists') }}</a></li>
<li><a data-toggle="tab" href="#routemaps">{{ lang._('Route Maps') }}</a></li>
<li><a data-toggle="tab" href="#peergroups">{{ lang._('Peer Groups') }}</a></li>
</ul>
<div class="tab-content content-box tab-content">
<div id="general" class="tab-pane fade in active">
@@ -51,13 +52,13 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="description" data-type="string" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="address" data-type="string" data-visible="true">{{ lang._('Neighbor Address') }}</th>
<th data-column-id="remoteas" data-type="string" data-visible="true">{{ lang._('Remote AS') }}</th>
<th data-column-id="linkedPrefixlistIn" data-type="string" data-visible="true">{{ lang._('Prefix List inbound') }}</th>
<th data-column-id="linkedPrefixlistOut" data-type="string" data-visible="true">{{ lang._('Prefix List outbound') }}</th>
<th data-column-id="linkedRoutemapIn" data-type="string" data-visible="true">{{ lang._('Route Map inbound') }}</th>
<th data-column-id="linkedRoutemapOut" data-type="string" data-visible="true">{{ lang._('Route Map outbound') }}</th>
<th data-column-id="description" data-type="string">{{ lang._('Description') }}</th>
<th data-column-id="address" data-type="string">{{ lang._('Neighbor Address') }}</th>
<th data-column-id="remoteas" data-type="string">{{ lang._('Remote AS') }}</th>
<th data-column-id="linkedPrefixlistIn" data-type="string">{{ lang._('Prefix List inbound') }}</th>
<th data-column-id="linkedPrefixlistOut" data-type="string">{{ lang._('Prefix List outbound') }}</th>
<th data-column-id="linkedRoutemapIn" data-type="string">{{ lang._('Route Map inbound') }}</th>
<th data-column-id="linkedRoutemapOut" data-type="string">{{ lang._('Route Map outbound') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
@@ -81,10 +82,10 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle" data-sortable="false">{{ lang._('Enabled') }}</th>
<th data-column-id="description" data-type="string" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="number" data-type="string" data-visible="true" data-sortable="true">{{ lang._('Number') }}</th>
<th data-column-id="action" data-type="string" data-visible="true" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="as" data-type="string" data-visible="true" data-sortable="false">{{ lang._('AS Number') }}</th>
<th data-column-id="description" data-type="string">{{ lang._('Description') }}</th>
<th data-column-id="number" data-type="string" data-sortable="true">{{ lang._('Number') }}</th>
<th data-column-id="action" data-type="string" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="as" data-type="string" data-sortable="false">{{ lang._('AS Number') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
@@ -108,11 +109,11 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle" data-sortable="false">{{ lang._('Enabled') }}</th>
<th data-column-id="name" data-type="string" data-visible="true" data-sortable="true">{{ lang._('Name') }}</th>
<th data-column-id="description" data-type="string" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="seqnumber" data-type="string" data-visible="true" data-sortable="true">{{ lang._('Sequence Number') }}</th>
<th data-column-id="action" data-type="string" data-visible="true" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="network" data-type="string" data-visible="true" data-sortable="false">{{ lang._('Network') }}</th>
<th data-column-id="name" data-type="string" data-sortable="true">{{ lang._('Name') }}</th>
<th data-column-id="description" data-type="string">{{ lang._('Description') }}</th>
<th data-column-id="seqnumber" data-type="string" data-sortable="true">{{ lang._('Sequence Number') }}</th>
<th data-column-id="action" data-type="string" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="network" data-type="string" data-sortable="false">{{ lang._('Network') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
@@ -136,11 +137,11 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle" data-sortable="false">{{ lang._('Enabled') }}</th>
<th data-column-id="number" data-type="string" data-visible="true" data-sortable="true">{{ lang._('Number') }}</th>
<th data-column-id="description" data-type="string" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="seqnumber" data-type="string" data-visible="true" data-sortable="true">{{ lang._('Secquence Number') }}</th>
<th data-column-id="action" data-type="string" data-visible="true" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="community" data-type="string" data-visible="true" data-sortable="false">{{ lang._('Community') }}</th>
<th data-column-id="number" data-type="string" data-sortable="true">{{ lang._('Number') }}</th>
<th data-column-id="description" data-type="string">{{ lang._('Description') }}</th>
<th data-column-id="seqnumber" data-type="string" data-sortable="true">{{ lang._('Secquence Number') }}</th>
<th data-column-id="action" data-type="string" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="community" data-type="string" data-sortable="false">{{ lang._('Community') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
@@ -164,14 +165,14 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="name" data-type="string" data-visible="true">{{ lang._('Name') }}</th>
<th data-column-id="description" data-type="string" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="action" data-type="string" data-visible="true">{{ lang._('Action') }}</th>
<th data-column-id="id" data-type="string" data-visible="true">{{ lang._('ID') }}</th>
<th data-column-id="match" data-type="string" data-visible="true">{{ lang._('AS Path List') }}</th>
<th data-column-id="match2" data-type="string" data-visible="true">{{ lang._('Prefix List') }}</th>
<th data-column-id="match3" data-type="string" data-visible="true">{{ lang._('Community List') }}</th>
<th data-column-id="set" data-type="string" data-visible="true">{{ lang._('Set') }}</th>
<th data-column-id="name" data-type="string">{{ lang._('Name') }}</th>
<th data-column-id="description" data-type="string">{{ lang._('Description') }}</th>
<th data-column-id="action" data-type="string">{{ lang._('Action') }}</th>
<th data-column-id="id" data-type="string">{{ lang._('ID') }}</th>
<th data-column-id="match" data-type="string">{{ lang._('AS Path List') }}</th>
<th data-column-id="match2" data-type="string">{{ lang._('Prefix List') }}</th>
<th data-column-id="match3" data-type="string">{{ lang._('Community List') }}</th>
<th data-column-id="set" data-type="string">{{ lang._('Set') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
@@ -189,6 +190,35 @@ POSSIBILITY OF SUCH DAMAGE.
</tfoot>
</table>
</div>
<div id="peergroups" class="tab-pane fade in">
<table id="grid-peergroups" class="table table-responsive" data-editDialog="DialogEditBGPPeergroups">
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="name" data-type="string">{{ lang._('Name') }}</th>
<th data-column-id="nexthopself" data-type="string" data-formatter="boolean">{{ lang._('Next Hop Self') }}</th>
<th data-column-id="defaultoriginate" data-type="string" data-formatter="boolean">{{ lang._('Default Originate') }}</th>
<th data-column-id="linkedPrefixlistIn" data-type="string">{{ lang._('Prefix List inbound') }}</th>
<th data-column-id="linkedPrefixlistOut" data-type="string">{{ lang._('Prefix List outbound') }}</th>
<th data-column-id="linkedRoutemapIn" data-type="string">{{ lang._('Route Map inbound') }}</th>
<th data-column-id="linkedRoutemapOut" data-type="string">{{ lang._('Route Map outbound') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td colspan="10"></td>
<td colspan="1">
<button data-action="add" type="button" class="btn btn-xs btn-default"><span class="fa fa-plus"></span></button>
<button type="button" class="btn btn-xs reload_btn btn-primary"><span class="fa fa-refresh reloadAct_progress"></span></button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
<script>
@@ -274,6 +304,16 @@ $(document).ready(function() {
'toggle':'/api/quagga/bgp/toggleRoutemap/',
'options':{selection:false, multiSelect:false}
}
);
$("#grid-peergroups").UIBootgrid(
{ 'search':'/api/quagga/bgp/searchPeergroup',
'get':'/api/quagga/bgp/getPeergroup/',
'set':'/api/quagga/bgp/setPeergroup/',
'add':'/api/quagga/bgp/addPeergroup/',
'del':'/api/quagga/bgp/delPeergroup/',
'toggle':'/api/quagga/bgp/togglePeergroup/',
'options':{selection:false, multiSelect:false}
}
);
});
</script>
@@ -283,3 +323,4 @@ $(document).ready(function() {
{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPPrefixLists,'id':'DialogEditBGPPrefixLists','label':lang._('Edit Prefix Lists')])}}
{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPCommunityLists,'id':'DialogEditBGPCommunityLists','label':lang._('Edit Community Lists')])}}
{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPRouteMaps,'id':'DialogEditBGPRouteMaps','label':lang._('Edit Route Maps')])}}
{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPPeergroups,'id':'DialogEditBGPPeergroups','label':lang._('Edit Peer Groups')])}}
@@ -59,10 +59,65 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
{% if helpers.exists('OPNsense.quagga.bgp.routerid') and OPNsense.quagga.bgp.routerid != '' %}
bgp router-id {{ OPNsense.quagga.bgp.routerid }}
{% endif %}
{% if helpers.exists('OPNsense.quagga.bgp.distance') and OPNsense.quagga.bgp.distance != '' %}
distance bgp {{ OPNsense.quagga.bgp.distance }} {{ OPNsense.quagga.bgp.distance }} {{ OPNsense.quagga.bgp.distance }}
{% endif %}
{% for peergroup in helpers.toList('OPNsense.quagga.bgp.peergroups.peergroup') %}
{% if peergroup.enabled == '1' %}
neighbor {{ peergroup.name }} peer-group
{% if 'remoteas' in peergroup and peergroup.remoteas != '' %}
neighbor {{ peergroup.name }} remote-as {{ peergroup.remoteas }}
{% endif %}
{% if peergroup.updatesource|default('0') == '1' %}
neighbor {{ peergroup.name }} update-source {{ physical_interface(peergroup.updatesource) }}
{% endif %}
neighbor {{ peergroup.name }} activate
{% if peergroup.nexthopself|default('0') == '1' %}
neighbor {{ peergroup.name }} next-hop-self
{% endif %}
{% if peergroup.defaultoriginate|default('0') == '1' %}
neighbor {{ peergroup.name }} default-originate
{% endif %}
{% if peergroup.linkedPrefixlistIn|default("") != "" %}
{% for prefixlist in peergroup.linkedPrefixlistIn.split(",") %}
{% set prefixlist2_data = helpers.getUUID(prefixlist) %}
{% if prefixlist2_data != {} and prefixlist2_data.enabled == '1' %}
neighbor {{ peergroup.name }} prefix-list {{ prefixlist2_data.name }} in
{% endif %}
{% endfor %}
{% endif %}
{% if peergroup.linkedPrefixlistOut|default("") != "" %}
{% for prefixlist in peergroup.linkedPrefixlistOut.split(",") %}
{% set prefixlist_data = helpers.getUUID(prefixlist) %}
{% if prefixlist_data != {} and prefixlist_data.enabled == '1' %}
neighbor {{ peergroup.name }} prefix-list {{ prefixlist_data.name }} out
{% endif %}
{% endfor %}
{% endif %}
{% if peergroup.linkedRoutemapIn|default("") != "" %}
{% for aspath in peergroup.linkedRoutemapIn.split(",") %}
{% set routemap2_data = helpers.getUUID(aspath) %}
{% if routemap2_data != {} and routemap2_data.enabled == '1' %}
neighbor {{ peergroup.name }} route-map {{ routemap2_data.name }} in
{% endif %}
{% endfor %}
{% endif %}
{% if peergroup.linkedRoutemapOut|default("") != "" %}
{% for aspath in peergroup.linkedRoutemapOut.split(",") %}
{% set routemap_data = helpers.getUUID(aspath) %}
{% if routemap_data != {} and routemap_data.enabled == '1' %}
neighbor {{ peergroup.name }} route-map {{ routemap_data.name }} out
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %}
{% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %}
{% if neighbor.enabled == '1' %}
{% if 'remoteas' in neighbor and neighbor.remoteas != '' %}
neighbor {{ neighbor.address }} remote-as {{ neighbor.remoteas }}
{% endif %}
{% if neighbor.bfd|default('') == '1' %}
neighbor {{ neighbor.address }} bfd
{% endif %}
@@ -95,6 +150,10 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }}
{% if 'attributeunchanged' in neighbor and neighbor.attributeunchanged != '' %}
neighbor {{ neighbor.address }} attribute-unchanged {{ neighbor.attributeunchanged }}
{% endif %}
{% if neighbor.peergroup|default('') != '' %}
{% set pgname = helpers.getUUID(neighbor.peergroup) %}
neighbor {{ neighbor.address }} peer-group {{ pgname.name }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}