Commit Graph

24361 Commits

Author SHA1 Message Date
Mark Stapp
f5a1fb4f32 nhrpd: fix coverity warning about os_socket()
Ensure we don't try to use an invalid fd in nhrpd, reported
by coverity.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-14 09:57:41 -04:00
Mark Stapp
719b209ce7 bgpd: don't overrun fixed zapi array of nexthops
Avoid overrunning the fixed-size array of nexthops in a
zapi_nhg.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-14 09:24:37 -04:00
Donald Sharp
8a2ec9102f
Merge pull request #8320 from idryzhov/prefix-list-seqnum
lib: remove "ip prefix-list sequence-number" command
2021-04-14 09:21:28 -04:00
Igor Ryzhov
8c4796a22d lib: fix access-list deletion
Problems with the current implementation:
* Delete hook is called before the deletion of the access-list from the
  master list, which means that daemons processing this hook successfully
  find this access-list, store a pointer to it in their structures, and
  right after that the access-list is freed. Daemons end up having stale
  pointer to the freed structure.
* Route-maps are not notified of the deletion.

This commit fixes both issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-14 13:08:18 +03:00
Sri Mohana Singamsetty
dea4eee59f
Merge pull request #8446 from ton31337/fix/json_output_for_specific_vs_global_should_be_the_same
bgpd: Add `show bgp json detail` command
2021-04-13 17:33:17 -07:00
Sri Mohana Singamsetty
e64a538c70
Merge pull request #8448 from ton31337/feature/show_rpki_state_in_global_show_bgp
bgpd: Show RPKI short state in `show bgp <afi> <safi>`
2021-04-13 17:32:37 -07:00
David Lamparter
5a4ee981d0 vtysh: fix extract.pl for commands with "_cmd"
If the command includes `_cmd`, hilarity ensues ;)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-13 23:57:14 +02:00
David Lamparter
c574670847 build: don't use $(top_srcdir) in vtysh_scan
It's not necessary and can confuse scripts.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-13 23:57:14 +02:00
Donatas Abraitis
4c92d8188c doc: Add show bgp json detail command to print more verbose JSON output
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-13 22:06:34 +03:00
Donatas Abraitis
f280c93b11 bgpd: Add show bgp json detail command
Print detailed version for JSON output when dumping ALL BGP table with
`show bgp <afi> <safi> json detail`.

This output should be at some sort of identical to show_ip_bgp_route_cmd.

To avoid breaking backward-compatibility for `show bgp json`, adding
'detail' keyword for that.

In long-term it's easier for operators to compare stuff just looking at global
view instead of per-prefix for details.

Before:

```
],"192.168.100.1/32": [
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"First path received",
    "pathFrom":"external",
    "prefix":"192.168.100.1",
    "prefixLen":32,
    "network":"192.168.100.1\/32",
    "metric":0,
    "weight":32768,
    "peerId":"(unspec)",
    "path":"",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }
```

