I am in a similar situation (pppoe sessions restarts, although my IP addresses do not change), and I needed to re-add the default IPv6 route after completion of IPv6CP. Note that there are several layers involved (link, IPv4, IPv6), I would guess that for pppoe "link is up" would mean LCP succeeded, which is before you get a new IP. For this reason I put together a small ad-hoc tool that monitors the addition of a new route, which occurs just after IPv6CP succeeds. See https://marc.info/?l=openbsd-misc&m=158834859429490&w=2 You could probably modify it to do what you need, using the monitor option of route(8) to guess what event you want to trigger the execution of your script. In fact it should be simpler.
If you manage to use ifstated(8) reliably, please let me know. On Wed, Jun 17, 2020 at 01:08:30PM +0000, Lévai, Dániel wrote: > Hi misc@! > > I'm trying to run a script whenever I get a new IP address from my ISP over > pppoe0. They disconnect me occasionally and the router reconnects then, eg.: > /bsd: pppoe: GENERIC ERROR: RP-PPPoE: Child pppd process terminated > /bsd: pppoe0: received unexpected PADO > last message repeated 2 times > > I have this as the last line in /etc/hostname.pppoe0: > !/bin/sh /etc/hostname.pppoe0.script pppoe0 0.0.0.1 > > It doesn't seem to be executed when this happens, only when I reboot the > router. Is the culprit here something along the lines of not (re)configuring > the interface with ifconfig up/down (in which case the script would run), > instead only getting disconnected and reconnecting? > > > Daniel >