Commit Graph

918 Commits

Author SHA1 Message Date
Sri Mohana Singamsetty
7a54a2caf7
Merge pull request #6277 from ton31337/feature/show_bgp_afi_safi_sndpfx
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-23 20:20:07 -07:00
Donatas Abraitis
776e7cf5ce bgpd: Show PfxSnt for show bgp <afi> <safi> command
JSON output was already in, just printing in CLI as well.

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary'

IPv4 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0
BGP table version 100003
RIB entries 200005, using 37 MiB of memory
Peers 1, using 21 KiB of memory

... MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
...      64       157        0    0    0 00:01:18            0   100003

Total number of neighbors 1
```

JSON:

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary json' \ |
> jq '.ipv4Unicast.peers."192.168.0.2".pfxSnt'
100003
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-23 11:48:14 +03:00
Quentin Young
2b7165e76f *: use appropriate buffer sizes, specifiers
- Fix 1 byte overflow when showing GR info in bgpd
- Use PATH_MAX for path buffers
- Use unsigned specifiers for uint16_t's in zebra pbr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Donatas Abraitis
7f972cd8dc bgpd: Use true/false for reject_as_sets
Just remove MACROS and use true/false.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-20 12:59:52 +03:00
Donald Sharp
8b1e4f30ba
Merge pull request #6164 from ton31337/feature/rfc8212_enabled_traditional_profile
bgpd: Enable rfc8212 by default except datacenter profile
2020-04-18 15:06:04 -04:00
David Lamparter
f4b8291fcb *: move CLI node names to cmd_node->name
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:59 +02:00
David Lamparter
243895805a *: move CLI parent data to cmd_node->parent_node
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
612c2c15d8 *: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
249a771b63 *: remove cmd_node->vtysh
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
Donatas Abraitis
1d3fdccfe1 bgpd: Enable rfc8212 by default except datacenter profile
Some competitive vendors like Cisco, Bird, OpenBGPD,
Nokia already have this by default enabled.

The list is here: https://github.com/bgp/RFC8212

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-14 16:01:46 +03:00
Naveen Thanikachalam
74a630b606 bgpd: Fixes for memory leaks.
This commit addresses the memory leaks when certain BGP JSON
show commands are executed

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2020-04-08 20:27:49 -07:00
Sri Mohana Singamsetty
70ecc066e7
Merge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath
Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth
2020-04-05 11:41:42 -07:00
Donatas Abraitis
6f5dc2e508 bgpd: Remove prefixReceivedCount from JSON
This is already covered by pfxRcd. Removed due to consistency
between CLI and JSON.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-03 16:16:06 +03:00
David Lamparter
4c1458b595 bgpd, ospfd, ospf6d: long is not bool :(
... Oops ...

(for context, the defaults code originally didn't have a dedicated
"bool" variant and just used long for bools...  I derp'd this when
adding bool as a separate case :( )

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-02 21:16:04 +02:00
Quentin Young
49e5a4a0b8 bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC
This macro is undefined if vnc is disabled, and while it defaults to 0,
this is still wrong and causes issues with -Werror

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-01 15:05:26 -04:00
vivek
f7e1c681f4 bgpd: Implement options for link bandwidth handling
Support configurable options to control how link bandwidth is handled
by the receiver. The default behavior is to automatically honor the
link bandwidths received and use it to perform a weighted ECMP BUT only
if all paths in the multipath have associated link bandwidth; if one or
more paths do not have link bandwidth, normal ECMP is performed among
the multipaths. This behavior is as recommended by
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth.

The additional options available are to (a) completely ignore any link
bandwidth (i.e., weighted ECMP is effectively disabled), (b) skip paths
in the multipath which do not have link bandwidth and perform weighted
ECMP among the other paths (if at least some paths have the bandwidth)
or (c) use a default weight (value chosen is 1) for the paths which
do not have link bandwidth.

The command syntax is
bgp bestpath bandwidth <ignore|skip-missing|default-weight-for-missing>

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2020-03-30 20:12:31 -07:00
Quentin Young
43aa596538 bgpd: display ingress packet queue size
In the past, we always displayed the number of buffered ingress packets
as zero because there was no packet buffering in the input path and
therefore never any queue size to report. They're buffered now so we can
display something meaningful instead of 0.

Also change the inq / outq lookups to be atomic, since they can be
modified elsewhere. These should still compile down to an unfenced word
read but it's good to be explicit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-30 15:07:57 -04:00
Sri Mohana Singamsetty
a326a812b3
Merge pull request #6107 from ton31337/fix/unset_prefix_out_flag
bgpd: Unset PEER_FLAG_MAX_PREFIX_OUT for `no neighbor maximum-prefix-…
2020-03-29 19:52:41 -07:00
Donatas Abraitis
ae00326adc bgpd: Unset PEER_FLAG_MAX_PREFIX_OUT for no neighbor maximum-prefix-out
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-29 19:16:16 +03:00
David Lamparter
566bdaf68c *: fix format string warnings
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
Donald Sharp
b54892e0ea bgpd: Convert users of rn->p to use accessor function
Add new function `bgp_node_get_prefix()` and modify
the bgp code base to use it.

This is prep work for the struct bgp_dest rework.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-26 16:25:16 -04:00
Don Slice
ae6a6fb4e5 bgpd: clean up import vrf route-map command
Problem seen that if "import vrf route-map RMAP" was entered
without any vrfs being imported, the configuration was displayed
as "route-map vpn import RMAP". Additionally, if "import vrf
route-map" was entered without specifying a route-map name,
the command was accepted and the word "route-map" would be
treated as a vrf name.  This fix resolves both of those issues
and also allows deleting the "import vrf route-map" line without
providing the route-map name.

