From nobody Wed Aug 31 10:09:56 2022 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MHg0D2xhlz4ZtXJ for ; Wed, 31 Aug 2022 10:10:04 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501o.mail.yandex.net (forward501o.mail.yandex.net [37.140.190.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MHg0B41Slz43N7; Wed, 31 Aug 2022 10:10:02 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from vla5-47b3f4751bc4.qloud-c.yandex.net (vla5-47b3f4751bc4.qloud-c.yandex.net [IPv6:2a02:6b8:c18:3508:0:640:47b3:f475]) by forward501o.mail.yandex.net (Yandex) with ESMTP id 4614545C4830; Wed, 31 Aug 2022 13:09:59 +0300 (MSK) Received: by vla5-47b3f4751bc4.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id JUmwPbahn1-9wm0GT1v; Wed, 31 Aug 2022 13:09:58 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1661940599; bh=zziiNcbrTiax3j4AIx7AXh8WQo8QLocCATJ9bK9zuZQ=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=nFZT/wPMtHXxqpO4sRW7eezdK/e0cvHypLd/+Nusj2DGgK4kLmKDpxAW1iknmUm5J 1PmQHbGHIbwImWUQIIT0RlEeRQwDwu7ndqAzcbWFjPGw2Hv+yeJZ7q5DBV8ZjQhh6b EmRpS94iFiuzFwfzDEWYddUcp+uHTHSRSZUp1SKs= Content-Type: text/plain; charset=utf-8 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: Notification of change of IP address/Routing etc From: "Alexander V. Chernikov" In-Reply-To: <431B2046-B986-441D-97E8-BA7EDF0420A4@gmail.com> Date: Wed, 31 Aug 2022 11:09:56 +0100 Cc: Peter Jeremy , "net@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <260F641E-8D90-42B0-87C0-E7F62BAAB481@ipfw.ru> References: <67E19935-B868-4BFB-A9FF-9CD9A5547343@gmail.com> <431B2046-B986-441D-97E8-BA7EDF0420A4@gmail.com> To: Martin Stiemerling X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MHg0B41Slz43N7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b="nFZT/wPM"; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 37.140.190.203 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:37.140.128.0/18]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; RCVD_IN_DNSWL_LOW(-0.10)[37.140.190.203:from]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; DMARC_NA(0.00)[ipfw.ru]; TAGGED_RCPT(0.00)[]; FREEFALL_USER(0.00)[melifaro]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:13238, ipnet:37.140.128.0/18, country:RU]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[net@freebsd.org] X-ThisMailContainsUnwantedMimeParts: N > On 31 Aug 2022, at 10:11, Martin Stiemerling = wrote: >=20 > Hi,=20 >=20 >> Am 31.08.2022 um 11:00 schrieb Peter Jeremy : >>=20 >> On 2022-Aug-31 10:18:44 +0200, Martin Stiemerling = 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.=20 >>=20 >> 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). >=20 > Thanks, but that won=E2=80=99t help, as I need notifications about all = changes, even if the change is not happening thru dhcp. E.g., IPv6 = changes or manual changes.=20 >=20 > 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 >=20 > I have seen that there is a project for adding netlink to FreeBSD14: = https://github.com/pengnam/freebsd-netlink >=20 > Right now, I haven=E2=80=99t found a way, devd is for device changes = only, to get this done.=20 For now, you can use routing socket notifications (route(4)). "route -n monitor=E2=80=9D provide a quick way to check what=E2=80=99s = available at the moment. There are some plans to have netlink in 14 and 13 but the timeframe is = not settled yet. >=20 > I am happy to help to change this, but it is unclear to me where and = how to start.=20 >=20 > Thanks, >=20 > Martin=20 >=20 >=20 >=20 >=20