Commit Graph
2446 Commits
Author SHA1 Message Date
Joachim Wiberg b61398103c statd: adjust "show ip route" column widths per address proto
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 752b1f4a94 confd: add support for setting preference on static routes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg dd3f1c39d1 confd: expand route info in operational data
- Enable OSPF route metrics in RIB, only defined for OSPF
 - Enable 'active' route flag for RIB, same as 'selected >' in FRR
 - Enable 'last-updated' route field for RIB, used for uptime
 - Augment route in RIB with 'installed' flag, same as 'FIB *' in FRR

The CLI "show ip route" command has been updated accordingly.  The
classic Cisco style output has been kept instead of separating the
routes into Active and Backup, as discussed previously.  Because
when inspecting large route sets you want to compare same prefix
vs distance/metric to understand why a certain route is selected.

admin@example:/> show ip route
   PREFIX                            PREF  NEXT-HOP                      PROTOCOL      UPTIME
>  0.0.0.0/0                          1/0  192.168.0.42                  static        0h2m6s
 *                                         192.168.122.1
   0.0.0.0/0                          5/0  192.168.122.1                 static        0h2m6s
   0.0.0.0/0                        254/0  e1                            static        0h2m6s
>* 169.254.0.0/16                     0/0  e1                            direct        0h2m6s
>* 192.168.0.0/24                     1/0  192.168.122.1                 static        0h2m6s
>* 192.168.122.0/24                   0/0  e1                            direct       0h2m12s

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 35276cb2e8 confd: rename ietf-routing prefix, ietf-r: -> rt:
For consistency with the other IETF routing models, e.g., OSPF, let's
use the same model prefix for internal references.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 2063c94f42 confd: drop deviation for /if:interfaces-state
Not the most obvious patch, but let me explain -- there will always be a
conflict betweem usability and "maintainability".  The ietf-interfaces
yang model already declares /interfaces-state as deprecated, so we don't
really need to add a deviation 'not-supported', for usability, however,
it may be useful since the deviation helps cut out that tree completely.

While working with ietf-routing and our companion models, I found that
since it relies on ietf-interfaces, it also breaks the reload/reimport
of infix-routing while developing extensions/changes:

  $ lint.sh -f tree ieee802-* iana-if-type@2023-01-26.yang \
            ietf-interfaces@2018-02-20.yang \
	    infix-interfaces@2024-01-15.yang \
	    ietf-routing@2018-03-13.yang \
	    ietf-ipv4-unicast-routing@2018-03-13.yang \
	    ietf-ospf@2022-10-19.yang \
	    infix-routing@2024-09-22.yang
  libyang err : Not found node "interfaces-state" in path. (Schema location "/ietf-routing:routing-state/interfaces/interface".)
  libyang err : Target of leafref "interface" cannot be referenced because it is disabled. (Schema location "/ietf-routing:routing-state/interfaces/interface".)
  YANGLINT[E]: Parsing schema module "ietf-routing@2018-03-13.yang" failed.

The only way to change/update models for a given build is to either, a)
surgically remove offending models from output/target/, then reinstall
all dependencies and hope it works better, or b) rebuild from distclean.
In most cases you end up with alternative b).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 0ea84cf557 test: minor, whitespace and PEP-8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 6e85ace4b0 test: update rib source protocol, infix-routing -> ietf-ospf
Latest YANG model change reverts back to using the IETF routing-protocol
type.  Update tests to check for infix-routing:ospf -> ietf-ospf:ospfv2.

Also, refactor and extend infamy/route.py:_exist_route() slightly for
readability and PEP-8, as well as to use an optional model prefix also
for next-hop-list addresses.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 76e54420a2 confd: minor, fixes & cleanup
- Straighten out formatting issues in ospfd.conf (debug)
 - Simplify and reduce code duplication
 - Avoid 'restart zebra' errors in runlevel S

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg f65000f29e board/common: update mg default configuration file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg fa6851caa6 board/common: set DHCP and ZeroConf routes using Frr/staticd
This patch changes the way Infix DHCP and ZerocConf clients set their
routes in the system.  Instead of setting them directly in the kernel
we ask FRR staticd to set them for us.

The reason for this change is to be able to override routes from these
protocols with locally set static routes.  The routes are now set with
a distance of 5 and 254, respectively, while static routes by default
have a distance of 1.  In contrast, kernel routes are always treated
by Frr as distance 0, i.e., they are preferred over static routes.

Finally, this patch drops the use of Linux legacy interface aliases, or
colon interfaces, in an effort to reduce confusion for end users.  This
may give some odd results if using older tools like ifconfig, so we
recommend using 'show interfaces' or 'ipb a' instead.