Ticket: CM-28821
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-03-24 12:54:10 +00:00
Donatas Abraitis
3dc339cdc2 bgpd: Convert lots of int type functions to bool/void
Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-21 14:59:18 +02:00
Donald Sharp
2089dd80c0 bgpd: Fix spelling mistakes found by debian packaging
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-13 19:10:28 -04:00
Quentin Young
8c85ca283b bgpd: fix 'no nexthop vpn export'
ALIAS without parameters against DEFPY w/ required parameters doesn't
work

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-09 14:55:37 -04:00
Quentin Young
5d2724ec25
Merge pull request #5916 from mjstapp/fix_gmtime
*: use gmtime_r exclusively
2020-03-05 17:38:13 -05:00
Mark Stapp
a2700b5071 *: use gmtime_r, localtime_r exclusively
Stop using gmtime() or localtime() everywhere.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-05 13:26:16 -05:00
Donatas Abraitis
08c2d52ae1 *: Use true/false instead of 1/0 when assigning variable for bool type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-04 18:49:36 +02:00
Donald Sharp
22d4e6c0ac
Merge pull request #5899 from Spantik/clear_bgp_bug
BGPD: Cores when cleared with doppelganger.
2020-03-03 13:16:01 -05:00
Ruben Kerkhof
61bfbd5119 bgpd: fix typo in 'show bgp neighbors' output
And fix a typo in a comment while we're at it

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-03 16:47:14 +01:00
Santosh P K
c368171c04 BGPD: Cores when cleared with doppelganger.
RCA: When doppelganger still around and clear bgp is issued
there are chances of peer getting deleted and next pointer
is a  freed peer pointer.

Fix: Pass address of nnode to get next safe peer pointer.

Signed-off-by: Santosh P K <sapk@vmware.com>
2020-03-03 06:32:48 -08:00
Russ White
5e34d224ea
Merge pull request #5783 from ton31337/fix/bad_formatting_bgpd_gr
bgpd: Format properly `show bgp neighbors` for graceful restart stuff
2020-02-25 11:01:27 -05:00
Donald Sharp
bed8d78bae bgpd: Add a couple more spaces for output on MsgRcvd and MsgSent
annie# show bgp ipv4 uni summ
BGP router identifier 192.168.201.136, local AS number 64539 vrf-id 0
BGP table version 22458946
RIB entries 1458006, using 178 MiB of memory
Peers 4, using 68 KiB of memory

Neighbor               V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
45.33.5.119            4          0       0       0        0    0    0    never       Active
65.19.134.122          4      15096 4611832  108292        0    0    0 6d22h55m       800670
107.13.46.23           4          0       0       0        0    0    0    never      Connect
robot(192.168.201.139) 4      64540 11159975 11365599        0    0    0 05w2d05h      Connect

Total number of neighbors 4

On very busy systems The column output for MsgRcvd and MsgSent can quickly move past 7 columns.
Add a couple more to allow for even display.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 20:38:13 -05:00
Donatas Abraitis
752022670a *: Remove break after return
Just a deadcode.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-13 15:39:54 +02:00
Donatas Abraitis
a53ca37b89 bgpd: Format properly show bgp neighbors for graceful restart stuff
Before:

```
  Graceful restart informations:
    End-of-RIB send: IPv4 Unicast
    End-of-RIB received: IPv4 Unicast
    Local GR Mode  : Helper*
    Remote GR Mode : Helper
    R bit          : False
    Timers :
     Configured Restart Time(sec)  : 120
     Received Restart Time(sec)    : 120
    IPv4 Unicast :
     F bit                 : False
     End-of-RIB Received   : Yes
     End-of-RIB Send       : Yes
     EoRSentAfterUpdate   : Yes
     Timers:
      Configured Stale Path Time(sec)        : 360
```

After:

```
  Graceful restart informations:
    End-of-RIB send: IPv4 Unicast
    End-of-RIB received: IPv4 Unicast
    Local GR Mode: Helper*
    Remote GR Mode: Helper
    R bit: False
    Timers:
      Configured Restart Time(sec): 120
      Received Restart Time(sec): 120
    IPv4 Unicast:
      F bit: False
      End-of-RIB sent: Yes
      End-of-RIB sent after update: Yes
      End-of-RIB received: Yes
      Timers:
        Configured Stale Path Time(sec): 360
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-12 11:00:45 +02:00
Quentin Young
f94ed830df
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
bgpd: Format properly `show bgp summary failed`
2020-02-11 14:45:40 -05:00
Donatas Abraitis
e91c24c8c2 bgpd: Format properly show bgp summary failed
Before:
```
Neighbor        EstdCnt DropCnt ResetTime Reason
192.168.0.1           0       0    never  Waiting for peer OPEN
```

After:
```
Neighbor        EstdCnt DropCnt ResetTime Reason
192.168.0.1           0       0     never Waiting for peer OPEN
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-11 18:05:02 +02:00
Russ White
8d61adbf07
Merge pull request #5785 from ton31337/fix/replace_gtsm_hops_to_readable_macros
bgpd: Use readable macros for peer->gtsm_hops instead of literals
2020-02-11 10:40:35 -05:00
Donatas Abraitis
e2521429a6 bgpd: Use readable macros for peer->gtsm_hops instead of literals
Do the same way like BGP_DEFAULT_TTL

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-10 16:23:09 +02:00
Donatas Abraitis
892fedb611 bgpd: Replace bgp_flag_* to [UN]SET/CHECK_FLAG macros
Most of the code uses macros, thus let's keep the code unified.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06 17:11:38 +02:00
Quentin Young
362353195a bgpd, lib: fix style from BGP GR code
This patch fixes the noncompliant style for the following commit range:

4a6e80fbf
2ba1fe695
efcb2ebbb
8c48b3b69
dc95985fe
0f0444fbd
85ef4179a
eb451ee58
2d3dd828d
9e3b51a7f
d6e3c15b6
34aa74486
6102cb7fe
d7b3cda6f
2bb5d39b1
5f9c1aa29
5cce3f054
3a75afa4b
f009ff269
cfd47646b
2986cac29
055679e91
034e185dc
794b37d52
b0965c44e
949b0f24f
63696f1d8

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-04 15:19:04 -05:00
Quentin Young
0445dc7d4e
Merge pull request #5169 from ton31337/feature/sequence_numbers_for_community_lists
bgpd: Use sequence numbers for community lists
2020-02-04 11:56:29 -05:00
Donald Sharp
698ba8d026 bgpd: Remove dead call to get_afi_safi_str
There is no need for a call into get_afi_safi_str for the
json side since we add it based upon the afi safi str below.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-04 08:10:52 -05:00
Donald Sharp
7318ae88de bgpd: enums in switches do not need default
If you have enums handled in a switch adding a default case
makes it fun to fix when new stuff is added later.  Remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-31 09:59:57 -05:00
Donald Sharp
13909c4fbc bgpd: Cleanup some bad formating
Some recent commits got some bad formating.  Clean this up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-31 09:59:57 -05:00
bisdhdh
2ba1fe6951 bgpd: BGP Garaceful Restart debug logs.
Reorganizing bgp gr debug logs and code review comments.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:36:33 +05:30
bisdhdh
dc95985fe8 bgpd: Add rib-stale-time(running in Zebra).
* Added CLI commands to update rib-stale-time, running in
Cmd : "bgp gaceful-restart rib-stale-time (1-3000)".
Cmd : "no bgp gaceful-restart rib-stale-time".
* Integrating the hooks function for signalling from BGPD
to ZEBRA to ZEBRA to enable or disable GR feature in ZEBRA
depending on bgp per peer gr configuration.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:36:33 +05:30
bisdhdh
9e3b51a7f3 bgpd: Restarting node does not send EOR after the convergence.
*After a restarting router comes up and the bgp session is
successfully established with the peer. If the restarting
router doesn’t have any route to send, it send EOR to
the peer immediately before receiving updates from its peers.
*Instead the restarting router should send EOR, if the
selection deferral timer is not running OR count of eor received
and eor required are matches then send EOR.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
d6e3c15b62 bgpd: Added hidden CLI command to disable sending of End-of-Rib.
BGP disable EOR sending is a useful command for testing various
scenarios of BGP graceful restart.
* Added the hidden CLI command :  bgp graceful-restart disable-eor
* The CLI will not be displayed in "show running-config" and will not
  be stored in configuration file.
