Re: Notification of change of IP address/Routing etc
Date: Wed, 31 Aug 2022 10:09:56 UTC
> On 31 Aug 2022, at 10:11, Martin Stiemerling <mls.ietf@gmail.com> wrote: > > Hi, > >> Am 31.08.2022 um 11:00 schrieb Peter Jeremy <peterj@freebsd.org>: >> >> On 2022-Aug-31 10:18:44 +0200, Martin Stiemerling <mls.ietf@gmail.com> wrote: >>> I am looking for a mechanism to get a notification from the OS when, for instance, an IP address on an interface or a routing entry is being changed. >> >> Assuming you are using the base OS version of dhclient, you could use >> /etc/dhclient-exit-hooks, which is a shellscript documented in >> dhclient-script(8). > > Thanks, but that won’t help, as I need notifications about all changes, even if the change is not happening thru dhcp. E.g., IPv6 changes or manual changes. > > This is for a gnmi-target, i.e., net management via yang/gnmi, under development for Linux and FreeBSD for routers, firewalls, software switches etc: > https://code.fbi.h-da.de/danet/gnmi-target > > I have seen that there is a project for adding netlink to FreeBSD14: https://github.com/pengnam/freebsd-netlink > > Right now, I haven’t found a way, devd is for device changes only, to get this done. For now, you can use routing socket notifications (route(4)). "route -n monitor” provide a quick way to check what’s available at the moment. There are some plans to have netlink in 14 and 13 but the timeframe is not settled yet. > > I am happy to help to change this, but it is unclear to me where and how to start. > > Thanks, > > Martin > > > >