Commit Graph

1418 Commits

Author SHA1 Message Date
Russ White
a481d93941
Merge pull request #17053 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop deprecated `bgp network import-check exact` command
2024-10-15 11:14:35 -04:00
Donald Sharp
0f8842ed18 bgpd: Allow specification of vrf in show bgp neighbor graceful-restart
This command did not allow the operator to display neighbor information
related to graceful-restart when used inside of a vrf.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-10 09:13:39 -04:00
Donatas Abraitis
5913d49d5b bgpd: Drop deprecated bgp network import-check exact command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-10 12:53:51 +03:00
Donald Sharp
40c94ca369 bgpd: Remove dead code from recent commit
Recent commit 4d0e7a49cf
brought in changes that moved a check for ret up
in the code, caused some code to be left around
and be effectively dead since it would never be called.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-25 09:30:37 -04:00
Russ White
1a2eaba14c
Merge pull request #16838 from opensourcerouting/fix/refresh_pr_9079
Refreshement of BGP multi ASNs
2024-09-24 10:01:10 -04:00
Donald Sharp
8b25888ce8
Merge pull request #16816 from opensourcerouting/feature/bgp_dual_as
bgpd: Implement BGP dual-as feature
2024-09-18 11:59:16 -04:00
Don Slice
4d0e7a49cf bgpd: VRF-Lite fix default bgp delete
1. bgp coredump is observed when we delete default bgp instance
   when we have multi-vrf; and route-leaking is enabled between
   default, non-default vrfs.
Removing default router bgp when routes leaked between non-default vrfs.
- Routes are leaked from VRF-A to VRF-B
- VPN table is created with auto RD/RT in default instance.
- Default instance is deleted, we try to unimport the routes from all VRFs
- non-default VRF schedules a work-queue to process deleted routes.
- Meanwhile default bgp instance clears VPN tables and free the route
  entries as well, which are still referenced by non-default VRFs which
  have imported routes.
- When work queue process starts to delete imported route in VRF-A it cores
  as it accesses freed memory.

- Whenever we delete bgp in default vrf, we skip deleting routes in the vpn
  table, import and export lists.
- The default hidden bgp instance will not be listed in any of the show
  commands.
- Whenever we create new default instance, handle it with AS number change
  i.e. old hidden default bgp's AS number is updated and also changing
  local_as for all peers.

2. A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- First problem with current behavior.
  Define two vrfs with different ASNs and then add import between.
  starting without any bgp config (no default instance)
  A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- Second related problem.  Start with a default instance and a vrf in a
  different ASN. Do an import statement in the vrf for a bgp vrf instance
  not yet defined and it auto-creates that bgp/vrf instance and it inherits
  the ASN of the importing vrf
- Handle bgp instances with different ASNs and handle ASN for auto created
  BGP instance

Signed-off-by: Kantesh Mundaragi <kmundaragi@vmware.com>
2024-09-18 18:03:10 +03:00
Russ White
6109043c54
Merge pull request #16720 from opensourcerouting/fix/default_originate_not_needed_if_not_enabled
bgpd: Do not scan update-groups if default-originate timer is set to 0
2024-09-18 10:11:23 -04:00
Donatas Abraitis
cadfa693d6 bgpd: Implement BGP dual-as feature
This is helpful for migrations, etc.

The neighbor is configured with:

```
router bgp 65000
 neighbor X local-as 65001 no-prepend replace-as dual-as
```

Neighbor X can use either 65000, or 65001 to peer with.

Closes: https://github.com/FRRouting/frr/issues/13928

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-13 10:51:41 +03:00
Donald Sharp
340d51fc3a
Merge pull request #16751 from opensourcerouting/fix/solo_peer-group
bgpd: Some peer-groups related changes/fixes
2024-09-05 17:42:20 -04:00
Donatas Abraitis
9de74cf0be bgpd: Show what is the real type of the peer-group
```
ton# sh ip bgp peer-group

BGP peer-group pg-a
  Peer-group type is auto
  Configured address-families: IPv4 Unicast;

BGP peer-group pg-e, remote AS 0
  Peer-group type is external
  Configured address-families: IPv4 Unicast;

BGP peer-group pg-i, remote AS 65001
  Peer-group type is internal
  Configured address-families: IPv4 Unicast;
ton#
```