After:
```
],"192.168.100.1/32": [
  {
    "aspath":{
      "string":"Local",
      "segments":[
      ],
      "length":0
    },
    "origin":"incomplete",
    "metric":0,
    "weight":32768,
    "valid":true,
    "sourced":true,
    "bestpath":{
      "overall":true,
      "selectionReason":"First path received"
    },
    "lastUpdate":{
      "epoch":1618040124,
      "string":"Sat Apr 10 07:35:24 2021\n"
    },
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "metric":0,
        "accessible":true,
        "used":true
      }
    ],
    "peer":{
      "peerId":"0.0.0.0",
      "routerId":"192.168.100.1"
    }
  }
] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-13 22:06:32 +03:00
Jafar Al-Gharaibeh
d75213d260
Merge pull request #8153 from reubendowle/nhrp-multicast
nhrp, ospf: add nhrp multicast for OSPF DMVPN
2021-04-13 12:49:28 -05:00
Mark Stapp
d7265db9b3 tests: run black over mcast-pim-static, static_routing_with_[ei]bgp
Run black and clean up formatting along with pylint cleanup.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 13:34:57 -04:00
Mark Stapp
ec3ed7234d tests: fix pylint errors in static_routing_with_ibgp
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
aa59a7090a tests: fix pylint errors in static_routing_with_ebgp tests
Fix pylint errors; also enable the test in 'topo4', which has never
run.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
914faab594 tests: fix pylint errors in mcast-pim-static-rp-topo1
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Russ White
0ae24ff566
Merge pull request #8414 from idryzhov/fix-filter-cli
various acl/plist cli fixes
2021-04-13 11:38:51 -04:00
Russ White
a9d5dbe34b
Merge pull request #8431 from ton31337/feature/show_bgp_version_per_prefix
bgpd: Add `show bgp version <version>` command
2021-04-13 11:33:22 -04:00
Quentin Young
54bb4ab3ec
Merge pull request #8426 from idryzhov/fix-interface-nb-stale-pointers
lib: fix interface nb stale pointers
2021-04-13 15:26:51 +00:00
Mark Stapp
7de06eab47 ospfd: show seconds in timeval_dump
If the number of seconds is < one minute, show seconds and
msecs.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 09:09:31 -04:00
Mark Stapp
f3dbd9d3ef
Merge pull request #8145 from pguibert6WIND/nhrp_use_zebra
nhrp: use zebra
2021-04-13 08:02:56 -04:00
Philippe Guibert
88217099de zebra, lib: replace ZEBRA_ROUTE_NEIGH with simplified version
do not add a new route type, and consider 0 as a value meaning
that zebra should be the owner.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13 08:58:54 +02:00
Philippe Guibert
a8807299ef nhrpd: remove useless typedef
this typedef was useless. remote it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13 08:58:54 +02:00
Philippe Guibert
d603c0774e nhrp, zebra, lib: enforce usage of zapi_neigh_ip structure
zapi_nbr structure is renamed to zapi_neigh_ip.
Initially used to set a neighbor ip entry for gre interfaces, this
structure is used to get events from the zebra layer to nhrp layer.

The ndm state has been added, as it is needed on both sides.
The zebra dplane layer is slightly modified.

Also, to clarify what ZEBRA_NEIGH_ADD/DEL means, a rename is done:
it is called now ZEBRA_NEIGH_IP_ADD/DEL, and it signified that this
zapi interface permits to set link operations by associating ip
addresses to link addresses.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13 08:58:49 +02:00
Renato Westphal
b6241291ee
Merge pull request #8389 from idryzhov/route-map-optimization-nb
lib: convert route-map optimization to NB
2021-04-13 00:26:20 -03:00
Renato Westphal
0a6a5721c6
Merge pull request #8396 from achernavin22/ospf_fast_hello_show_run
ospfd: fix output of dead-interval in show running
2021-04-13 00:14:56 -03:00
David Lamparter
1df904706c
Merge pull request #8288 from qlyoung/readd-space-support-to-find-command 2021-04-13 02:22:46 +02:00
David Lamparter
9c2a14e753
Merge pull request #8100 from qlyoung/remove-sample-conf-files 2021-04-13 02:20:53 +02:00
Renato Westphal
0e8c4c1c36
Merge pull request #8451 from idryzhov/bfdd-fix-cli-show
bfdd: fix nb cli show with defaults
2021-04-12 20:26:21 -03:00
Renato Westphal
0da8f4de8d
Merge pull request #8453 from idryzhov/bgpd-fix-transactional-cli
bgpd: fix pending commit check
2021-04-12 20:23:26 -03:00
Lou Berger
d7026eff4c doc: add Ubuntu18.04 and 20.04 container info to building-docker.rst
Signed-off-by: Lou Berger <lberger@labn.net>
2021-04-12 17:14:10 -04:00
Lou Berger
7d8a460923 *: add initial .travis.yml
Supports centos7 and 8 docker builds
   and Ubuntu18.04 and 20.04 build and minimal CI

Signed-off-by: Lou Berger <lberger@labn.net>
2021-04-12 16:56:38 -04:00
Lou Berger
60bad451a5 ubuntu20-ci: create a docker 20.04 container for dev / test / ci
Signed-off-by: Lou Berger <lberger@labn.net>
2021-04-12 16:56:38 -04:00
Lou Berger
cd18e08a01 ubuntu18-ci: create a docker 18.04 container for dev / test / ci
Signed-off-by: Lou Berger <lberger@labn.net>
2021-04-12 16:56:38 -04:00
Philippe Guibert
850b2b70ac nhrp: avoid crashing when terminating interface contexts
avoid crashing when terminating interface contexts.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-12 19:23:57 +02:00
Philippe Guibert
f468a45af2 nhrpd: add a zebra api to configure neighbor table per interface
neighbor table per interface is being configured per interface, via
zebra api.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-12 19:23:53 +02:00
Donatas Abraitis
b993aae0d0 doc: Add an option for vtysh to override history file path
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 17:33:36 +03:00
Donatas Abraitis
69d4cc70ee vtysh: Set history file on demand
It's sometimes needed to disable logging all FRR commands at all.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 17:33:35 +03:00
Igor Ryzhov
ea1a5c00df bgpd: fix pending commit check
Calling nb_cli_pending_commit_check only makes sense after nb_cli_apply_changes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-12 16:42:51 +03:00
Alexander Chernavin
1c1c342d2a ospfd: install Type-7 when NSSA area is configured after redistribution
Currently, if NSSA area is configured before redistribution is enabled,
Type-7 LSA's are installed and flooded. But if NSSA area is configured
after redistribution is enabled, Type-7 LSA's are not installed.

With this change, when NSSA area is configured, schedule a task that
scans for external LSA's. If they exist, install Type-7 and flood to
all NSSA Areas.

There already was an attempt to fix this problem in 0f321812f where
ospf_asbr_nssa_redist_task() was triggered in ospf_abr_task_timer().
This turns out to be incorrect place for this operation because it's
a one-off operation needed only after "area <ID> nssa" execution. And
ospf_abr_task_timer() is a periodic operation. Triggering
ospf_asbr_nssa_redist_task() in ospf_abr_task_timer() caused a problem
that was fixed in 945eec2b6 making the problem with NSSA area
configured after redistribution actual again.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2021-04-12 09:34:20 -04:00
Mark Stapp
53c42c82de
Merge pull request #8421 from opensourcerouting/xrelfo-arm
fix xrelfo on ARM(32) & cross-compile
2021-04-12 08:07:05 -04:00
Igor Ryzhov
613bcbc5d5 bfdd: fix nb cli show with defaults
The idea of the "with-defaults" flag is to show the default values for
parameters that were not configured by the user. But bfdd incorrectly
shows the default values for all parameters, including the
user-configured ones.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-12 14:21:36 +03:00
Igor Ryzhov
af736200e1 lib: fix interface nb stale pointers
The first change in this commit is the processing of the VRF termination.
When we terminate the VRF, we should not delete the underlying interfaces,
because there may be pointers to them in the northbound configuration. We
should move them to the default VRF instead.

Because of the first change, the VRF interface itself is also not deleted
when deleting the VRF. It should be handled in netlink_link_change. This
is done by the second change.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-12 10:56:04 +03:00
Donatas Abraitis
244e6cab3f doc: Add show [ip] bgp version <version> command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:43:54 +03:00
Donatas Abraitis
7d3cae70b2 bgpd: Filter BGP routes by prefix version
The idea is to find out prefixes including specific BGP table version and
above.

Let's say I have a converged network and suddently I noticed a couple of
prefixes seems hijacked.

I want to look what new prefixes arrived with a specific BGP table version.

```
exit1-debian-9# show ip bgp version 8
BGP table version is 9, local router ID is 192.168.100.1, vrf id 0
Default local pref 100, local AS 65534
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  192.168.2.0/24   192.168.0.2              0             0 65030 ?
*>                  192.168.0.2              0             0 65030 ?
*  192.168.3.0/24   192.168.0.2              0             0 65030 ?
*>                  192.168.0.2              0             0 65030 ?

