Page MenuHomeVyOS Platform

Add the ability to use network address as BGP neighbor (bgp listen range)
Open, HighPublicFEATURE 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

zsdc created this task.Dec 13 2019, 11:19 AM
Kroeze added a subscriber: Kroeze.Dec 13 2019, 3:03 PM
pasik added a subscriber: pasik.Dec 15 2019, 8:47 PM
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 assigned this task to c-po.Mar 9 2020, 2:52 AM
syncer moved this task from Need Triage to Backlog on the VyOS 1.3 Equuleus board.
c-po added a comment.Apr 1 2020, 6:59 PM

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(../../@)"
teadur added a subscriber: teadur.Apr 5 2020, 4:24 PM
c-po removed c-po as the assignee of this task.Apr 10 2020, 11:49 AM
c-po added a subscriber: c-po.