Commit Graph

4906 Commits

Author SHA1 Message Date
Trey Aspelund
093d16a23c bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds
Adds support for 'rd all' matching for EVPN and L3VPN show commands.
Introduces evpn_show_route_rd_all_macip().
Cleanup some show commands to use SHOW_DISPLAY string constants.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-03-19 15:24:50 +00:00
Donatas Abraitis
0966b412ba
Merge pull request #8283 from chiragshah6/mdev
bgpd: add seqno in bgp as-path access-list policy
2021-03-18 17:24:35 +02:00
Donald Sharp
bb5dddf713
Merge pull request #8284 from mjstapp/fix_bgp_zero_timers
bgpd: use add_event instead of add_timer with zero timeout
2021-03-18 07:29:32 -04:00
Chirag Shah
9b6f73ee9c bgpd: add seqno in bgp as-path access-list policy
Add optional parameter seqno to bgp as-patch policy
to inline with other bgp policies commands at same
level.

Testing Done:

config t
bgp as-path access-list foo1 permit _40_
bgp as-path access-list foo1 seq 5 permit _41_
bgp as-path access-list foo1 seq 8 permit _42_
bgp as-path access-list foo2 permit _43_
no bgp as-path access-list foo1 permit _41_
bgp as-path access-list foo1 permit 41$

show run:
bgp as-path access-list foo1 seq 8 permit _42_
bgp as-path access-list foo1 seq 10 permit 41$
bgp as-path access-list foo2 seq 5 permit _43_

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-03-17 22:06:53 -07:00
Mark Stapp
e0d550dfea bgpd: use add_event instead of add_timer with zero timeout
Just use events in a few places where timers with zero timeout
were being used.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-17 16:10:13 -04:00
Quentin Young
263e82b308
Merge pull request #8052 from ton31337/feature/show_bgp_peer-groups_json 2021-03-17 15:08:00 -04:00
Donald Sharp
0f3ac8198a bgpd: If we have a SAFI conflict do not allow labeled unicast to reset
If we have a SAFI conflict, ie we are trying to activate safi's
UNICAST and LABELED_UNICAST at the same time, we should not
cause bestpath to be rerun and we should not try to put
labels on everything.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-16 22:39:20 -04:00
Donald Sharp
a59803d060 bgpd: Attempting to activate unicast and labeled-unicast
Should return an actual useful error message.
Commit: 055679e915 messed this error message
up.