* When enabled, EOR will not be sent to peer

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
Signed-off-by: Soman K S <somanks@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
2bb5d39b14 bgpd: show BGP GR Neighbor mode as “NotApplicable”,when local mode is “Disable”.
BGP GR Neighbor mode is showing the default string as “NotRecieved”,
as the bgp gr neighbour capability was not processed,
since the local mode is “Disable”.
However now it would be changed to  “NotApplicable”.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
5cce3f0544 bgpd: Adding BGP GR change mode config apply on notification sent & received.
* Changing GR mode on a router needs a session reset from the
SAME router to negotiate new GR capability.
* The present GR implementation needs a session reset after every
new BGP GR mode change.
* When BGP session reset happens due to sending or receiving BGP
notification after changing BGP GR mode, there is no need of
explicit session reset.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
3a75afa4b9 bgpd: Adding BGP GR Neighbour mode show, when local mode is “Disable”.
* BGP GR Neighbour mode in show command would show as
“NotApplicable”, when local mode is “Disable”. As the bgp
gr neighbour capability was not processed, since the local mode
is “Disable”.
* Minor changes in show Selection Deferral Time.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
f009ff2697 bgpd: Adding Selection Deferral Timer handler changes.
* Selection Deferral Timer for Graceful Restart.
* Added selection deferral timer handling function.
* Route marking as selection defer when update message is received.
* Staggered processing of routes which are pending best selection.
* Fix for multi-path test case.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
cfd47646b3 bgpd: Adding changes for Selection Deferral Timer config cmd
and DS.

