> Am 03.09.2024 um 17:45 schrieb Florian Obser <flor...@openbsd.org>:
> 
> route -n monitor -inet6 | fgrep -A2 RTM_NEWADDR

Very interesting! Thank you!

I looked at the output of `route -n monitor -inet6` as there seems to be no 
documentation for what that looks like. And my Internet provider obliged me 
with a short outage which meant that new IPs were provided when it came back 
up. The output certainly contains all the relevant information.

I’ll probably have to build some sort of state machine to make use of the 
output, i.e. when it sees the first line containing RTM_NEWADDR, parse to 
extract the interface name, then read the second line and discard, then read 
the third line, extract the new IP/prefix and trigger an action, rinse and 
repeat.

Dealing with potential errors where route(8) stops sending output for some 
reason might be non-trivial as well. I’d like this to either auto-restart or 
notify the operator (me) in that case.

But this seems like a more efficient method than polling.


Mike


Reply via email to