Fixes: #8246
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-16 22:38:13 -04:00
Patrick Ruddy
01183a2b00
Merge pull request #8226 from adharkar/frr-evi_rx
bgpd: Reevaluate es_evi_vtep active state on disable-ead-evi-rx config flap
2021-03-16 15:32:55 +00:00
Donald Sharp
d588b995f9 bgpd: use appropriate printf formatter for some uint32_t
newm and existm are uint32_t so let's use %u instead of %d
to print them out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-15 10:56:08 -04:00
Donatas Abraitis
8b87b2f4f6
Merge pull request #8220 from mjstapp/bgp_notify_race
bgpd: handle socket read errors in the main pthread
2021-03-15 13:30:00 +02:00
Donatas Abraitis
6f4eacf315 bgpd: Add JSON output for show ip bgp peer-group command
```
exit1-debian-9# show bgp peer-group

BGP peer-group test, remote AS 123
  Peer-group type is external
  Configured address-families: IPv4 Unicast; IPv6 Unicast;
  1 IPv4 listen range(s)
    192.168.100.0/24
  2 IPv6 listen range(s)
    2001:db8:1::/64
    2001:db8:2::/64
  Peer-group members:
    192.168.200.1  Active
    2001:db8::1  Active

BGP peer-group test3
  Peer-group type is external
  Configured address-families: IPv4 Unicast;
exit1-debian-9#
exit1-debian-9# show bgp peer-group json
{
  "test":{
    "remoteAs":123,
    "type":"external",
    "addressFamiliesConfigured":[
      "IPv4 Unicast",
      "IPv6 Unicast"
    ],
    "dynamicRanges":{
      "IPv4":{
        "count":1,
        "ranges":[
          "192.168.100.0\/24"
        ]
      },
      "IPv6":{
        "count":2,
        "ranges":[
          "2001:db8:1::\/64",
          "2001:db8:2::\/64"
        ]
      }
    },
    "members":{
      "192.168.200.1":{
        "status":"Active"
      },
      "2001:db8::1":{
        "status":"Active"
      }
    }
  },
  "test3":{
    "type":"external",
    "addressFamiliesConfigured":[
      "IPv4 Unicast"
    ]
  }
}
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-14 19:25:02 +02:00
Rafael Zalamena
2dd0dde70d bgpd: fix wrong debug format
Use `%pIA` instead of `%pI4` for `struct ipaddr *`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-14 14:07:52 -03:00
Donald Sharp
c0d72166ee bgpd: Convert remaining string output to our internal types
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-09 19:50:42 -05:00
Ameya Dharkar
acd1d9bc43 bgpd: Reevaluate es_evi_vtep active state on disable-ead-evi-rx config flap
Update es_evi_vtep active state and add/delete es_vtep accordingly to
zebra for remote ES.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2021-03-09 16:37:52 -08:00
Mark Stapp
6af96fa383 bgpd: handle socket read errors in the main pthread
Add a handler for socket errors that runs in the main pthread,
rather than the io pthread. When the io pthread encounters a
read error, capture the error and schedule a task for the main
pthread.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-09 11:13:41 -05:00
Donatas Abraitis
df29adc0f1
Merge pull request #8208 from donaldsharp/validation_state
bgpd: Display RPKI validation state if we have it
2021-03-08 09:22:54 +02:00
Donald Sharp
b5b99af853 bgpd: Display RPKI validation state if we have it
When dumping data about prefixes in bgp.  Let's dump the
rpki validation state as well:

Output if rpki is turned on:
janelle# show rpki prefix 2003::/19
Prefix                                   Prefix Length  Origin-AS
2003::                                      19 -  19         3320
janelle# show bgp ipv6 uni 2003::/19
BGP routing table entry for 2003::/19
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  15096 6939 3320
    ::ffff:4113:867a from 65.19.134.122 (193.72.216.231)
    (fe80::e063:daff:fe79:1dab) (used)
      Origin IGP, valid, external, best (First path received), validation-state: valid
      Last update: Sat Mar  6 09:20:51 2021
janelle# show rpki prefix 8.8.8.0/24
Prefix                                   Prefix Length  Origin-AS
janelle# show bgp ipv4 uni 8.8.8.0/24
BGP routing table entry for 8.8.8.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  100.99.229.142
  15096 6939 15169
    65.19.134.122 from 65.19.134.122 (193.72.216.231)
      Origin IGP, valid, external, best (First path received), validation-state: not found
      Last update: Sat Mar  6 09:21:25 2021

Example output when rpki is not configured:
eva# show bgp ipv4 uni 8.8.8.0/24
BGP routing table entry for 8.8.8.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  janelle(192.168.161.137)
  64539 15096 6939 15169
    192.168.161.137(janelle) from janelle(192.168.161.137) (192.168.44.1)
      Origin IGP, valid, external, bestpath-from-AS 64539, best (First path received)
      Last update: Sat Mar  6 09:33:51 2021

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-07 07:08:33 -05:00
Rafael Zalamena
97a16e6481 bgpd: improve socket read performance
Use the new ringbuffer API function to read file descriptors directly
to the ringbuffer instead of using intermediary buffers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-05 18:17:32 -03:00
Donald Sharp
122a7974dd
Merge pull request #8196 from ton31337/feature/rfc8654_bgpd
bgpd: Add BGP Extended message support
2021-03-05 07:18:42 -05:00
Donatas Abraitis
ef56aee47c bgpd: Add BGP Extended message support
Implement https://www.rfc-editor.org/rfc/rfc8654.txt

```
> | jq '."192.168.10.25".neighborCapabilities.extendedMessage'
"advertisedAndReceived"
```

Another side is Bird:

```
BIRD 2.0.7 ready.
Name       Proto      Table      State  Since         Info
v4         BGP        ---        up     19:39:15.689  Established
  BGP state:          Established
    Neighbor address: 192.168.10.123
    Neighbor AS:      65534
    Local AS:         65025
    Neighbor ID:      192.168.100.1
    Local capabilities
      Multiprotocol
        AF announced: ipv4
      Route refresh
      Extended message
      Graceful restart
      4-octet AS numbers
      Enhanced refresh
      Long-lived graceful restart
    Neighbor capabilities
      Multiprotocol
        AF announced: ipv4
      Route refresh
      Extended message
      Graceful restart
      4-octet AS numbers
      ADD-PATH
        RX: ipv4
        TX:
      Enhanced refresh
    Session:          external AS4
    Source address:   192.168.10.25
    Hold timer:       140.139/180
    Keepalive timer:  9.484/60
  Channel ipv4
    State:          UP
    Table:          master4
    Preference:     100
    Input filter:   ACCEPT
    Output filter:  ACCEPT
    Routes:         9 imported, 3 exported, 8 preferred
    Route change stats:     received   rejected   filtered    ignored   accepted
      Import updates:              9          0          0          0          9
      Import withdraws:            2          0        ---          2          0
      Export updates:             11          8          0        ---          3
      Export withdraws:            0        ---        ---        ---          0
    BGP Next hop:   192.168.10.25