Fixes #640

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 118dcd4b35 statd: read system routing table from vtysh intead of kernel
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d33249512e statd: slight refactor of ospf-status
- Ignore stderr output (ospfd not running)
 - Import run_json_cmd() from yanger
 - Ensure deafault empty object + arrays

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d5418b019f confd: switch back to ietf type for route source-protocol
With the redesign of the operational rib routes, using vtysh 'show ip route'
instead of the kernel 'ip route' as source, we no longer need the infix source
protocol.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg cf0cfc2dad confd: clarify route preference in DHCP client model
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 445ca0a9d6 board/common: restore 'show' script from 493be97 sync with present
The intention is to provide a similar set of commands as klish
admin-exec.  However, instead of trying to make the Linux tools
more accessible, we now make the Infix tooling more accessible.

E.g., instead of "show ip route" mapping to "ip route show", we
map it to:

sysrepocfg -f json -X -d operational -x "/ietf-routing:routing/ribs" | \
      /usr/libexec/statd/cli-pretty "show-routing-table"

As a spin-off we alos get a much more readable infix.xml for klish:
 - Relocate logic to shell script wrapper 'show'
 - Introduce Cisco style "show ip route" and "show ipv6 route"

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d575538d4a statd: minor, pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 84c373ef63 statd: refactor metric in 'show routes' to distance/metric
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg cc8e31f74f board/common: adjust metric on IPv4LL and DHCP routes to match Frr
Apply a distance adjustment to routes retrieved from IPv4LL/ZeroConf and
DHCP to ensure that Frr (Zebra) can compare other protocol routes, e.g.,
static.  Without this Frr will consider all routes read from the kernel
to have a protocol distance of 0, meaning better than static routes that
have a distance of 1.

Initial proposal to fix issue #640

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg fd8826c3f1 confd: initialize sysrepo startup datastore at boot
Since /etc is not retained across reboots, the sysrepo startup datastore
is not used to bootstrap the Infix.  Instead, /cfg/startup-config.cfg is
used and loaded directly to the running datastore.

For some use-cases when operating directly on sysrepo this causes a lot
of confusion because startup == factory ds until any user calls the CLI
command `copy running-config startup-confg`.

This patch fixes this initial "glitch" by loading the starup datastore
at boot on successful loading of startup-config to unning.

To prevent any unintentional "auto-save" of, e.g., failure-config to
startup-config, we make confd aware of this "sync" operation during
bootstap.

Fixes #625

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 430948df06 confd: minor, fix global variable shadowing warnings
Follow-up to cfd95dc30, which made 'struct confd confd' a global
variable in core.h.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 0a06fc0571 confd: minor, logging and coding style
- Remove duplicate logs due to logger logging also to stderr
 - Fix coding style in new test-override-startup code path

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg e483d295da statd: also silence JSONDecodeError on check=False
In d616623a an attempt to silence bogus return values from mctl, when
multicast snooping is disabled on a bridge.  That helped get data back
for operational to produce `show interfaces` *with* a bridge and ports
but still emitted bogus log warnings.

