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>
This commit is contained in:
Joachim Wiberg
2024-09-26 15:49:45 +02:00
parent 118dcd4b35
commit fa6851caa6
8 changed files with 80 additions and 55 deletions
@@ -89,6 +89,7 @@ define SKELETON_INIT_FINIT_SET_FRR
for svc in babeld bfdd bgpd eigrpd isisd ldpd ospfd ospf6d pathd ripd ripng staticd vrrpd zebra; do \
cp $(SKELETON_INIT_FINIT_AVAILABLE)/frr/$$svc.conf $(FINIT_D)/available/$$svc.conf; \
done
ln -sf ../available/staticd.conf $(FINIT_D)/enabled/staticd.conf
ln -sf ../available/zebra.conf $(FINIT_D)/enabled/zebra.conf
endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_FRR
@@ -1 +1,4 @@
service [2345] log:null <!pid/zebra> staticd -A 127.0.0.1 -u frr -g frr -f /etc/frr/staticd.conf -- Static routing daemon
# Run staticd-helper to collate /etc/static.d/*.conf before starting staticd
service log:null <!pid/zebra> pre:/usr/sbin/staticd-helper \
[2345] staticd -A 127.0.0.1 -u frr -g frr -f /etc/frr/staticd.conf \
-- Static routing daemon