```

Tested at least as well with to make sure it works with backward compat.:
	ExaBGP 4.0.2-1c737d99.
	Arista vEOS 4.21.14M

Testing by injecint 10k routes with:
```
sharp install routes 172.16.0.1 nexthop 192.168.10.123 10000
```

Before extended message support:
```
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:51 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 4096 (max message len: 4096) numpfx 809
2021/03/01 07:18:52 BGP: u1:s1 send UPDATE len 2186 (max message len: 4096) numpfx 427
2021/03/01 07:18:53 BGP: u1:s1 send UPDATE len 3421 (max message len: 4096) numpfx 674
```

After extended message support:
```
2021/03/01 07:20:11 BGP: u1:s1 send UPDATE len 50051 (max message len: 65535) numpfx 10000
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-04 21:32:36 +02:00
Trey Aspelund
3ba7b4aff0 bgpd: fix bgp statistics for l2vpn evpn
'show bgp l2vpn evpn statistics' was returning 0 for all stats
because bgp_table_stats_walker bailed out if afi != AFI_IP or AFI_IP6.
Add case condition to catch AFI_L2VPN.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-03-04 02:05:56 +00:00
Donald Sharp
6640d900cd
Merge pull request #8170 from mjstapp/fix_sa_pim
bgpd, pimd: fix coverity SA warnings
2021-03-02 15:51:57 -05:00
Russ White
4d3cdc2cf9
Merge pull request #8150 from pguibert6WIND/ecomm_seq_0_possible
bgpd: accept (ext)community list sequence number set to 0
2021-03-02 11:46:41 -05:00
Russ White
8b52859575
Merge pull request #8175 from mjstapp/fix_printfrr_nulls
lib, bgpd: handle NULL inputs in printfrr extensions
2021-03-02 11:36:49 -05:00
Donald Sharp
fe914c4b60
Merge pull request #7951 from mjstapp/fix_cancel_event
libs, bgpd: improve task cancellation by argument value
2021-03-02 07:21:47 -05:00
Patrick Ruddy
11b5777f13
Merge pull request #8117 from AnuradhaKaruppiah/evpn-consistency-checks
bgpd: enable ES consistency checks on first ES add
2021-03-02 10:37:59 +00:00
Mark Stapp
001ab42b19 bgpd: protect bgp printfrr extension from NULLs
Protect the bgp printfrr extension from NULL input.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-01 15:40:51 -05:00
Donald Sharp
a1b773e287 bgpd: Wait for Install should not always set the flag
If we are filtering a route due to any of the filter reasons
we should not be setting the BGP_NODE_FIB_INSTALL_FIB_PENDING
flag.  This is especially evident with say a loopback that
is covered by a network statement.  When we receive the route
back from our peer we should not be setting the
BGP_NODE_FIB_INSTALL_PENDING flag on it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 13:09:11 -05:00
Mark Stapp
d934e491ca bgpd, pimd: fix coverity SA warnings
Fix a couple of coverity warnings in pim and bgp.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-01 08:46:29 -05:00
Philippe Guibert
a08032feae bgpd: accept (ext)community list sequence number set to 0
now that sequence number is configurable, there is no problem in
permitting to configure seq 0 sequence number.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-03-01 11:21:13 +01:00
Anuradha Karuppiah
74be8313d4 bgpd: support for lacp bypass with EVPN MH
When a local ES is in LACP bypass state BGP doesn't advertise
reachability to it i.e. the Type-1/EAD-per-ES routes and Type-4
route for the ES is not advertised. This is the equivalent of
oper-down handling.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2021-02-24 08:11:26 -08:00
Mark Stapp
15869cd81d
Merge pull request #8035 from qlyoung/remove-more-sprintf
*: remove more sprintf()
2021-02-23 15:55:02 -05:00
Russ White
33d1282f3d
Merge pull request #8095 from idryzhov/fix-nb-stale-pointers
fix stale pointers in northbound nodes
2021-02-23 11:15:31 -05:00
Donatas Abraitis
4fe016fe13
Merge pull request #7435 from sudhanshukumar22/bgp-peer-group-issue
Bgp peer group issue
2021-02-23 09:14:24 +02:00
Donatas Abraitis
2a267d5aca
Merge pull request #7460 from pguibert6WIND/remove_bgp_constraint
bgpd: upon bgp deletion, do not systematically ask to remove main bgp
2021-02-23 09:02:04 +02:00
Igor Ryzhov
3fa607beba bgpd: don't rely on northbound control plane protocol vrf pointer
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-22 18:53:24 +03:00
Donatas Abraitis
2031dbf31c
Merge pull request #7444 from sudhanshukumar22/bgp-clean-dampening-issue
bgpd: clear ip bgp dampening was not triggering the route calculation…
2021-02-22 09:37:04 +02:00
Donatas Abraitis
1c0f3e760a
Merge pull request #8111 from volta-networks/fix_bgp_plist_vpn
bgpd: fix 'neighbor X prefix-list Y in' SAFI VPN
2021-02-20 12:23:26 +02:00
Donald Sharp
ecb98792bf
Merge pull request #8112 from pguibert6WIND/bgp_flowspec_attrunchanged
bgpd: add attribute-unchanged attribute to flowspec
2021-02-19 18:30:36 -05:00
Anuradha Karuppiah
8fc2ffb3bb bgpd: enable ES consistency checks on first ES add
Consistency checks are processed in the background using a periodic timer.
Start this timer only if Ethernet Segments are present and consistency
checking is needed.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-02-19 12:35:07 -08:00
Donald Sharp
dc86ef74e6
Merge pull request #8079 from pjdruddy/pr-snmp-coverity
MPLSL3VPN snmp coverity fixes
2021-02-19 08:54:02 -05:00
Philippe Guibert
b8ad84d211 bgpd: add attribute-unchanged attribute to flowspec
flowspec address family can now use attribute-unchanged attribute.
This parameter is necessary when it comes to play with
route-server-client, as that latter command forces to change
attribute-unchanged nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-02-19 14:17:05 +01:00
Emanuele Di Pascale
9fa7a8bf37 bgpd: fix 'neighbor X prefix-list Y in' SAFI VPN
this particular callback had not been implemented in the northbound
conversion, so the command had no effect.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-02-19 13:30:45 +01:00
Donald Sharp
e817f2ccbf bgpd: Fix crash when we don't have a nexthop
Recent changes to allow bgpd to handle v6 LL slightly
differently in the nexthop tracking code has not
interacted well with the blackhole nexthop change
for peers.  Modify the code to do the right thing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-18 06:55:29 -05:00
Donatas Abraitis
830fd32903
Merge pull request #8041 from donaldsharp/v6_ll_interface
bgpd: Switch LL nexthop tracking to be interface based
2021-02-18 09:22:51 +02:00
Russ White
95e336226e
Merge pull request #8062 from donaldsharp/bgp_blackhole
bgpd: Blackhole nexthops are not reachable
2021-02-17 15:47:51 -05:00
Russ White
c3a407489a
Merge pull request #8068 from qlyoung/bmp-tracing
BMP tracepoints
2021-02-17 12:59:56 -05:00
Pat Ruddy
5a224c19f1 bgpd, lib: add oid2in6_addr utility and use it
The existing code was using the oid2in_addr API to copy IPv6
addresses passing an IPv6 length. Create a utility to do this
properly and avoid annoying coverity with type checking.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-17 13:35:31 +00:00
Pat Ruddy
23b88a967d bgpd: mplsvpn snmp: NULL check correct pointer
Check the dereferenced pointer to the bgp instance and not the
pointer to it.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-17 13:33:59 +00:00