Page MenuHomeVyOS Platform

Add the ability to use network address as BGP neighbor (bgp listen range)
Closed, ResolvedPublicFEATURE REQUEST

Description

FRRouting supports using IP network address as BGP peer instead of explicit configuration each of them (bgp listen range option - http://docs.frrouting.org/en/latest/bgp.html#clicmd-[no]bgplistenrange%3CA.B.C.D/M|X:X::X:X/M%3Epeer-groupPGNAME).
We could this to VyOS to extend BGP functionality.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

syncer triaged this task as Normal priority.Dec 19 2019, 10:03 PM
syncer raised the priority of this task from Normal to High.Jan 1 2020, 1:53 PM
syncer edited projects, added VyOS 1.3 Equuleus; removed VyOS 1.2 Crux.
syncer moved this task from Need Triage to Backlog on the VyOS 1.3 Equuleus board.

I tried adding it but failed miserably. This should best be done with the entire BGP rewrite.

Here is my change for future reference:

diff --git c/scripts/bgp/vyatta-bgp.pl i/scripts/bgp/vyatta-bgp.pl
index 359eb972..7646055b 100755
--- c/scripts/bgp/vyatta-bgp.pl
+++ i/scripts/bgp/vyatta-bgp.pl
@@ -206,6 +206,11 @@ my %qcom = (
       del => 'router bgp #3 ; no neighbor #5',
       noerr => 'del',
   },
+  'protocols bgp var listen-range var peer-group' => {
+      set => 'router bgp #3 ; bgp listen range #5 peer-group #7',
+      del => 'router bgp #3 ; no bgp listen range #5 peer-group #7',
+      noerr => 'del',
+  },
   'protocols bgp var neighbor var address-family' => {
       set => undef,
       del => undef,
@@ -1791,6 +1796,7 @@ sub main

    # notice the extra space in the level string.  keeps the parent from being deleted.
    $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var', undef, \@ordered) || die "exiting $?\n";
+   $qconfig->deleteConfigTreeRecursive('protocols bgp var listen-range var', undef, \@ordered) || die "exiting $?\n";
    $qconfig->deleteConfigTreeRecursive('protocols bgp var peer-group var', undef, \@ordered) || die "exiting $?\n";
    $qconfig->deleteConfigTreeRecursive('protocols bgp') || die "exiting $?\n";

@@ -1805,5 +1811,6 @@ sub main
    $qconfig->setConfigTreeRecursive('protocols bgp var neighbor var address-family ipv6-unicast'
                                     , undef, \@ordered) || die "exiting $?\n";
    $qconfig->setConfigTreeRecursive('protocols bgp var neighbor var ', undef, \@ordered) || die "exiting $?\n";
+   $qconfig->setConfigTreeRecursive('protocols bgp var listen-range var ', undef, \@ordered) || die "exiting $?\n";
    $qconfig->setConfigTreeRecursive('protocols bgp') || die "exiting $?\n";
 }

diff --git c/templates/protocols/bgp/node.tag/listen-range/node.def i/templates/protocols/bgp/node.tag/listen-range/node.def
new file mode 100644
index 00000000..94f1ac70
--- /dev/null
+++ i/templates/protocols/bgp/node.tag/listen-range/node.def
@@ -0,0 +1,6 @@
+tag:
+type: txt
+help: Accept connections from any peers in the specified prefix
+val_help: ipv4net; IPv4 address and prefix length
+val_help: ipv6net; IPv6 address and prefix length
+syntax:expression: exec "ipaddrcheck --verbose --is-any-net $VAR(@)"

diff --git c/templates/protocols/bgp/node.tag/listen-range/node.tag/peer-group/node.def i/templates/protocols/bgp/node.tag/listen-range/node.tag/peer-group/node.def
new file mode 100644
index 00000000..b707f391
--- /dev/null
+++ i/templates/protocols/bgp/node.tag/listen-range/node.tag/peer-group/node.def
@@ -0,0 +1,7 @@
+type: txt
+help: IPv4 peer group for this peer
+allowed: local -a params
+        params=$( /opt/vyatta/sbin/vyatta-bgp.pl --list-peer-groups --as $VAR(../../@) )
+        echo -n ${params[@]##*/}
+commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"protocols bgp $VAR(../../@) peer-group $VAR(@)\" "; "protocols bgp $VAR(../../@) peer-group $VAR(@) doesn't exist"
+commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-peer-group-bfd $VAR(@) --as $VAR(../../@)"
c-po changed the task status from Open to Needs testing.Jan 21 2021, 5:27 PM
c-po assigned this task to Cheeze_It.
c-po lowered the priority of this task from High to Normal.
c-po edited projects, added VyOS 1.4 Sagitta; removed VyOS 1.3 Equuleus.
zsdc reopened this task as Backport candidate.Oct 18 2022, 9:24 AM
zsdc claimed this task.
zsdc moved this task from Finished to Backport Candidates on the VyOS 1.4 Sagitta board.