Displayed  2 routes and 18 total paths
exit1-debian-9#
```

```
exit1-debian-9# show ip bgp version 8 json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 9,
 "routerId": "192.168.100.1",
 "defaultLocPrf": 100,
 "localAS": 65534,
 "routes": { "192.168.2.0/24": [
  {
    "valid":true,
    "pathFrom":"external",
    "prefix":"192.168.2.0",
    "prefixLen":24,
    "network":"192.168.2.0\/24",
    "version":8,
    "metric":0,
    "weight":0,
    "peerId":"2a02:bbd::2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  },
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"Neighbor IP",
    "pathFrom":"external",
    "prefix":"192.168.2.0",
    "prefixLen":24,
    "network":"192.168.2.0\/24",
    "version":8,
    "metric":0,
    "weight":0,
    "peerId":"192.168.0.2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
],"192.168.3.0/24": [
  {
    "valid":true,
    "pathFrom":"external",
    "prefix":"192.168.3.0",
    "prefixLen":24,
    "network":"192.168.3.0\/24",
    "version":9,
    "metric":0,
    "weight":0,
    "peerId":"2a02:bbd::2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  },
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"Neighbor IP",
    "pathFrom":"external",
    "prefix":"192.168.3.0",
    "prefixLen":24,
    "network":"192.168.3.0\/24",
    "version":9,
    "metric":0,
    "weight":0,
    "peerId":"192.168.0.2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }

```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:43:53 +03:00
Donatas Abraitis
d89b48fe28 tests: Add BGP RPKI show header to outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:34:52 +03:00
Donatas Abraitis
0bcfc1a330 doc: Add BGP RPKI show header to some output examples
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:34:36 +03:00
Donatas Abraitis
9119ef3a8b bgpd: Show BGP table version which was used for a particular prefix
This is useful to go back in the past and check when was that prefix appeared,
changed, etc.

```
exit1-debian-9# show ip bgp 172.16.16.1/32
BGP routing table entry for 172.16.16.1/32, version 6
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2) home-spine1.donatas.net(2a02:bbd::2)
  65030
    192.168.0.2 from home-spine1.donatas.net(2a02:bbd::2) (172.16.16.1)
      Origin incomplete, metric 0, valid, external
      Last update: Thu Apr  8 20:15:25 2021
  65030
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (172.16.16.1)
      Origin incomplete, metric 0, valid, external, best (Neighbor IP)
      Last update: Thu Apr  8 20:15:25 2021
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-11 21:42:18 +03:00
Donatas Abraitis
82c298be73 bgpd: Show RPKI short state in show bgp <afi> <safi>
Just to be more informant, copying from Cisco.

```
exit1-debian-9# sh ip bgp
BGP table version is 4, local router ID is 192.168.100.1, vrf id 0
Default local pref 100, local AS 65534
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
N*> 10.0.2.0/24      0.0.0.0                  0         32768 ?
N*> 192.168.0.0/24   0.0.0.0                  0         32768 ?
N*> 192.168.10.0/24  0.0.0.0                  0         32768 ?
N*> 192.168.100.1/32 0.0.0.0                  0         32768 ?

Displayed  4 routes and 4 total paths
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-11 21:39:46 +03:00
Jafar Al-Gharaibeh
8435eae7bb
Merge pull request #8440 from qlyoung/doc-describe-acceptable-commit-messages
doc: describe acceptable commit messages
2021-04-10 23:07:49 -05:00
Donatas Abraitis
4c3e68492b
Merge pull request #8438 from donaldsharp/doc_on_sleep
doc: Check for convergence, not sleep for convergence
2021-04-10 19:35:52 +03:00