`auto` should be handled accordingly.

Fixes: 0dfe25697f ("bgpd: Implement neighbor X remote-as auto")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-05 15:48:14 +03:00
Donatas Abraitis
b9d4191a51 bgpd: Allow using solo for peer-groups
Inherit solo flag for peer-group members also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-05 15:16:05 +03:00
Carmine Scarpitta
fe5037b703 bgpd: Deal with SRv6 locator instead of chunk
Currently, when SRv6 is enabled in BGP, BGP requests a locator chunk
from Zebra. Zebra assigns a locator chunk to BGP, and then BGP can
allocate SIDs from the locator chunk.

Recently, the implementation of SRv6 in Zebra has been improved, and a
new API has been introduced for obtaining/releasing the SIDs.

Now, the daemons no longer need to request a chunk.

Instead, the daemons interact with Zebra to obtain information about the
locator and subsequently to allocate/release the SIDs.

This commit extends BGP to use the new SRv6 API. In particular, it
removes the chunk throughout the BGP code and modifies BGP to
request/save/advertise the locator instead of the chunk.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-05 10:59:59 +02:00
Donatas Abraitis
5b24d3b223 bgpd: Turn off default-originate timer
If the neighbor is not configured with `neighbor X default-originate route-map ...`,
then this timer is useless.

Change the logic to be it disabled by default, but enabled automatically once the
route-map is configured for default-originate command.