This patch addresses that by checking 'check' on JSONDcodeError as well
before emitting any log error.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 10ef7c5fda doc: update ChangeLog with recent IPv4LL (autoconf) changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 476c2ebe40 test/case: update ipv4-autoconf with new test passes
- Add check for specific 169.254/16 adddress (new feature)
 - Add check for disabling autoconf on interface (regression test #638)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg ec6d350bc1 test/infamy: minor, check return value, and pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg add52cdb38 confd: add support for IPv4LL request-address option
This patch allows a user to specify a specific 169.254/16 address that
the zeroconf client starts with when probing for a free address.  If the
probe fails it falls back to its default algorithm.

Fixes #628

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 151119ef0e patches/avahi: fix address cleanup on avahi-autoipd exit
Fixes #638

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 4ed4fa5052 board/common: simplify avahi-autoipd.action script
- We know we always have iproute2 tools
 - We only use one ipv4ll client per interface, so UNBIND can be
   simplified to flush ifname:avahi
 - Log all events handled by script for troubleshooting

Note: on BIND event we may be called without first getting UNBIND on
      previous address, hence the flush there too.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg af1a86f10a board/common: reactivate scp/sftp and drop non-working cli subsystem
The sftp subsystem was lost in 61213c7.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 9079c55944 doc: minor, grammar and slight clarification of example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 6b37a7dd7c doc: Update ChangeLog with major package upgrades
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Mattias WalströmandGitHub c39a63e181 Merge pull request #656 from kernelkit/upgrade-rousette
Upgrade rousette and required CPP-bindings
2024-09-26 15:48:25 +02:00
Mattias Walström 5461a443a3 Upgrade rousette and required CPP-bindings
First release of rousette.
2024-09-26 15:05:38 +02:00
Tobias Waldekranz 057d255179 test: Disable services_basic
As detailed in the comment, we disable this test pending a fix for
2024-09-26 12:32:13 +02:00
Richard AlpeandJoachim Wiberg e3733982ed statd: never hide yanger faults
This is basically a functionally revert of:
435c5ca9 statd: allow ethtool --json to fail without breaking operational ds

Having a fail flag that hides all yanger faults is too big of a
hammer. If some hardware doesn't support a particular command such as
"ethtool --json" it should be handled gracefully by yanger. Perhaps by
catching the error and returning an empty dataset for that node.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 5d0f85cb07 statd: fix callback debug
Debug print the full xpath in all callbacks.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 83567c7e17 statd: move yanger args to caller
A non functional change. The caller knows more about how to format the
args, so it makes more sense to build the Yanger cmdline from the
caller.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 14128047e1 statd: remove nl code and improve speed
This is a major redesign of statd interface handling. The goal here is
to reduce the time it takes for statd to produce operational data for
all interfaces on larger iron. Which manifested itself most notably in
the CLI command "show interfaces".

This patch removes the netlink interface subscriptions done by the
statd c code. Instead statd now subscribes to the ietf-interfaces
base path which means it will be invoked for all interfaces.
If the user (sysrepo) has specified an explicit interface name such as
eth0, it will be extracted by statd and passed down to Yanger.

This patch also modifies Yanger to fit this new modus. No explicitly
passed interface name now means all interfaces.

Side note:
The main culprit of the slow operational interface data is the time it
takes to bootstrap python. Which prior to this patch was done for each
interface. On the HW system I'm testing this patch on, runtime is
reduced by a factor of 10.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Mattias WalströmandJoachim Wiberg 3e2b9fbd5e Build test specification on build
Also include the test specification in release tarballs.
2024-09-25 17:26:40 +02:00
Mattias Walström a857fa64f8 Changelog: Update changelog for 2024.09 release
Add fixed issues #635 and #648
2024-09-25 11:32:45 +02:00
Mattias Walström 33ad72b718 test: case: interfaces: Adapt tests to fit the test specification
Mostly text fixes but major rewrite in some tests.
2024-09-25 11:32:45 +02:00
Mattias Walström 7089f67da9 OSPF: Fix issue where all neighbors in the area where show on all interfaces
This fix #635
2024-09-25 11:32:45 +02:00
Mattias Walström aefaf94244 Bump linux kernel to 6.6.52 2024-09-25 11:32:45 +02:00
Mattias Walström a3a0d1a731 test: Remove obsolete test iface_status
Not needed, since it only verify the kernel is doing its thing.
2024-09-25 11:32:45 +02:00
Ahmed KaricandAhmed Karic 86c562d3b3 test: introduce image test-mode within the test environment
- The test mode, introduced at the config/build phase (commit 241f3f2),
causes the device to start in test-mode when used in GNS3 (or other
environments). This has unintentionally become the default
configuration for the image, which is not desirable and is only
acceptable for the Infix test system. With this update, the original
configuration is preserved, and the test mode is applied only within
the test environment.

- Align the 'dual' topology to use the same template as 'quad'

Fixes #603
2024-09-23 15:35:21 +02:00
Ahmed KaricandAhmed Karic df97c61ad6 test/docker: add e2tools
e2cp is needed for injecting test-mode file into the disk image
2024-09-23 15:35:21 +02:00
Ahmed KaricandAhmed Karic 621e76c925 Revert "board/common: introduce image test-mode"
This reverts commit 241f3f224f.
2024-09-23 15:35:21 +02:00
Mattias WalströmandJoachim Wiberg 0f9d429d9b confd: bump and add a migrate script for infix-routing 2024-09-21 08:47:02 +02:00
Mattias WalströmandJoachim Wiberg ef81abeae2 configuration migrate: Remove duplicate infix-meta:version when migrate config
when migrate configs the yang data produced was this:
  "infix-meta:meta": {
    version: "1.0"
    "infix-meta:version": "1.1"
  },

duplicate node, resulting in failed migration of startup configuration, always replace
whole node.
2024-09-21 08:47:02 +02:00
Mattias WalströmandJoachim Wiberg 4083fbf4c5 routing: Add a infix-routing-type to only support selected protocols
Today Infix only support OSPFv2 and Static routes, this hides all other
protocols in the CLI and makes it clearar about what we support in the YANG
model.
2024-09-21 08:47:02 +02:00