* Added config commands and data structures for deferral timer
configuration and processing.
Cmd : bgp graceful-restart select-defer-time (0-3600)
Cmd : no bgp graceful-restart select-defertime (0-3600)

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
Signed-off-by: Soman K S <somanks@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
2986cac299 bgpd: Adding BGP GR Per Neighbor show commands.
* Added new show command to show the graceful restart
information for each neighbor.
Cmd: show bgp [<ipv4|ipv6>] neighbors [<A.B.C.D|X:X::X:X|WORD>] graceful-restart
* Changes to show neighbors commands for displaying
graceful restart information.
Cmd :show [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6>] neighbors [<A.B.C.D|X:X::X:X|

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
055679e915 bgpd: Adding BGP GR Per Neighbor config commands.
* Added configuration commands for enabling and disabling graceful restart
per neighbour.
Cmd : neighbor A.B.C.D graceful-restart
Cmd : no neighbor A.B.C.D graceful-restart
Cmd : neighbor A.B.C.D graceful-restart-helper
Cmd : no neighbor A.B.C.D graceful-restart-helper
Cmd : neighbor A.B.C.D graceful-restart-disable
Cmd : no neighbor A.B.C.D graceful-restart-disable
* Added configuration commands for disabling graceful restart at the global
Level.
Cmd : bgp graceful-restart disable
Cmd : no  bgp graceful-restart disable

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
Donatas Abraitis
fde246e835 bgpd: Add an option to limit outgoing prefixes
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 16:20:28 +02:00
Donatas Abraitis
80bf45b266 bgpd: Time to deprecate bgpTimerUp
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-04 00:41:47 +02:00
Quentin Young
85bb45956c bgpd: fix too much no listen doc string
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-02 16:26:31 -05:00
Donald Sharp
d2bee6ed41
Merge pull request #5595 from ton31337/fix/bgp_listen_definition
bgpd: Change description for `[no] bgp listen limit` commands
2019-12-31 09:10:04 -05:00
Zoltan Arnold Nagy
3c0e7aa488 bgpd: fix console typo
The console printout had a typo for the number of configured peers label.

Signed-off-by: Zoltan Arnold Nagy <zoltan.arnold.nagy@gmail.com>
2019-12-30 19:44:50 +01:00
Donatas Abraitis
1601a46f22 bgpd: Change description for [no] bgp listen limit commands
It's quite confusing when you see this:
```
exit1-debian-9(config-router)# bgp listen
  listen  Configure BGP defaults
```

And:
```
exit1-debian-9(config-router)# no bgp listen
  listen  unset maximum number of BGP Dynamic Neighbors that can be created
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-27 15:48:03 +02:00
Donatas Abraitis
21d88a7147 bgpd: Make sure we can use no bgp listen range ...
Fixes:
```
exit1-debian-9(config-router)# no bgp listen range 192.168.10.0/24 peer-group TEST
% Peer-group does not exist
exit1-debian-9(config-router)#
```
Closes https://github.com/FRRouting/frr/issues/5570

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-19 22:32:19 +02:00
David Lamparter
5d5393b943 bgpd: use new defaults system (v2)
This moves all the DFLT_BGP_* stuff over to the new defaults mechanism.
bgp_timers_nondefault() added to get better file-scoping.

v2: moved everything into bgp_vty.c so that the core BGP code is
independent of the CLI-specific defaults.  This should make the future
northbound conversion easier.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
David Lamparter
dd65f45ebc bgpd: move config-write to bgp_vty.c
There's no good reason to have this in bgpd.c;  it's just there
historically.  Move it to bgp_vty.c where it makes more sense.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
David Lamparter
1c0d880814 lib: rename memory_vty.c to lib_vty.c
And memory_init() to lib_cmd_init().

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:29 +01:00
Donald Sharp
2d3c8c2957
Merge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set
bgpd: Reject incoming and outgoing UPDATES for AS_SET and AS_CONFED_SET
2019-12-03 21:29:09 -05:00
David Lamparter
410e167972
bgpd: Autocomplete neighbor for clear bgp (#5434)
bgpd: Autocomplete neighbor for clear bgp
2019-12-03 17:13:21 +01:00
Donatas Abraitis
453c92f6e2 bgpd: Autocomplete neighbor for clear bgp
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-27 21:44:46 +02:00
Donatas Abraitis
c8d6f0d6c4 bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL
For readability and maintainability purposes.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-27 10:48:17 +02:00
Donatas Abraitis
4378f57c3e bgpd: Allow deleting by no bgp large-community-list standard WORD
Without with fix we can't delete large-community-list using
no bgp large-community-list standard WORD, but no bgp large-community-list WORD

Let's keep this identical what we have with expanded lists as well.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-26 21:20:05 +02:00
Donatas Abraitis
2f8cc0e565 bgpd: Use sequence numbers for community lists
This patch allows using sequence numbers for community lists. We already have
this for prefix-lists and access-lists.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-26 21:20:02 +02:00
Donatas Abraitis
fb29348a19 bgpd: Reject routes having AS_SET or AS_CONFED_SET
This is the first step towards eliminating AS_SET and AS_CONFED_SET types
and obsolete them in the future.

More information:
https://datatracker.ietf.org/doc/html/draft-ietf-idr-deprecate-as-set-confed-set-02

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-14 19:19:04 +02:00
Donatas Abraitis
4e2786df3e bgpd: Notify "Peer De-configured" after entering 'no neighbor <neighbor> cmd'
Before changes:

~# vtysh -c 'show ip bgp neighbors 192.168.0.2 json' | \
	jq '."192.168.0.2".lastNotificationReason'
null

After changes:

~# vtysh -c 'show ip bgp neighbors 192.168.0.2 json' | \
	jq '."192.168.0.2".lastNotificationReason'
"Cease/Peer Unconfigured"

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-06 20:38:02 +02:00
Rafael Zalamena
2b31007ca2 bgpd: expose sender side AS path loop detection
The sender side AS path loop detection code was implemented since the
import of Quagga code, however it was always disabled by a `ifdef`
guard.

Lets allow the user to decide whether or not to enable this feature on
run-time.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-10-29 16:29:09 -03:00
Don Slice
8e5509b04b bgpd: remove error message for unkown afi/safi combination
Problem reported with error messages appearing in the log
complaining about invalid afi/safi combinations.  Determined
that the error messages were recently added in the function
that turns afi and safi values to strings.  Unfortunately,
the function is called from places using FOREACH_AFI_SAFI,
which spins thru every afi and safi number including some
that are not legal together (ipv4 evpn and l2vpn multicast
for example.)   This fix removes these error messages since
it is not necessarily an error to call it with invalid
combinations.

Ticket: CM-26883
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-10-24 11:29:40 +00:00
Quentin Young
8fa7732f5d bgpd: raise default & max r/w quanta to 64
Vectored writes are more efficient with a higher quantum.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-10-14 18:41:53 +00:00
Donald Sharp
5c117085f6
Merge pull request #5117 from ton31337/fix/remove_deprecation_for_ip_prefix
bgpd: Remove depracated `ip` prefix for as-path/extcommunity/large/co…
2019-10-14 08:14:05 -04:00
Donatas Abraitis
7b9a4750b8 bgpd: Remove depracated ip prefix for as-path/extcommunity/large/communities
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-08 08:39:55 +03:00
Donatas Abraitis
a0a87037ac bgpd: Use uint32_t for maximum-prefix
Currently we have unsigned long which is not what we defined
in CLI (1-4294967295).

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-04 15:46:21 +03:00
Quentin Young
c258527bd2 *: strip trailing whitespace
Some of it has snuck by CI

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-30 16:44:43 +00:00
Dinesh G Dutt
05912a17e6 bgpd: Fixes to error message printed for failed peerings
There was a silly bug introduced when the command to show failed sessions
was added. A missing "," caused the wrong error message to be printed.
Debugging this led down a path that:
   - Led to discovering one more error message that needed to be added
   - Providing the error code along with the string in the JSON output
     to allow programs to key off numbers rather than strings.
   - Fixing the missing ","
   - Changing the error message to "Waiting for Peer IPv6 LLA" to
     make it clear that we're waiting for the link local addr.

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-09-03 19:55:49 +00:00
Dinesh G Dutt
200116db4c bgpd: Add Established and Dropped counts to JSON output of bgp summary
Based on a suggestion by Donald Sharp, this patch adds the counts of the
number of times a BGP peering session has transitioned from Estd->NotEstd
and from NotEstd->Estd to the JSON output only of the
"show [ip] bgp [vrf <vrf>] summary" command. The idea is that even if the
current session is well and up, but a sessions has trasnitionined in and
out of Estd state multiple times, its worth noting that. We cannot change
the non-JSON output as easily, and so this command only addresses the JSON
part for now. The fields added are the ones that were provided only as part
of the "show bgp neighbor" command.

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-09-02 19:37:37 +00:00
Dinesh G Dutt
3577f1c54f bgpd: Add a new command to only show failed peerings
In a data center, having 32-128 peers is not uncommon. In such a situation, to find a
peer that has failed and why is several commands. This hinders both the automatability of
failure detection and the ease/speed with which the reason can be found. To simplify this
process of catching a failure and its cause quicker, this patch does the following:

1. Created a new function, bgp_show_failed_summary to display the
   failed summary output for JSON and vty
2. Created a new function to display the reset code/subcode. This is now used in the
   failed summary code and in the show neighbors code
3. Added a new variable failedPeers in all the JSON outputs, including the vanilla
   "show bgp summary" family. This lists the failed session count.
4. Display peer, dropped count, estd count, uptime and the reason for failure as the
   output of "show bgp summary failed" family of commands
5. Added three resset codes for the case where we're waiting for NHT, waiting for peer
   IPv6 addr, waiting for VRF to init.

This also counts the case where only one peer has advertised an AFI/SAFI.

The new command has the optional keyword "failed" added to the classical summary command.

The changes affect only one existing output, that of "show [ip] bgp neighbors <nbr>". As
we track the lack of NHT resolution for a peer or the lack of knowing a peer IPv6 addr,
the output of that command will show a "waiting for NHT" etc. as the last reset reason.

This patch includes update to the documentation too.

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-09-02 14:21:44 +00:00
Dinesh G Dutt
5cb5f4d04d bgpd: Eliminate all incorrect formulations of afi/safi in JSON
In a number of places, the JSON output had invalid key names for
AFI/SAFI. For example, the key name in JSON was "IPv4 Unicast" which
is invalid as a JSON Key name. Many JSON tools such as those used in
Ansible, jq etc. all fail to parse the output in these scenarios. The
valid name is ipv4Unicast. There's already a routine afi_safi_json()
defined to handle this change, but it was not consistently called.
The non-JSON version was called afi_safi_print() and it merely returned
the CLI version of the string, didn't print anything.

This patch deals with this issue by:
   - Renaming afi_safi_print to get_afi_safi_str()
   - get_afi_safi_str takes an additional param, for_json which if true
     will return the JSON-valid string
   - Renaming afi_safi_json to get_afi_safi_json_str()
   - Creating a new routine get_afi_safi_vty_str() for printing to vty
   - Consistently using get_afi_safi_str() with the appropriate for_json
     value

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-08-27 14:05:39 +00:00
Donatas Abraitis
3eb0d26717
Merge pull request #4821 from vishaldhingra/lcomm_json
bgpd : Ambiguous command: show bgp large-community-list 1
2019-08-26 11:23:30 +03:00
vdhingra
960b69b9df bgpd : Ambiguous command: show bgp large-community-list 1
When user wants to dump individual large-community-list with the name
then bgp throws an error. It is due to command to dump the bgp RIB routes
having a particular large-community-list values. To segregate both the
commands this fix has added the detail keyword in the below command.
show bgp large-community-list <(1-500)|WORD> detail
The same code change is applicable for community-list also.

Signed-off-by: vishaldhingra<vdhingra@vmware.com>
2019-08-25 23:01:02 -07:00
Donatas Abraitis
5d4324440d
Merge pull request #4815 from NaveenThanikachalam/603_bgp_vty
bgpd: Large-communities CLI accepts configurations sans attributes.
2019-08-24 22:52:08 +03:00
Don Slice
dc91261567 bgpd: make clear bgp * clear all peers in all afi/safis
Problem reported that "clear bgp *" only cleared ipv6 peers.
Changed the logic to clear all afi/safis of all peers in
that case.  Also improved the operation of clearing
individual afi/safi using soft/in/out to do the right thing.

Ticket: CM-25887
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-08-20 13:50:58 +00:00
Donald Sharp
f79f7a7bb2 *: Fix spelling errors pointed out by debian packaging
Debian packaging when run finds a bunch of spelling errors:

I: frr: spelling-error-in-binary usr/bin/vtysh occurences occurrences
I: frr: spelling-error-in-binary usr/lib/frr/bfdd Amount of times Number of times
I: frr: spelling-error-in-binary usr/lib/frr/bgpd occurences occurrences
I: frr: spelling-error-in-binary usr/lib/frr/bgpd recieved received
I: frr: spelling-error-in-binary usr/lib/frr/isisd betweeen between
I: frr: spelling-error-in-binary usr/lib/frr/ospf6d Infomation Information
I: frr: spelling-error-in-binary usr/lib/frr/ospfd missmatch mismatch
I: frr: spelling-error-in-binary usr/lib/frr/pimd bootsrap bootstrap
I: frr: spelling-error-in-binary usr/lib/frr/pimd Unknwon Unknown
I: frr: spelling-error-in-binary usr/lib/frr/zebra Requsted Requested
I: frr: spelling-error-in-binary usr/lib/frr/zebra uknown unknown
I: frr: spelling-error-in-binary usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0 overriden overridden

This commit fixes all of them except the bgp `recieved` issue due to
it being part of json output.  That one will need to go through
a deprecation cycle.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-19 10:36:53 -04:00
Naveen Thanikachalam
82cdf28d2f bgpd: Large-communities CLI accepts configurations sans attributes.
BGP large-communities configuration CLI is successful even if
the command is configured without any attributes.
For ex., the below commands are successful.
         1) "bgp large-community-list standard TEST permit"
         2) "bgp large-community-list standard TEST deny"

The CLI definitions that allow these erroneous configurations need to be removed.

Signed-off-by: NaveenThanikachalam nthanikachal@vmware.com
2019-08-11 21:41:43 -07:00
Don Slice
3c13337daa bgpd: simplify json create/free for memleak fix
Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-08-05 05:53:13 -07:00
Don Slice
f86897b945 bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json
Problem reported with memory leak when the command "show bgp vrf all
ipv6 unicast summary json" is issued.  Found that the problem only
occurs if the configuration does not actually include the ipv6
address-family but does contain ipv4 unicast peers. If we didn't
match a peer in the address-family being displayed, we would create
the json object but never free it.  This fix actually stops creating
the json object in this section of code and lets the create happen
in the area where the match occurs.

Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-08-02 04:50:46 -07:00
Russ White
2d8b235823
Merge pull request #4582 from donaldsharp/do_not_warn
bgpd: Do not display to end user not found afi/safi's
2019-07-30 10:38:25 -04:00
Quentin Young
a041a8fff2
Merge pull request #4728 from ton31337/fix/next-hop-self_force_alias_for_ipv6
bgpd: Add hidden `next-hop-self all` for all address families
2019-07-29 12:41:55 -04:00
Don Slice
8fa7d4447f bgpd: solve invalid error message when clearing interface peer
Problem reported that if "clear bgp swp1" is issued, an error
message is received saying the name or address is malformed. This
was because of a change in bgp_vty.c that removed the storing
and passing of the interface name for this command. Commit that
caused the problem was ac5dec7e88ce2f8cd2943bb61437046718fb34c2.

Ticket: CM-25737
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-07-26 16:48:22 +00:00
Donatas Abraitis
2d94b6d1d2 bgpd: Add hidden next-hop-self all for all address families
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-07-25 15:14:40 +03:00
David Lamparter
2ed9fe4a2b bgpd: autocomplete "router bgp" ASN
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-03 16:55:24 +02:00
Russ White
53f477016e
Merge pull request #4496 from chiragshah6/evpn_dev2
bgpd: vrf route leak handle bgp instance delete recreate
2019-07-02 10:55:25 -04:00
Donald Sharp
e27957c062 bgpd: Fixup no redistribute ... commands to allow any order
The `no redistribute ...` commands were not allowing
the input to be in any order.  Fix code to allow this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-24 19:51:51 -04:00
Donald Sharp
5dbef72f7f bgpd: Do not display to end user not found afi/safi's
When we are issuing a new command:

router bgp
   bgp default local-preference ..
   -or-
   bgp cluster-id ...
   -or-
   bgp disable-ebgp-connected-route-check

Do not tell them that afi/safi's are not configured.  There is nothing
to do with this information and it will create confusion in the
end user that we are looking for afi/safi's that are never going to
be configed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-20 12:36:19 -04:00
David Lamparter
eaf58ba906 lib: use MTYPE_STATIC
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-21 08:54:25 +02:00
Donald Sharp
8091266418 bgpd: neighbor X:X::X default-originate complains about (null)
The `neighbor X:X::X default-originate command is complaining
that:
The route-map '(null)' does not exist.

Upon inspection of the code we were passing a NULL
string to the lookup.  Testing for null gets us this:

donna.cumulusnetworks.com# conf t
donna.cumulusnetworks.com(config)# router bgp 99
donna.cumulusnetworks.com(config-router)# neighbor 2001:1::1:2 remote-as 99
donna.cumulusnetworks.com(config-router)# neighbor 2001:1::1:2 default-originate
donna.cumulusnetworks.com(config-router)# end
donna.cumulusnetworks.com# show run
Building configuration...

Current configuration:
!
frr version 7.2-dev
frr defaults datacenter
hostname donna.cumulusnetworks.com
log stdout
no ipv6 forwarding
!
ip route 4.5.6.7/32 10.50.11.4
!
router bgp 99
 neighbor 2001:1::1:2 remote-as 99
 !
 address-family ipv4 unicast
  neighbor 2001:1::1:2 default-originate

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-20 11:12:35 -04:00
Donald Sharp
d5568431f7 bgpd: BGP_ERR_MULTIPLE_INSTANCE_NOT_SET is an impossible condition
This code is not returned anywhere in the system as that bgp
is by default multiple-instance 'only' now.  So remove
the last remaining bits of it from the code base.

Remove BGP_ERR_MULTIPLE_INSTANCE_USED too.

Make bgp_get explicitly return BGP_SUCCESS
instead of 0.

Remove the multi-instance error code too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-18 09:26:00 -04:00
Chirag Shah
b20875ea0e bgpd: vrf leak show cmds to check deleted instance
When a source bgp vrf instance is deleted, ensure the referencing
of it in vrf route leak show commands.

Ticket:CM-20534 CM-24484

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-06-17 15:41:51 -07:00
Chirag Shah
48381346d7 bgpd: router bgp export leaked vpn routes
two bgp vrf instance has vrf route leak configured,
when a source vrf x is deleted, its leaked routes are cleaned
up from the destination and vpn table.

With this change when a source bgp instance is reconfigured,
export its routes back to destination vrfs where it is configured
as leak.

Ticket:CM-20534 CM-24484
Reviewed By:
Testing Done:

configure vrf leak between two vrf intances,
delete and readd source vrf and checked its routes
exported to vpn table and leaked vrfs table.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-06-17 15:41:50 -07:00
Chirag Shah
9ecf931b13 bgpd: no router bgp cleanup vrf leaked vpn routes
A VRF leak is configured between two vrfs,
bgp VRF X and VRF Y.
When a bgp VRF X is removed, unimport bgp VRF X routes
from VPN and VRF Y.
If VRF X is also importing from bgp VRF Y, remove X from
export list of Y and do required route cleanup.

Ticket:CM-20534 CM-24484
Reviewed By:
Testing Done:

Before deleteing vrf1002:
nl1# show ip route vrf vrf1003 9.9.2.4/32
Routing entry for 9.9.2.4/32
  Known via "bgp", distance 200, metric 0, vrf vrf1003, best
  Last update 00:04:51 ago
  * 200.2.8.2, via swp1.2(vrf vrf1002)
  * 200.2.9.2, via swp2.2(vrf vrf1002)
  * 200.2.10.2, via swp3.2(vrf vrf1002)

Instance vrf1003:
This VRF is importing IPv4 Unicast routes from the following VRFs:
  vrf1002
Import RT(s): 6.0.2.9:2
This VRF is exporting IPv4 Unicast routes to the following VRFs:
  vrf1002
RD: 6.0.3.9:3
Export RT: 6.0.3.9:3

After deleting vrf1002:
nl1(config)# no router bgp 64902 vrf vrf1002

nl1# show ip route vrf vrf1003 9.9.2.4/32
Routing entry for 9.9.2.4/32
  Known via "bgp", distance 20, metric 0, vrf vrf1003, best
  Last update 00:00:32 ago
  * 200.3.8.2, via swp1.3
  * 200.3.9.2, via swp2.3
  * 200.3.10.2, via swp3.3

Instance vrf1003:
This VRF is importing IPv4 Unicast routes from the following VRFs:
  vrf1002
Import RT(s):
This VRF is not exporting IPv4 Unicast routes to any other VRF

nl1# show bgp ipv4 vpn
No BGP prefixes displayed, 0 exist

Readd vrf1002:
points back to source vrf

nl1# show ip route vrf vrf1003 9.9.2.4/32
Routing entry for 9.9.2.4/32
  Known via "bgp", distance 200, metric 0, vrf vrf1003, best
  Last update 00:00:21 ago
  * 200.2.8.2, via swp1.2(vrf vrf1002)
  * 200.2.9.2, via swp2.2(vrf vrf1002)
  * 200.2.10.2, via swp3.2(vrf vrf1002)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-06-17 15:39:13 -07:00
Quentin Young
dec5b24733
Merge pull request #4505 from ton31337/feature/autocomplete_bgp_peer-group
bgpd: List all groups dynamically for commands with peer-group
2019-06-17 13:53:48 -04:00
Chirag Shah
efb4077a9c bgpd: show bgp vrfs formatting
show bgp vrfs command is formatted with couple
of things.

show bgp vrfs to inclue bgp vrf instance's
SVI interface.
Move L3vni, RMAC and SVI value in next line.

Ticket:CM-25317
Reviewed By:CCR-8816
Testing Done:

New Output:
TORS1# show bgp vrfs
Type  Id     routerId          #PeersVfg  #PeersEstb  Name
             L3-VNI            RouterMAC              Interface
DFLT  0      27.0.0.15         2          2           default
             0                 00:00:00:00:00:00      unknown
 VRF  31     45.0.8.2          0          0           vrf3
             4003              00:02:00:00:00:4e      vlan4003
 VRF  35     45.0.2.2          0          0           vrf1
             4001              00:02:00:00:00:4e      vlan4001
 VRF  25     45.0.6.2          0          0           vrf2
             4002              00:02:00:00:00:4e      vlan4002

Total number of VRFs (including default): 4

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-06-14 08:47:26 -07:00
Donatas Abraitis
d7b9898c7f bgpd: List all groups dynamically for commands with peer-group
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-06-11 23:29:32 +03:00
Don Slice
8688b3e76b bgpd: add l2vpn evpn to afi safi parse utility
Problem reported with "clear bgp l2vpn evpn * soft" clearing the
wrong afi/safi (cleared ipv6 unicast instead).  Determined that
the calling function used the argv_find_and_parse_afi/safi routines
to determine the correct afi/safi to pass on.  Since l2vpn/evpn were
missing from the lookup, the command defaulted to ipv6 unicast.  This
fix just adds that afi/safi to the lookup routine.

Ticket: CM-25167
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-06-10 05:48:36 -07:00
Donald Sharp
4a3c9cfd11 bgpd: Remove [no] bgp config-type <cisco|zebra>
This command has been deprecated for a year and no-one has complained.
Remove from system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 14:58:26 -04:00
Donald Sharp
8fbb485392 bgpd: Remove BGP_OPT_MULTIPLE_INSTANCE flag
Since we no-longer allow you to select multiple-instance
or not from the cli, let's completely remove the flag
as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 14:53:55 -04:00
Donald Sharp
7ccee8feee bgpd: Remove deprecated '[no] bgp multiple-instance' command
Remove this command from the cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 14:40:32 -04:00
Lou Berger
692f6582cc
Merge pull request #4384 from dslicenc/bgp-no-delete-default
bgpd: disable deleting default instance if vrf instances exist
2019-05-28 11:45:34 -04:00
Donald Sharp
cac9e917eb bgpd: Display FD used for peer
When issuing a `show bgp neighbor...` command display to the
end user the FD used for communication.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-24 08:27:19 -04:00
Don Slice
dd5868c2cc bgpd: disable deleting default instance if vrf instances exist
Problem reported with deleting the default BGP instance where there
are vrf instances that depend on it (like l2vpn evpn vrfs).  Since
importing for vrf route-leaking also requires the existence of the
default instance, disallowing deleting the BGP default instance if
anyt vrf instance is also defined.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-05-22 13:04:26 -07:00
Renato Westphal
6982ab8f68 bgpd: remove deprecated "bgp enforce-first-as" command
The one-year deprecation period has passed, remove it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-20 22:04:52 -03:00
Russ White
caca2c705c
Merge pull request #4339 from sworleys/Add-AFI_UNSPEC
lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enum
2019-05-16 09:59:55 -04:00
Stephen Worley
b26f891dca lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enum
Add an upspecified option to the AFI enum and update
switch statements using it in bgpd and pbrd.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-05-14 12:19:12 -07:00
Sarita Patra
52e5b8c408 bgpd: display bgp neighbor advertised-routes json warning message
Issue 1:
Getting an empty json without any warning message, while executing
the command "show ip bgp neighbor <x.x.x.x> advertised-routes
json" when the bgp instance is not present or getting created.

Issue 2:
Getting an empty json without any warning message, while executing
the command "show ip bgp vrf/view <name> advertised-routes json"
when the specified view/vrf is not present.

Fix:
Display warning message while executing the above cli commands, when
the bgp instance, specified vrf is not present.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-14 12:11:34 -07:00
Donatas Abraitis
16941c05ad bgpd: Remove unnecessary trailing tab
This is very annoying and every time I have to fix this manually
after auto-formatting.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-05-11 10:14:06 +03:00
vishaldhingra
169b72c851 bgpd : lcommlist not shows the standard and expanded conf. correctly.
lcommunity_list_show uses the wrong macro to calculate the style.
Use the correct one LARGE_COMMUNITY_LIST_STANDARD.

Signed-off-by: vishaldhingra<vdhingra@vmware.com>
2019-05-07 21:12:03 -07:00
Donatas Abraitis
1bc4e53187 bgpd: Make sure next-hop-self all backward compatible with force
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-04-25 16:39:49 +03:00
Russ White
ecedbaa13b
Merge pull request #3932 from nitinsoniism/bgp_gshut_clear_soft_in_out
bgpd: handle all afi safi while bgp clear soft
2019-03-31 17:05:14 -04:00
Nitin Soni
99b3ebd3b9 bgpd: handle all afi safi while bgp clear soft
Currently, as part of bgp clear soft inboud and outbound we don't handle
l2vpn evpn. Now clearing soft for all supported afi safi.
One of the examples where this was a problem -

On applying graceful-shutdown, bgp clear soft inboud and outbound don't
handle AFI L2VPN and SAFI EVPN. Gshut gets applied to EVPN Type 5 routes
by asking peer to refresh the routes (provided we have config - "advertise
ipv4/ipv6 unicast" as part of l2vpn evpn) but is not applied to type 2
and type 3 EVP routes. This fix takes care of l2vpn evpn type2 and type3
routes being readvertised with gshut community.

This fix also fixes similar issues related to following where bgp clear
soft is requred for l2vpn evpn -
-config bgp cluster-id
-config bgp client-to-client reflection
-config bgp default local-preference
-config bgp route-reflector allow-outbound-policy
-config bgp disable-ebgp-connected-route-check

Ticket: CM-22813
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8361
Testing-Done:
-With gshut configured on all BGP VRFs (operator has to know about the
auto-created BGP VRFs - we do show them in show commands - and turn on
graceful-shutdown in all of them.
-We announce all EVPN routes (type-2, type-3 and type-5) with GSHUT and
we mark IPv4/IPv6 routes in a VRF that are based on received EVPN type-2
or type-5 routes with local pref 0.
-On the receiver side, when EVPN routes are received with GSHUT, the
correct handling takes place (to treat them with local preference 0, and
hence not select them)
-When the gshut configuration is removed on all BGP VRFs, we re-announce
all of our EVPN routes without GSHUT and receiver does the appropriate
thing. Also, we no longer mark EVPN-based IPv4/IPv6 routes with local
pref 0.
-evpn-smoke
-bgp-smoke
2019-03-26 09:34:29 -07:00
Lou Berger
0eccb48001
Merge pull request #3947 from dslicenc/bgpd-redist-connected-vrf
Bgpd redist connected vrf
2019-03-17 14:26:44 -04:00
Donald Sharp
86dd09667a
Merge pull request #3920 from AkhileshSamineni/show_bgp_ipv6_summary_fix_master
bgpd: Incorrect number of peers count in "show bgp ipv6 summary" output
2019-03-15 08:54:03 -04:00
Don Slice
fc2408ec18 bgpd: move bgp_update_redist_vrf_bitmaps to bgp_zebra.c for wider use beyond bgp_vty
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-14 15:05:38 +00:00
David Lamparter
0a04c7a659
Merge pull request #3925 from chiragshah6/evpn_dev2
bgpd: vrl route-leak show with all vrfs option
2019-03-11 19:48:31 +01:00
David Lamparter
ab04f34ff8
Merge pull request #3860 from AkhileshSamineni/show_bgp_af_neigh_fix
bgpd: 'show bgp [ipv4|ipv6] neighbors' displays all address family neighbors
2019-03-11 19:43:05 +01:00
David Lamparter
83152933da
Merge pull request #3898 from dslicenc/peer-group-remote-as
bpgd: resolve more neighbor peer-group issues
2019-03-11 19:40:24 +01:00
Chirag Shah
0391580665 bgpd: vrl route-leak show with all vrfs option
VRF Route Leak's
show bgp vrf all ipv4 unicast route-leak
is not supported with `all` keyword.

Testing Done:

bl1# show bgp vrf all ipv4 unicast route-leak

Instance default:
This VRF is not importing IPv4 Unicast routes from any other VRF
This VRF is not exporting IPv4 Unicast routes to any other VRF

Instance vrf3:
This VRF is importing IPv4 Unicast routes from the following VRFs:
  vrf1
Import RT(s): 144.1.1.2:10
This VRF is exporting IPv4 Unicast routes to the following VRFs:
  vrf1
RD: 144.1.3.2:9
Export RT: 144.1.3.2:9

Instance vrf1:
This VRF is importing IPv4 Unicast routes from the following VRFs:
  vrf3
Import RT(s): 144.1.3.2:9
This VRF is exporting IPv4 Unicast routes to the following VRFs:
  vrf3
RD: 144.1.1.2:10
Export RT: 144.1.1.2:10

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-03-07 15:44:13 -08:00
Akhilesh Samineni
210ec2a0d6 bgpd: Incorrect number of peers count in "show bgp ipv6 summary output
The "show bgp ipv6 summary" output displays incorrect number of peers count.

sonic# show bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.1, local AS number 65100 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 5, using 103 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2003::1 4 65099 0 0 0 0 0 never Active
2088::1 4 65100 0 0 0 0 0 never Active
3021::2 4 65100 0 0 0 0 0 never Active

Total number of neighbors 3
sonic#
In the above output, the peers count displays as 5 but the actual peer count is 3, i.e.. 3 neighbors are activated in ipv6 unicast address family.
Displayed peer count (5) is the number of the neighbors activated in a BGP instance.

Fix : Now the peers count displays the number of neighbors activated per afi/safi.
After Fix:
sonic# show bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.1, local AS number 65100 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 3, using 62 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2003::1 4 65099 0 0 0 0 0 never Active
2088::1 4 65100 0 0 0 0 0 never Active
3021::2 4 65100 0 0 0 0 0 never Active

Total number of neighbors 3
sonic#

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
2019-03-07 13:17:25 +05:30
David Lamparter
d3b05897ed
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
2019-03-06 15:54:44 +01:00
Don Slice
390485fdc9 bpgd: resolve more neighbor peer-group issues
Found in testing that in a certain sequence, a neighbor's peer-group
membership would be lost.  This fix resolves that issue. Additionally
found that "no neighbor swp1 remote-as 2" would sometimes leave the
config with "neighbor swp1 remote-as 0" rather than removing from the
config. That one is also resolved.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-02 19:44:10 +00:00
Rafael Zalamena
64e4a6c56f vtysh: hide old BGP vpnv(4|6) commands
Only show them when explicit compiled with KEEP_OLD_VPN_COMMANDS.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-28 11:15:15 -03:00
Quentin Young
0a22ddfbb1 *: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Tim Bray
e3b78da875 *: Rename backet to bucket
Presume typo from original author

Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-25 16:22:36 +00:00
Akhilesh Samineni
d1927ebe5f bgpd: 'show bgp [ipv4|ipv6] neighbors' displays all address family neighbors
Display only ipv4 neighbors when 'show bgp ipv4 neighbors' command is issued.
Display only ipv6 neighbors when 'show bgp ipv6 neighbors' command is issued.
Take the address family of the peer address into account, while displaying the neighbors.

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
2019-02-24 15:00:31 +05:30
David Lamparter
cbcaac3fb1
Merge pull request #3746 from ton31337/feature/rfc_8212
bgpd: Implement RFC8212
2019-02-19 13:54:23 +01:00
David Lamparter
b57442d701
Merge pull request #3706 from pguibert6WIND/graceful_restart_range
Graceful restart range
2019-02-18 13:10:31 +01:00
Donatas Abraitis
9dac9fc80e bgpd: Implement RFC8212
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-02-17 23:17:00 +02:00
Quentin Young
3b61f61005 bgpd: use correct specifier to print asn
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-04 16:50:30 +00:00
Philippe Guibert
c1779b7dcd bgpd: enlarge bgp stalepath timer range from 1-3600 to 1-4095
the maximum value for stalepath timer is extended to 4095 to align with
bgp restart timer value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-30 17:10:31 +01:00
Philippe Guibert
c72d031488 bgpd: increase bgp restart timer value from 1-3600 to 1-4095
rfc of bgp graceful restart mechanism permits to increase the
restart timer, since its value is encoded on 12 bit.
So make available the possibility to extend it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-30 17:10:31 +01:00
Russ White
fc6da51705
Merge pull request #3653 from dslicenc/bgpd-remote-as
bgpd: improve peer-group remote-as definitions
2019-01-29 09:58:02 -05:00
Donald Sharp
dc2f50f378 bgpd: interface based peers should automatically override it's peer group
When a interface based peer is setup and if it is part of a peer
group we should ignore this and just use the PEER_FLAG_CAPABILITY_ENHE
no matter what.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-25 20:40:05 -05:00