Automatically assigned timer value is as before, 5 seconds.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-03 16:09:26 +03:00
Donatas Abraitis
8412fa8f98 bgpd: Allow setting default-originate rescan to be up to 65535 seconds
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-02 14:58:10 +03:00
Donatas Abraitis
b57cb7a8e8
Merge pull request #16574 from donaldsharp/non_json_free_ptr
bgpd: Free up non-freed json memory on function return
2024-08-14 18:44:54 +02:00
Donatas Abraitis
464212db08 bgpd: Avoid use-after-free when doing no router bgp with auto created instances
```
==1145965==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030007159c0 at pc 0x55ade8d962d1 bp 0x7ffec4ce74c0 sp 0x7ffec4ce74b0
READ of size 8 at 0x6030007159c0 thread T0
    0 0x55ade8d962d0 in no_router_bgp bgpd/bgp_vty.c:1701
    1 0x7efe5aed19ed in cmd_execute_command_real lib/command.c:1002
    2 0x7efe5aed1da3 in cmd_execute_command lib/command.c:1061
    3 0x7efe5aed2303 in cmd_execute lib/command.c:1227
    4 0x7efe5af6c023 in vty_command lib/vty.c:616
    5 0x7efe5af6d2d2 in vty_execute lib/vty.c:1379
    6 0x7efe5af77df2 in vtysh_read lib/vty.c:2374
    7 0x7efe5af64c9b in event_call lib/event.c:1996
    8 0x7efe5af03887 in frr_run lib/libfrr.c:1232
    9 0x55ade8cd9850 in main bgpd/bgp_main.c:555
    10 0x7efe5aa29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    11 0x7efe5aa29e3f in __libc_start_main_impl ../csu/libc-start.c:392
    12 0x55ade8cdc314 in _start (/usr/lib/frr/bgpd+0x16f314)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-14 10:16:01 +03:00
Donald Sharp
ce4e451c5b bgpd: Free up non-freed json memory on function return
json_peers is allocated in the above if statement block
for json but is not freed in this code path.  Noticed
by running Address Sanitizer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-13 08:49:01 -04:00
Donatas Abraitis
14b5c78d44 bgpd: Remove BGP_UPDATE_DELAY_MIN/MAX
Found randomly, and seems not used anymore.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-07 17:39:28 +03:00
Donatas Abraitis
04f9372409 bgpd: Do not process VRF import/export to/from auto created VRF instances
Fixes the crash:

```
(gdb) bt
0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=124583315603008) at ./nptl/pthread_kill.c:44
1  __pthread_kill_internal (signo=11, threadid=124583315603008) at ./nptl/pthread_kill.c:78
2  __GI___pthread_kill (threadid=124583315603008, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
3  0x0000714ed0242476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
4  0x0000714ed074cfb7 in core_handler (signo=11, siginfo=0x7ffe6d9792b0, context=0x7ffe6d979180) at lib/sigevent.c:258
5  <signal handler called>
6  0x000060f55e33ffdd in route_table_get_info (table=0x0) at ./lib/table.h:177
7  0x000060f55e340053 in bgp_dest_table (dest=0x60f56dabb840) at ./bgpd/bgp_table.h:156
8  0x000060f55e340c9f in is_route_injectable_into_vpn (pi=0x60f56dbc4a60) at ./bgpd/bgp_mplsvpn.h:331
9  0x000060f55e34507c in vpn_leak_from_vrf_update (to_bgp=0x60f56da52070, from_bgp=0x60f56da75af0, path_vrf=0x60f56dbc4a60) at bgpd/bgp_mplsvpn.c:1575
10 0x000060f55e346657 in vpn_leak_from_vrf_update_all (to_bgp=0x60f56da52070, from_bgp=0x60f56da75af0, afi=AFI_IP) at bgpd/bgp_mplsvpn.c:2028
11 0x000060f55e340c10 in vpn_leak_postchange (direction=BGP_VPN_POLICY_DIR_TOVPN, afi=AFI_IP, bgp_vpn=0x60f56da52070, bgp_vrf=0x60f56da75af0) at ./bgpd/bgp_mplsvpn.h:310
12 0x000060f55e34a692 in vpn_leak_postchange_all () at bgpd/bgp_mplsvpn.c:3737
13 0x000060f55e3d91fc in router_bgp (self=0x60f55e5cbc20 <router_bgp_cmd>, vty=0x60f56e2d7660, argc=3, argv=0x60f56da19830) at bgpd/bgp_vty.c:1601
14 0x0000714ed069ddf5 in cmd_execute_command_real (vline=0x60f56da32a80, vty=0x60f56e2d7660, cmd=0x0, up_level=0) at lib/command.c:1002
15 0x0000714ed069df6e in cmd_execute_command (vline=0x60f56da32a80, vty=0x60f56e2d7660, cmd=0x0, vtysh=0) at lib/command.c:1061
16 0x0000714ed069e51e in cmd_execute (vty=0x60f56e2d7660, cmd=0x60f56dbf07d0 "router bgp 100\n", matched=0x0, vtysh=0) at lib/command.c:1227
17 0x0000714ed076faa0 in vty_command (vty=0x60f56e2d7660, buf=0x60f56dbf07d0 "router bgp 100\n") at lib/vty.c:616
18 0x0000714ed07719c4 in vty_execute (vty=0x60f56e2d7660) at lib/vty.c:1379
19 0x0000714ed07740f0 in vtysh_read (thread=0x7ffe6d97c700) at lib/vty.c:2374
20 0x0000714ed07685c4 in event_call (thread=0x7ffe6d97c700) at lib/event.c:1995
21 0x0000714ed06e3351 in frr_run (master=0x60f56d1d2e40) at lib/libfrr.c:1232
22 0x000060f55e2c4b44 in main (argc=7, argv=0x7ffe6d97c978) at bgpd/bgp_main.c:555
(gdb)
```

Fixes https://github.com/FRRouting/frr/issues/16484

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-28 14:26:13 +03:00
Donald Sharp
07489b4a3b
Merge pull request #16473 from opensourcerouting/fix/add_soft_version_in_summary
bgpd: Show software version in bgp summary
2024-07-26 07:34:08 -04:00
Donatas Abraitis
968ae85252 bgpd: Show software version in bgp summary
E.g.:

```
$ vtysh -c 'show bgp summary json' | jq '.ipv4Unicast.peers'
{
  "127.0.0.1": {
    "hostname": "donatas.net",
    "softwareVersion": "GoBGP/3.26.0",
    "remoteAs": 65001,
    "localAs": 65001,
    "version": 4,
    "msgRcvd": 12,
    "msgSent": 16,
    "tableVersion": 0,
    "outq": 0,
    "inq": 0,
    "peerUptime": "00:00:10",
    "peerUptimeMsec": 10000,
    "peerUptimeEstablishedEpoch": 1721908563,
    "pfxRcd": 0,
    "pfxSnt": 0,
    "state": "Established",
    "peerState": "OK",
    "connectionsEstablished": 1,
    "connectionsDropped": 0,
    "idType": "ipv4"
  },
  "127.0.0.3": {
    "hostname": "putin-xujlo",
    "domainname": "donatas.net",
    "softwareVersion": "ExaBGP/5.0.0-20240725+main-a56c70e84a",
    "remoteAs": 65003,
    "localAs": 65001,
    "version": 4,
    "msgRcvd": 3,
    "msgSent": 7,
    "tableVersion": 0,
    "outq": 0,
    "inq": 0,
    "peerUptime": "00:00:13",
    "peerUptimeMsec": 13000,
    "peerUptimeEstablishedEpoch": 1721908560,
    "pfxRcd": 0,
    "pfxSnt": 0,
    "state": "Established",
    "peerState": "OK",
    "connectionsEstablished": 1,
    "connectionsDropped": 0,
    "idType": "ipv4"
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-25 15:07:57 +03:00
Donatas Abraitis
fa9bd07ae5 bgpd: Keep the last reset reason before we reset the peer
If we send a notification, there is no point setting the last_reset, because
bgp_notify_send() sets last_reset to PEER_DOWN_NOTIFY_SEND (almost everywhere).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-25 13:22:27 +03:00
Donatas Abraitis
bfedb38110 bgpd: Skip empty (auto created) VRF instances when deleting a default BGP instance
Auto created VRF instances does not have any config, so it's not relevant
depending on them.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-15 16:20:31 +03:00
Donatas Abraitis
03c086866b bgpd: Skip automatically created BGP instances for show CMDs
When using e.g. `adverise-all-vni`, and/or `import vrf ...`, the VRF instance
is created with a default's VRF ASN and tagged as AUTO_VRF. We MUST skip them
here also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-15 16:10:57 +03:00
Donatas Abraitis
80a4f87c9a bgpd: Mark VRF instance as auto created if import vrf is configured for this instance
If we create a new BGP instance (in this case VRF instance), it MUST be marked
as auto created, to avoid bgpd changing VRF instance's ASN to the default VRF's.

That's because of the ordering when FRR reload is happening.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-15 16:10:57 +03:00
Donatas Abraitis
0ed36e44f8 bgpd: Convert int to enum peer_asn_type
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-04 23:07:01 +03:00
Donatas Abraitis
0dfe25697f bgpd: Implement neighbor X remote-as auto
In some cases (large scale) it's desired to avoid changing configurations, but
let the BGP to automatically handle ASN changes.

`auto` means the peering can be iBGP or eBGP. It will be automatically detected
and adjusted from the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-04 14:42:19 +03:00
vivek
b5682ffbf0 *: Add and use option for graceful (re)start
Add a new start option "-K" to libfrr to denote a graceful start,
and use it in zebra and bgpd.

zebra will use this option to denote a planned FRR graceful restart
(supporting only bgpd currently) to wait for a route sync completion
from bgpd before cleaning up old stale routes from the FIB. An optional
timer provides an upper-bounds for this cleanup.

bgpd will use this option to denote either a planned FRR graceful
restart or a bgpd-only graceful restart, and this will drive the BGP
GR restarting router procedures.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-07-01 13:02:52 -07:00
vivek
c6ed1cc16d bgpd: Refine restarter operation - R-bit & F-bit
Introduce BGP-wide flags to denote if BGP has started gracefully
and GR is in progress or not. Use this for setting of the R-bit in
the GR capability, and not a timer which is set for any new
instance creation. Mark graceful restart is complete when the
deferred path selection has been done and route sync with zebra as
well as deferred EOR advertisement has been initiated.

Introduce a function to check on F-bit setting rather than just
base it on configuration.

Subsequent commits will extend these functionalities.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-07-01 13:02:45 -07:00
vivek
15403f521a bgpd: Streamline GR config, act on change immediately
Streamline the BGP graceful-restart configuration at the global and
peer level some more. Similar to many other neighbor capability
parameters like MP and ENHE, reset the session immediately upon a
change to the configuration. This will be more aligned with the
transactional UI model also and will not require a separate 'clear'
command to be executed.

Note: Peer-group graceful-restart configuration is not yet supported.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-06-27 11:40:57 -07:00
Pooja Jagadeesh Doijode
f0210cbacc bgpd: Added ! after BGP global config
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2024-06-27 11:40:57 -07:00
vivek
4e276b93de bgpd: Implement BGP-wide configuration for graceful restart
Add support for a BGP-wide setting for graceful restart modes and
parameters. This setting will apply to all BGP peers across all BGP
instances, but per-neighbor configuration can override it.
Per-instance configuration is disallowed if the BGP-wide setting
is in effect.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-06-27 11:40:57 -07:00
Donatas Abraitis
b5bd626a82 bgpd: Remove redundant whitespace before printing the reason of the failed peer
Before:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never  Waiting for peer OPEN (n/a)
```

After:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never Waiting for peer OPEN (n/a)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-19 14:32:16 +03:00
David Ward
172dd682d9 bgpd: Adjust terminology related to DSCP
The default DSCP used for BGP connections is CS6. The DSCP value is
not part of the TCP header.

When setting the IP_TOS or IPV6_TCLASS socket options, the argument
is not the 6-bit DSCP value, but an 8-bit value for the former IPv4
Type of Service field or IPv6 Traffic Class field, respectively.

Fixes: 425bd64be8 ("bgpd: Allow bgp to control the DSCP session TOS value")
Signed-off-by: David Ward <david.ward@ll.mit.edu>
2024-06-02 06:44:59 -04:00
Pooja Jagadeesh Doijode
a7c3317aba bgpd: Removed unused COMMUNITY_LIST_ERR_CANT_FIND_LIST
Removed the unused COMMUNITY_LIST_ERR_CANT_FIND_LIST

Ticket:#3900813
Testing Done: precommit

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2024-05-24 11:25:16 -07:00
Pooja Jagadeesh Doijode
773a45ef29 bgpd: Return success if lcomm/comm/extcomm name or entry is not found
Problem:
Currently bgp prints `Can't find community-list` and returns CMD_WARNING_CONFIG_FAILED
error if name or an entry for community, large-community and ext-community is not found. This
causes frr-reload to fail.

Fix:
Return success if community, large-community and ext-community name or
an entry is not found.

Ticket:#3900813
Testing Done:

Before fix:
```
root@tor-4:mgmt:/var/home/cumulus# cat /etc/frr/frr.conf
<SNIP>
bgp large-community-list standard lc22 seq 10 permit 4200857911:011:01 4200857911:011:011555
no bgp large-community-list standard lc22 seq 10 permit 4200857911:011:01
<SNIP>

root@tor-4:mgmt:/var/home/cumulus# systemctl reload frr
Job for frr.service failed.
See "systemctl status frr.service" and "journalctl -xeu frr.service" for details.

Syslog:
<SNIP>
2024-05-21T21:02:51.525965+00:00 tor-4 frrinit.sh[2349145]: % Can't find community-list
2024-05-21T21:02:51.526487+00:00 tor-4 staticd[6167]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00
2024-05-21T21:02:51.526595+00:00 tor-4 frrinit.sh[2349155]: [2349155|staticd] done
2024-05-21T21:02:51.526826+00:00 tor-4 frrinit.sh[2349145]: line 176: Failure to communicate[13] to bgpd, line: no bgp large-community-list standard lc22 seq 10 permit 4200857911:011:01
2024-05-21T21:02:51.527928+00:00 tor-4 frrinit.sh[2349153]: [2349153|watchfrr] done
2024-05-21T21:02:51.528382+00:00 tor-4 frrinit.sh[2349145]: [2349145|bgpd] Configuration file[/etc/frr/frr.conf] processing failure: 13
<SNIP>
```

After fix:
```
root@tor-4:mgmt:/var/home/cumulus# cat /etc/frr/frr.conf
<SNIP>
bgp large-community-list standard lc22 seq 10 permit 4200857911:011:01 4200857911:011:011555
no bgp large-community-list standard lc22 seq 10 permit 4200857911:011:01
<SNIP>

root@tor-4:mgmt:/var/home/cumulus# systemctl reload frr
root@tor-4:mgmt:/var/home/cumulus#

root@tor-4:mgmt:/var/home/cumulus# vtysh -c "show run" | grep lc22
bgp large-community-list standard lc22 seq 10 permit 4200857911:11:1 4200857911:11:11555
root@tor-4:mgmt:/var/home/cumulus#
```

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-05-24 11:25:00 -07:00
Russ White
2e0208602b
Merge pull request #15911 from opensourcerouting/feature/bgpd_dampening_per_neighbor
bgpd: per-neighbor dampening support
2024-05-13 13:55:24 -04:00
Chirag Shah
0a8d85aacf bgpd: [GR] fix mode change vtysh return code
When a bgp neighbor graceful-restart config mode change
is applied, after accepting the config if it does not
take effect instead of throwing vtysh error code,
return the success to vtysh and warn the user.
The debug log is already present at critical code point
where GR failure is seen during config apply.

Ticket: #3761481
Testing Done:

root@tor-1:# vtysh -c 'config t' -c 'router bgp 65564
vrf VRF2' -c 'neighbor 20.1.1.1 graceful-restart'
As part of configuring graceful-restart, capability send to zebra failed
root@tor-1:# echo $?
0

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-05-04 20:33:49 -07:00
Donald Sharp
b29ef1082d bgpd: Do not output peer doppleganger dampened output
When we are cycling through all peers and looking for
dampening data to dump, do not consider non-configed
peers( dopplegangers ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-03 09:29:40 +03:00
David Schweizer
255b392093 bgpd: vtysh commands for peer/group dampening profiles
Additional cli commands to add dampening profiles to peers / peer groups
and functions to save dampening configurations.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2024-05-03 09:16:30 +03:00
Donatas Abraitis
2187b82714
Merge pull request #15670 from poojarathore30/pg-deletion-with-listen-range
bgpd : Prevent deletion of BGP peer groups associated to listen range
2024-04-29 11:29:07 +03:00
rathorepo
48faeafe16 bgpd : Prevent deletion of BGP peer groups associated to listen range
Description:
-----
Deleting a peer group also deletes its associated BGP listen range.
This behaviour is undesired as it could cause unintended configuration changes.

Fix :
-----
-Do not allow peer group deletion until they are no longer associated with any listen range.
-Check the count of listen ranges attached to the group.
If any listen ranges are found, returns a configuration warning, preventing the deletion.

Signed-off-by: Pooja Rathore <rathorepo@vmware.com>
2024-04-27 16:44:26 +00:00
Russ White
f19817f71d
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
2024-04-26 14:41:05 -04:00
Donatas Abraitis
0a6f661eae
Merge pull request #15717 from pguibert6WIND/vrf_label_allocate_when_necessary
bgpd: do allocate vrf label only when necessary
2024-04-23 11:08:21 +03:00
Donatas Abraitis
c8a2532ab3 bgpd: Add neighbor ... extended-link-bandwidth command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:07 +03:00
Philippe Guibert
8b27521cfa bgpd: do allocate vrf label only when necessary
Today, with the following bgp instance configured, the
local VRF label is allocated even if it is not used.

> router bgp 65500 vrf vrf1
>  address-family ipv4 unicast
>   label vpn export allocation-mode per-nexthop
>   label vpn export auto
>   rd vpn export 444:1
>   rt vpn both 52:100
>   export vpn
>   import vpn

The 'show mpls table' indicates that the 16 label value
is allocated, but never used in the exported prefixes.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   vrf1            -
>  17             BGP   192.168.255.13  -
>  18             BGP   192.0.2.12      -
>  19             BGP   192.0.2.11      -

Fix this by only allocating new label values when really
used. Consequently, only 3 labels will be allocated instead
of previously 4.

> r1# show mpls table
>  Inbound Label  Type  Nexthop         Outbound Label
>  -----------------------------------------------------
>  16             BGP   192.168.255.13  -
>  17             BGP   192.0.2.11      -
>  18             BGP   192.0.2.12      -

Fixes: 577be36a41 ("bgpd: add support for l3vpn per-nexthop label")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-18 14:55:25 +02:00
Philippe Guibert
2a384f14c1 bgpd: add redistribute table-direct command for ipv6-unicast
The 'table-direct' redistribute command is available for ipv4 unicast but
not for ipv6 unicast.

Add the command to ipv6 unicast as well.

Fixes: b6367f8460 ("bgpd: add redistribute table-direct support")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-16 15:12:58 +00:00
Russ White
ee77989ffa
Merge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop `bgp_network_import_check_exact_cmd` command
2024-04-16 10:14:41 -04:00
Russ White
1c043440ea
Merge pull request #15572 from donaldsharp/best_path_stuff_sigh
bgp_process work
2024-04-16 07:52:09 -04:00